Tag Archives: recovery

Oracle for beginner: a simple backup and recovery

http://selectsysdatefromdual.gnusystems.net/?p=71 Add another parameter like existing -f, -a, etc and create your own level 0 and 1 (I prefer using level 0 and 1 rather than full backup), then you could easily set into cronjob. We do a simple testing, do a full backup of Oracle running in archivelog mode:

#rmanbackup.sh -f
You should see backup(s) of data files, control files and archive logs:
RMAN> list backup;
If you want to delete and manage the backups, simply use this reference: http://docs.oracle.com/cd/B19306_01/backup.102/b14192/maint003.htm Let’s start:
#echo $ORACLE_BASE
/home/oracle/app/oracle
SQL> shutdown abort;
$ cd /home/oracle/app/oracle/oradata/orcl
Copy these all files and delete all of your data:
$ rm * -f
Sure you can’t startup Oracle. You can fix it using 2 ways: (1) copy files back to the folder (2) using backups. Let’s use backups:
RMAN> startup nomount;
RMAN> restore controlfile from '/home/oracle/app/oracle/backups/controlspfile/c-1310390050-20110813-03';
where c-1310390050-20110813-03 is your control file. If controlfile is corrupted, simply copy working control file to corrupted control file. Control file contains information about your data files, backup, etc. Once controlfile is recovered, do:
RMAN> alter database mount;
RMAN> restore database;
RMAN> recover database;
RMAN> alter database open resetlogs;
We do resetlogs because it’s running in archivelog mode to reset remaining archive log. Done!]]>

Tagged , , ,