ECC (Exadata Cloud at Customer) quarter rack ortamdaki Oracle 11.2.0.4 prod source db’nin birebir kopyasini ECC half rack üzerine rman duplicate ile olusturmak istedim.
Network hattinda timeout’a ugradigindan asagidaki hatayi aldim ancak rman duplicate’i tekrar bastan baslatmamak için kaldigim yerden devam ettirdim.
Sonrasinda bu hatayi almamak için sqlnet.ora’da SQLNET.EXPIRE_TIME = 10 parametresini ekledim.

RMAN duplicate ile kopya db olusturdugumuzda dbfile’larin restore edilmesi tamamlandiktan sonra recovery asamasinda asagidaki gibi hata aldiginizda kaldigi yerden manuel olarak recovery’yi tamamlayabilirsiniz:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/10/2018 05:32:10
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
start until change 7783094187914 using backup controlfile
ORA-00283: recovery session canceled due to errors
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: '+DATA/testdb/datafile/system.3656.991802549'

Kopyalama basarili bittiyse source db’de controlfile create edilir (en alttaki controlfile scripti):

alter database backup controlfile to trace;

alertlog’da verilen trace file’dan alacaginiz controlfile script ini degistirip control.sql çalistirilir

controlfile create ederken kizarsa pfile’a asagidaki gibi islersiniz:

alter system set controlfile '+DATA/TESTDB/CONTROLFILE/control01.ctl','+RECO/TESTDB/CONTROLFILE/control02.ctl';

sonrasinda create controlfile yapilir.

catalog start with komutundan sonra recover baslatilir, auto ile devam ettirilir:

$ export ORACLE_SID=<auxiliary>
$ rman target /
RMAN> run { 
catalog start with '<archive_dir>;
}

RECOVER DATABASE USING BACKUP CONTROLFILE until cancel;

SQL> RECOVER DATABASE USING BACKUP CONTROLFILE until cancel;
ORA-00279: change 7782432418117 generated at 11/05/2018 11:17:58 needed for
thread 1
ORA-00289: suggestion : +RECO/TESTDB/archivelog/991476404_13158_967712333.arc
ORA-00280: change 7782432418117 for thread 1 is in sequence #15929
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '+DATA/TESTDB/datafile/system.2911.991411179'

burdaki change id yi baz alip prod da ilgili sequence den archive lar restore edilir

select * from gv$archived_log where thread#=2 and first_change# > 7782432418117 order by sequence# asc
$ export ORACLE_SID=<auxiliary>
$ rman target sys/<passwd>@<target_db> auxiliary sys/<passwd>@<aux_db>
rman TARGET sys/*****@SOURCEDB AUXILIARY sys/******@TESTDB
backup as copy archivelog from sequence 15021 thread 2 auxiliary format '+RECO/TESTDB/ARCHIVELOG/%t_%s_%r.arc';
backup as copy archivelog from sequence 15021 thread 1 auxiliary format '+RECO/TESTDB/ARCHIVELOG/%t_%s_%r.arc';

–yada belirli bir araliga ait sequencelar için:

backup as copy archivelog from sequence 15010 until sequence 15021 thread 2 auxiliary format '+RECO/TESTDB/ARCHIVELOG/%t_%s_%r.arc';

AUTO dedigimizde restore ettigimiz archive loglari kendi otomatik olarak isler. ‘..warning: RECOVER succeeded but..’ mesajini gördügünüzde recover’in tamamlandigini anlayabilir bu noktadan itibaren db’yi acabilirsiniz yada gelmek istediginiz saate kadar recover’a devam edebilirsiniz.

asmcmd’ye girilip archive loglarin gelip gelmedigi, hangilerinin eksik oldugunu görülebilir

sonrasinda open resetlogs ile db açilir:

SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
SQL> alter database open resetlogs;
Database altered.
SQL>
SQL> alter session set NLS_DATE_FORMAT='DD-MM-YYYY HH:MI:SS';
Session altered.
SQL> select scn_to_timestamp(7783166819165) as timestamp from dual;
TIMESTAMP
---------------------------------------------------------------------------
05-NOV-18 02.13.29.000000000 PM

Point In Time (PIT) recovery yaparak o anki haliyle dbyi asagidaki gibi de açabiliriz:

col SCN format 999999999999999
select max(NEXT_CHANGE#)-1 as "SCN" from V$ARCHIVED_LOG;

SCN
----------------
7783141216060

recover database until change 7783141216060;
alter database open resetlogs;

control.sql
*********************

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "TESTDB" RESETLOGS FORCE LOGGING ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 2336
LOGFILE
GROUP 5 (
'+DATA',
'+RECO'
) SIZE 8192M BLOCKSIZE 512,
GROUP 7 (
'+DATA',
'+RECO'
) SIZE 8192M BLOCKSIZE 512,
GROUP 9 (
'+DATA',
'+RECO'
) SIZE 8192M BLOCKSIZE 512,
GROUP 11 (
'+DATA',
'+RECO'
) SIZE 8192M BLOCKSIZE 512,
GROUP 13 (
'+DATA',
'+RECO'
) SIZE 8192M BLOCKSIZE 512,
GROUP 15 (
'+DATA',
'+RECO'
) SIZE 8192M BLOCKSIZE 512
DATAFILE
'+DATA/TESTDB/DATAFILE/AUDIT_TBS.2989.991412793',
'+DATA/TESTDB/DATAFILE/AUDIT_TBS.3478.991412803',
'+DATA/TESTDB/DATAFILE/TEST.2979.991412781',
'+DATA/TESTDB/DATAFILE/SYSAUX.3365.991412583',
'+DATA/TESTDB/DATAFILE/SYSAUX.3407.991411511',
'+DATA/TESTDB/DATAFILE/SYSAUX.3454.991408729',
'+DATA/TESTDB/DATAFILE/SYSTEM.2911.991411179',
...
CHARACTER SET WE8ISO8859P9
;

 

Referans:  Manual Completion of a Failed RMAN Duplicate FROM ACTIVE DATABASE (Doc ID 1602916.1)

Reklamlar