Restore database from rman backup of standby database

Сайн уу.
Physical standby-с rman нөөцлөлт аваад үүнийгээ ашиглан өгөгдлийн санг restore хийсэн туршилтыг танилцуулж байна.

  1. Standby өгөгдлийн сангаас RMAN нөөцлөлт авах.
RUN {
    BACKUP
    FORMAT '/home/oracle/backup/%d_D_%T_%u_s%s_p%p'
    DATABASE
    CURRENT CONTROLFILE
    FORMAT '/home/oracle/backup/control%d_C_%T_%u'
    PLUS ARCHIVELOG
    FORMAT '/home/oracle/backup/%d_A_%T_%u_s%s_p%p';
}

SQL > create pfile='/home/oracle/backup/pfile.ora' from spfile;
  1. Өгөгдлийн санг RESTORE хийх гэж байгаа үйлдлийн систем рүү нөөцлөлтийг хуулах
Жич: Жишээ дээр ижилхэн '/home/oracle/backup' гэсэн замыг ашиглаад явъя. Хэрвээ зам өөр бол нөөцлөлтөө catalog хийх шаардлага гарна. 
  1. Өгөгдлийн санг NOMOUNT төлөвт асаах
SQL > CREATE SPFILE FROM PFILE='/home/oracle/backup/pfile.ora';
SQL > STARTUP NOMOUNT
  1. Control файл сэргээх, MOUNT төлөвт шилжүүлэх
RMAN> restore primary controlfile from '/home/oracle/backup/controlBCKP_C_20210921_0709ld6b';

Starting restore at 21-SEP-21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/SBY1/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/SBY1/control02.ctl
Finished restore at 21-SEP-21
RMAN> alter database mount;
  1. RESTORE, RECOVER, OPEN Database
RMAN> restore database;

Starting restore at 21-SEP-21
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/SBY1/system01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/SBY1/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/SBY1/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/SBY1/users01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/BCKP_D_20210921_0509ld5g_s5_p1
channel ORA_DISK_1: piece handle=/home/oracle/backup/BCKP_D_20210921_0509ld5g_s5_p1 tag=TAG20210921T215703
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 21-SEP-21

RMAN> recover database;

Starting recover at 21-SEP-21
using channel ORA_DISK_1

starting media recovery

unable to find archived log
archived log thread=1 sequence=178
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/21/2021 22:24:05
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 178 and starting SCN of 16269224

RMAN> recover database until scn 16269224;

Starting recover at 21-SEP-21
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 21-SEP-21

RMAN> alter database open resetlogs;

Statement processed
  1. Check role and open_mode
SQL> select database_role, open_mode from v$database;

DATABASE_ROLE   OPEN_MODE
---------------- --------------------
PRIMARY    READ WRITE

Баярлалаа.

1 Like