RAC Database’ i Son Backupdan Nasıl Restore Edilir

RAC database’ lerinin restore işlemi ile ilgili bir örnek ;

Öncelikle işleme veritabanı kapatmakla başlıyoruz ;

[oracle@Node1test]$ srvctl stop database -d test

ASM diskleri üzerinde bulunan datafile’lar silinir.

ASMCMD> cd +DATA001/TEST/DATAFILE
ASMCMD> ls -l
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y DATA2.274.841577871
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y EXAMPLE.267.836929971
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y SYSAUX.257.836929869
DATAFILE UNPROT COARSE MAR 17 12:00:00 Y SYSTEM.256.836929867
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y TESTDATA.275.841577885
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y TESTINDX.276.841577901
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y UNDOTBS1.258.836929869
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y UNDOTBS2.268.836930081
DATAFILE UNPROT COARSE MAR 17 15:00:00 Y USERS.259.836929869

ASMCMD> rm -f *

Artık kullanılabilir durumda olan bir datafile ‘ imiz yok bu durumda iken veritabanını açmaya çalıştığımız da aşağıdaki hatayı alırız;

[oracle@Node1test]$ srvctl start instance -d test -n node1
PRCR-1013 : Failed to start resource ora.test.db
PRCR-1064 : Failed to start resource ora.test.db on node Node1
CRS-5017: The resource action “ora.test.db start” encountered the following error:
ORA-01157: cannot identify/lock data file 1 – see DBWR trace file
ORA-01110: data file 1: ‘+DATA001/test/datafile/system.256.836929867′
. For details refer to “(:CLSN00107:)” in “/u01/grid/11.2.0/log/node1/agent/crsd/oraagent_oracle/oraagent_oracle.log”.
CRS-2674: Start of ‘ora.test.db’ on ‘Node1′ failed

Backupdan dönebilmek için veritabanı tek node’da nomount olarak start edilir.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 8033804288 bytes
Fixed Size 2244232 bytes
Variable Size 1577058680 bytes
Database Buffers 6442450944 bytes
Redo Buffers 12050432 bytes

Cluster_database parametresi FALSE’ a set edilir.

SQL> alter system set cluster_database=false scope=spfile sid=’*';
System altered.

Veritabanı tekrar kapatılarak mount modda açılır;

SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.
Total System Global Area 8033804288 bytes
Fixed Size 2244232 bytes
Variable Size 1577058680 bytes
Database Buffers 6442450944 bytes
Redo Buffers 12050432 bytes
Database mounted.

Rman ile restore ve recovery başlatılır;

RMAN> RUN
2> {
3> ALLOCATE CHANNEL c1 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/oracle/db/11.2.0/lib/libobk.so, NB_ORA_CLIENT=Node1, NB_ORA_SERV=veritas)';
4> RESTORE DATABASE;
5> RECOVER DATABASE;
6> }

using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=641 instance=test1 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle – Release 7.0 (2010070800)

Starting restore at 17-MAR-14

channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00004 to +DATA001/test/datafile/users.259.836929869
channel ch00: restoring datafile 00005 to +DATA001/test/datafile/example.267.836929971
channel ch00: restoring datafile 00008 to +DATA001/test/datafile/testdata.275.841577885
channel ch00: reading from backup piece bk_121_1_842443245
channel ch00: piece handle=bk_121_1_842443245 tag=TEST1_20140317
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:55
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00003 to +DATA001/test/datafile/undotbs1.258.836929869
channel ch00: restoring datafile 00006 to +DATA001/test/datafile/undotbs2.268.836930081
channel ch00: restoring datafile 00009 to +DATA001/test/datafile/testindx.276.841577901
channel ch00: reading from backup piece bk_120_1_842443245
channel ch00: piece handle=bk_120_1_842443245 tag=TEST1_20140317
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:55
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00001 to +DATA001/test/datafile/system.256.836929867
channel ch00: restoring datafile 00002 to +DATA001/test/datafile/sysaux.257.836929869
channel ch00: restoring datafile 00007 to +DATA001/test/datafile/DATA2.274.841577871
channel ch00: reading from backup piece bk_119_1_842443244
channel ch00: piece handle=bk_119_1_842443244 tag=TEST1_20140317
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:01:15
Finished restore at 17-MAR-14

Starting recover at 17-MAR-14

starting media recovery

archived log for thread 1 with sequence 107 is already on disk as file +FRA/test/archivelog/test_t_1_107_836929951.arc
archived log for thread 1 with sequence 108 is already on disk as file +FRA/test/archivelog/test_t_1_108_836929951.arc
archived log for thread 1 with sequence 109 is already on disk as file +FRA/test/archivelog/test_t_1_109_836929951.arc
archived log for thread 2 with sequence 78 is already on disk as file +FRA/test/archivelog/test_t_2_78_836929951.arc
archived log for thread 2 with sequence 79 is already on disk as file +FRA/test/archivelog/test_t_2_79_836929951.arc
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=2 sequence=77
channel ch00: reading from backup piece arc_126_1_842443377
channel ch00: piece handle=arc_126_1_842443377 tag=TEST1ARC20140317
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:45
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=1 sequence=106
channel ch00: reading from backup piece arc_127_1_842443377
channel ch00: piece handle=arc_127_1_842443377 tag=TEST1ARC20140317
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:45
archived log file name=+FRA/test/archivelog/test_t_1_106_836929951.arc thread=1 sequence=106
archived log file name=+FRA/test/archivelog/test_t_2_77_836929951.arc thread=2 sequence=77
archived log file name=+FRA/test/archivelog/test_t_1_107_836929951.arc thread=1 sequence=107
archived log file name=+FRA/test/archivelog/test_t_2_78_836929951.arc thread=2 sequence=78
media recovery complete, elapsed time: 00:00:03
Finished recover at 17-MAR-14
released channel: ch00

Veritabanı açılır ;

RMAN> alter database open;
database opened

Cluster _database parametresi tekrar TRUE’ ya aınarak veritabanı restart edilir ;

SQL> alter system set cluster_database=true scope=spfile sid=’*';
System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

Veritabanı her iki node’da da açılır;

[oracle@Node1test]$ srvctl start database -d test

Kontrol ettiğimiz de her iki node’ da da açık olduğunu görebiliriz ;

[oracle@Node1test]$ srvctl status database -d test
Instance test1 is running on node node1
Instance test2 is running on node node2

Be Sociable, Share!

Bir Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


7 − beş =

Şu HTML etiketlerini ve özelliklerini kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">