DR Recovery RMAN backup to new server –1ST Main Method

RMAN

MAKE SURE SUFFICIENT SPACE IS AVAILABLE ON TEST SERVER TO RESTORE THE BACKUP:

—————————————————————————–

STEP:1 (AT SOURCE)

> select max(next_change#) from v$archived_log where archived = ‘YES’ group by thread#;

MAX(NEXT_CHANGE#)

—————–

         69855380

         69855328

or

rman target /

list archivelog all;  (from RMAN note highest seq no)

—Copy all the backup pieces of source(PROD) database to target(TEST) server.

STEP:2 (AT DEST)

mkdir -p /u03/app/oracle/test/

chown -R oracle:oinstall /u03/app/oracle/test/

chmod -R 775 /u03/app/oracle/test/

mkdir -p /u03/app/oracle/admin/test/adump/

chown -R oracle:oinstall /u03/app/oracle/admin/test/adump/

chmod -R 775 /u03/app/oracle/admin/test/adump/

mkdir -p /u03/app/oracle/

chown -R oracle:oinstall /u03/app/oracle/

chmod -R 775 /u03/app/oracle/

STEP:3 (AT DEST)

export ORACLE_SID=test

rman

connect target /

STEP:4 (AT DEST)

set dbid = <dbid of database>;

restore spfile to pfile ‘/Software/inittest.ora’ from ‘/Software/bkp/SPFILE_TEST_set22415_piece1_20161003_sfrhdk1c_1_1_DBID3605736811’;

STEP:5 (AT DEST)

startup nomount pfile=’/Software/inittest.ora’;

STEP:6 (AT DEST)

restore controlfile from ‘/Software/bkp/CTLFILE_TEST_set22641_piece1_20161005_3hrhitth_1_1_DBID3605736811’;

STEP:7 (AT DEST)

alter database mount;

STEP:8 (AT DEST)

catalog start with ‘/Software/bkp’;

run

{

set newname for datafile ‘+DATA/test/system01.dbf’ to ‘/u03/app/oracle/test/system01.dbf’;

set newname for datafile ‘+DATA/test/sysaux01.dbf’ to ‘/u03/app/oracle/test/sysaux01.dbf’;

set newname for datafile ‘+DATA/test/undotbs01.dbf’ to ‘/u03/app/oracle/test/undotbs01.dbf’;

set newname for datafile ‘+DATA/test/users01.dbf’ to ‘/u03/app/oracle/test/users01.dbf’;

set newname for datafile ‘+DATA/test/undotbs02.dbf’ to ‘/u03/app/oracle/test/undotbs02.dbf’;

restore database;

switch datafile all;

recover database;

}

STEP:9 (AT DEST)

sqlplus / as sysdba

alter database rename file ‘+DATA/test/redo01.log’ to ‘/u03/app/oracle/test/redo01.log’;

alter database rename file ‘+DATA/test/redo02.log’ to ‘/u03/app/oracle/test/redo02.log’;

alter database rename file ‘+DATA/test/redo03.log’ to ‘/u03/app/oracle/test/redo03.log’;

alter database rename file ‘+DATA/test/redo04.log’ to ‘/u03/app/oracle/test/redo04.log’;

alter database rename file ‘+DATA/test/temp01.dbf’ to ‘/u03/app/oracle/test/temp01.dbf’;

STEP:10 (AT DEST)

sqlplus / as sysdba

alter database open resetlogs;

Error:

——

ERROR at line 1:

ORA-00392: log 1 of thread 1 is being cleared, operation not allowed

ORA-00312: online log 1 thread 1: ‘/u03/app/oracle/test/redo01.log’

Solution:

———

                  select status from v$log where GROUP#=1;

STATUS

—————-

CLEARING_CURRENT

                  alter database clear unarchived logfile group 1;

SQL> alter database open resetlogs;

ERROR at line 1:

ORA-00392: log 4 of thread 2 is being cleared, operation not allowed

ORA-00312: online log 4 thread 2: ‘+DATA/test/redo04.log’

SQL> alter database clear unarchived logfile group 1;

–Open the database and configure the database

alter database open resetlogs;

STEP:11 (AT DEST)–Match scn seq from prod and test from rman

                  list archivelog all;  (from RMAN note highest seq no)

—-

Once Successful recovery of the database Recreate the controlfile:

Sql> alter database backup control file to trace;

—> Backup and test your newly created database from RMAN restoration.

FOR APPLYING CUMULATIVE BACKUP AFTER APPLYING FULL BACKUP: (NOT TESTED) POINT IN TIME RECOVERY

SCN-Based incomplete recovery;

$ sqlplus “/ as sysdba”

SQL> shutdown abort;

SQL> startup mount;

$ rman target /

SYNTAX:

——-

RUN

{

SET UNTIL TIME ‘Aug 10 2009 11:00:00’;

# SET UNTIL SCN 100; # alternatively, specify SCN

# SET UNTIL SEQUENCE 123; # alternatively, specify log seq

RESTORE DATABASE;

RECOVER DATABASE;

}

STEP:  —-(KEEP SEQ ONE EXTRA FROM LOG SEQ NO)

—–

RUN

{

SET UNTIL SEQUENCE 4650;

RESTORE DATABASE;

RECOVER DATABASE;

}

alter database open resetlogs;

Error:

——

ERROR at line 1:

ORA-00392: log 1 of thread 1 is being cleared, operation not allowed

ORA-00312: online log 1 thread 1: ‘/u03/app/oracle/test/redo01.log’

Solution:

———

                  select status from v$log where GROUP#=1;

STATUS

—————-

CLEARING_CURRENT

                  alter database clear unarchived logfile group 1;

SQL> alter database open resetlogs;

ERROR at line 1:

ORA-00392: log 4 of thread 2 is being cleared, operation not allowed

ORA-00312: online log 4 thread 2: ‘+DATA/test/redo04.log’

SQL> alter database clear unarchived logfile group 1;

–Open the database and configure the database

alter database open resetlogs;

STEP:11 (AT DEST)–Match scn seq from prod and test from rman

                  list archivelog all;  (from RMAN note highest seq no)