Random

Update WordPress Installations to >4.7.2

This post is applicable for hosted wordpress installations where auto-updates are disabled.

Yesterday, I noticed there was blog post “Hacked by Unknown” on Askdba blog.

Post was written by White Hat Hacker who exploited the Content injection vulnerability in 4.7.0 and 4.7.1. This vulnerability allows any visitor (unauthorized user) to assume role to edit/create blog posts  Since auto-updates were disabled , security patches had to be applied manually.
I had disabled auto-updates  as it had broken my WordPress installation. But I have enabled it now and would recommend all to ensure that they upgrade their installations manually or enable auto-updates .

In case auto-updates were disabled, you can enable auto-updates by removing following line from wp-config.php

define( ‘WP_AUTO_UPDATE_CORE’, false );

More details regarding this vulnerability can be found  here

Recovering from Lost AWS EC2 Key

This article is for AWS users using EC2 instances.
Summary: Please backup your AWS EC2 Key file and you will never have to go through below pain 🙂

AWS allows you to create a key-pair which can be downloaded on your machine and it is used for logging into your EC2 instance.
I had been using the same for accessing the EC2 instance for this blog. But last week my corporate laptop was upgraded and I took backup of all files except this key file.

I didnt realize this until saturday when I wanted to login to my EC2 instance. When I couldn’t find the file, I thought of downloading it again from AWS console.
But it was no where to be found. I searched and found out that we can’t download this file again.

Only solution to this problem is to create new EC2 instance with new key pair and then move site . I have documented high level tasks which can be used to restore. These steps are performed on AWS micro instance and its assumed that all your files are lying on EBS volume. My earlier article on AWS setup can be used for configuring EC2 instance.

1. Create new ec2 instance with new key-pair and make multiple backup copies of this key file and store at multiple location. Next install apache,php,mysql or any other component required for your site. Its better to create EC2 instance in same region as your old instance like us-east-1a.
2. Assign new elastic ip address to this EC2 instance.
3. If your site is working then you can login to wordpress panel and take mysql backup which can be restored to the new ec2 instance. I use WP-DBManager plugin for mysql backups.
4. Next take snapshot of your existing ec2 volume (hosting blog document directory) . This has to be done via EC2 dashboard ->Elastic Block Store ->Snapshots .This has to be in same region as new EC2 instance as we will be mounting the volume. On completion of snapshot, create a new volume out of this snapshot.
5. We need to attach this volume to new EC2 instance.  Go to EC2 dashboard ->Elastic Block Store ->Volumes. Choose the new volume and actions->attach volume and choose new EC2 instance name. Give volume name as /dev/xvdh
6. Within seconds, you should see this volume in your EC2 instances. e.g

cat /proc/partitions 
major minor  #blocks  name

 202        1    8388608 xvda1
 202      112    8388608 xvdh

7. Create a new directory and mount this volume
#mkdir /newdir
#mount /dev/xvdh /newdir

8. You can copy your blog files from /newdir/var/www/html (document root). Also any config files can be restored from old machine.
9. Import the mysql database from mysql dump
10. Once this is done, you can test whether your site is working fine.
e.g

UPDATE wp_options SET option_value = replace(option_value, 'http://oldsite', 'http://ec2-instance-name') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://oldsite','http://ec2-instance-name');
UPDATE wp_posts SET post_content = replace(post_content, 'http://oldsite', 'http://ec2-instance-name');

This way you can verify if site is working fine. Once done restore back the old name by modifying above sql or reimporting the mysql db.

11. Final step is to switch site to new EC2. I am using cloudflare for DNS management which allows instant propagation of DNS change.So I assigned new elastic IP to this EC2 instance and changed my DNS record to point to this new EC2 instance.
Other option could be that you can disassociate your old elastic IP from old EC2 and attach to the new EC2 instance.

Happy New Year – Goodbye 2012 and welcome 2013

It seems Mayan’s freaked out lot of people by not making 2013 calendar 🙂 Anyways our world survives and we will be entering 2013 in another 7 hours. So wishing all Oracle Community members a “Happy And Prosperous New Year

This year we have heard lot of buzz around “Big Data” and it seems to be gaining popularity in Data warehousing World.  Oracle will be releasing its Oracle 12c database next year with emphasis on Cloud features. Let’s wait and see what is in store for us.

This year’s annual wordpress stats report is out and we clocked 230,000 pageviews in 2012. We have not been active this year and have got most of the hits on older articles. We hope to improve it in coming year.

On personal front this was Wonderful year.  My younger sister got married this year,Saurabh was blessed with Baby Boy and Abhishek had a Sweet little Angel.

Btw I have moved this blog to Amazon AWS platform on trial basis. Will check for some time before posting my experience with it.

(In case you are wondering why there is Snow falling on screen, this is provided by wordpress upto 4th Jan and can be enabled in settings 🙂 )

AIOUG 2011 – I am Attending :)

All India Oracle User Group(AIOUG) is organizing the annual Oracle Conference in Bangalore on Friday, December 9th and Saturday December 10th, 2011.Arup Nanda is key speaker this year.

I will be attending this conference for first time and I am looking forward to meeting fellow bloggers/DBA’s. See you all there

You can find the registration link at http://www.aioug.org/sangam11.php

October 2010 Blogroll Report

It’s been time since we saw log-buffer edition with last being published on 1st October 2010 and  Coskan’s weekly blogroll report

I found them really useful to read top blog articles for week. So I decided to tag few articles posted in October 2010 which I  had read and found useful. I am subscribed to orana.info so most of articles are already aggregated there (barring few). Unlike Pythian’s log buffer, I will be concentrating only on Oracle Database Related posts. Lets start

11.2.0.2 patchset introduced lot of new features in Grid Infrastructure. Martin Bach discusses Redundant Interconnect feature introduced in 11.2.0.2 in his following post

Then there is series on setting up Stretched RAC (with 4 parts published till now) from him

Julian Dyke has started his blog and have posted quite a number of articles related to 11.2.0.2
He discussed issue related to Multicasting (required to enable HAIP interconnect feature) in below post

Julian also published test program to check if multicasting is enabled on your box

Ritesh has posted a handy script to map ASM devices on EMC along with Disk number along with a  tweak in max sector size configuration on RHEL5 which can boost ASM Performance.Read more below


Doug writes about a issue related to SQL*Net events and methodology used by him to debug ‘SQL*Net more data from client’ wait event

tkprof has undergone a suprising change in 11.2.0.2. Read Christian’s article about tkprof changes in 11.2.0.2

Another posting from Christian highlights changes related to Deferred Segment creation introduced in 11.2.0.2 in following post


Jarneil writes post about SQL Plan Management in 11g and discusses a case when adding index to table is not picked automatically by CBO

How do you answer question “What is difference between Nested Loop and Hash Joins“. Tanel Poder says “Hash joins can not look up rows from the inner (probed) row source based on values retrieved from the outer (driving) row source, nested loops can.”
Read on below article (make sure to check comments section to know what Jonathan Lewis and Christo kutrovsky had to say)


Check out article on Reading parallel execution with Bloom pruning by Greg Rahn


In 11.2 you can query bind values of running query instead of dumping using errorstack. Tanel Poder gives a example describing with example


Dominic talks about NLS (I know many of you would be scared but believe me you can’t avoid it). Read about using NLS_LENGTH_SEMANTICS

Kellyn troubleshoots ora-600 on RMAN and is able to resolve the bug without applying patch.

Meanwhile she is also trying out setting up wordpress blog on dbakevlar.com (which is so much better than blogspot)

Craig Shallahamer explains correlation between database commit time and log file sync time

Do you have export scripts which you are scared to migrate to datapump. Probably Legacy mode of datapump (11gR2 feature) can help you. Aman Sharma explains the usage in below post
Happy Reading!