Thứ Năm, 6 tháng 8, 2015

RMAN: Restoring a Database from INCREMENTAL Backup


BACKUP:
Backup incremental level 0:
RMAN> run {
 allocate channel st1 device type disk;
allocate channel st2 device type disk;
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/setup/rman/%F';
backup format '/setup/rman/%d_%U.rman' incremental level 0 database;
sql 'alter system archive log current';
backup format '/setup/rman/%d_archivelog_%U.rman' archivelog all not backed up 1 times;
release channel st1;
release channel st2;
}
Backup incremental level 1:
RMAN> run{  
allocate channel st1 device type disk;
allocate channel st2 device type disk;
backup format '/setup/rman/%d_%U.rman' incremental level 1 database;
sql 'alter system archive log current';
backup format '/setup/rman/%d_archivelog_%U.rman' archivelog all not backed up 1 times;
release channel st1;
release channel st2;
}

RESTORE and RECOVER:


export ORACLE_SID=RMANINCRE
[oracle@dg01 ~]$ rman target /
RMAN> startup nomount;
RMAN> set DBID=3750471372; =<Get second string from controfile_autobackup>
RMAN> run{
set CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/setup/rman/%F';
restore controlfile from autobackup;
}
RMAN> alter database mount;
RMAN> list backup of archivelog all;
RMAN> restore archivelog all
RMAN> run{
restore database;
recover database;
}

Getting Error:
archived log thread=1 sequence=8
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/07/2015 01:05:48
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 8 and starting SCN of 1274659
Check sequence archivelog backed up With sequence number restored.if they is equal then OK.
RMAN> list backup of archivelog all;
RMAN> alter database open resetlogs;

Không có nhận xét nào: