Search This Blog

Friday, August 24, 2007

Recover Database using RMAN

I use the following script to backup my database , with out catalog

Backup
======
run
{
allocate channel ch1 type disk;
backup incremental level 0 as backupset tag=full_backup (database);
sql 'alter system archive log current';
release channel ch1;
allocate channel ch1 type disk;
backup archivelog all tag=archives_backup
delete all input;
release channel ch1;

}
delete noprompt obsolete;
restore validate database;

Restore
=======
RMAN>shutdown immediate
RAMN>connect target sys/oracle
RMAN>startup mouunt
RMAN>
RUN
{
allocate channel ch1 type disk;
sql "alter session set nls_date_format=''MM-DD-YYYY HH24:MI:SS''";
set until time '08-24-2007 10:47:00';
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
release channel ch1;
}