Friday, December 14, 2007

database recovery

Dec 13 after work hour 7pm-
I had this task to move the datafile from one filesystem to another filesystem and change the names.this production db was not so big (only around 75gb+ ) so I started moving the file one by one . and it was getting late so my friend coworker Howard volunteered to move few files from the bottom while I am doing from the top of the list. but while moving he moved one of the file USERS02.sun to USERS01.dbf . so here the unforeseen thing happened and we just lost one of our datafile USERS01.dbf .

and it has been not a while since we moved our backup strategy for this db to rman so as it was supposed to be on once a week hot full db backup and daily archivelog backup so i thought we might get it recovered and so I checked then the latest I could see was the Nov 28 backup which is almost 2 week old . so it was like I felt that we both might loose our job if we could not get this db up and running.

well I start to do a rman restore for the datafile and it took like 2 hour to restore from the compressed backuppiece of Nove 28 backup. and now comes the hard part to recover it . as I found that we need almost 1000+ archive log file to do a complete recover. this db was running on a 100gb SAN. so space also was a critical . so when I started rman recover it verified that all the log files are in disk ( archivelog backuppiece) . and it started restoring the log files from backuppiece which was in another /obackup file system to the 100gb /datastore . so I had to wait and watch as it restore and apply the archivelog and move back into the /obackup. and I also found that there was a 10gb temp file being used so we moved it to /obackup while the restore log process is going on . and it lasted till 3am in the morning and we were done with recovering the db and it was up and running . we both just thanked god and left for home. and thanks to rman which saved our job .

nov 28- rman hot backup

there was a cold backup on dec 4 which we could not find immediatly accessible

till dec 12 - rman log backup set

startup mount

restore datafile 25
recover datafile 25

alter database open .


so in this process here are my learning.

1- before i did the the rearranging of files I should have checked the backup available for the db
2- mv is dangerous it is equally as dangerous as rm.
3- size of a production db doesn't matter

No comments: