Saturday, 4 February 2023

RMAN BASED RESTORE AND RECOVERY

http://lefterhs.blogspot.com/2012/06/clone-database-using-rman-restore.html


Recovery Manager: Release 11.2.0.2.0 - Production on Fri Jul 13 15:15:59 2016

rman target / log='/oracle/g01/software/DNAD101_RMAN_BKP_27052015/full_backup.log'

RMAN>CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oracle/g01/software/DNAD101_RMAN_BKP_27052015/ora_df%t_s%s_s%p';

RMAN> backup database plus archivelog;

(check status

 
column module format a30
select sysdate,a.SID, b.process,b.module,a.START_TIME,a.TOTALWORK, a.sofar, (a.sofar/a.totalwork) * 100 done,sysdate + a.TIME_REMAINING/3600/24 end_at from v$session_longops a,v$session b where a.totalwork > a.sofar AND a.opname NOT LIKE '%aggregate%' AND a.opname like 'RMAN%' and a.sid=b.sid order by b.process

)

Starting backup at 13-JUL-16
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=52 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=17 RECID=1 STAMP=788540852
input archived log thread=1 sequence=18 RECID=2 STAMP=788541371
channel ORA_DISK_1: starting piece 1 at 13-JUL-16
channel ORA_DISK_1: finished piece 1 at 13-JUL-16
piece handle=/u01/app/oracle/flash_recovery_area01/DBUPG/backupset/2016_07_13/o1_mf_annnn_TAG20120713T151612_800shf7w_.bkp tag=TAG20120713T151612 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area01/DBUPG/archivelog/2016_07_13/o1_mf_1_17_800rz40y_.arc RECID=1 STAMP=788540852
archived log file name=/u01/app/oracle/flash_recovery_area01/DBUPG/archivelog/2016_07_13/o1_mf_1_18_800shcsd_.arc RECID=2 STAMP=788541371
Finished backup at 13-JUL-16

Starting backup at 13-JUL-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DS8000_DG/dbupg/datafile/system.271.788537119
input datafile file number=00002 name=+DS8000_DG/dbupg/datafile/sysaux.272.788537167
input datafile file number=00003 name=+DS8000_DG/dbupg/datafile/undotbs1.273.788537199
input datafile file number=00004 name=+DS8000_DG/dbupg/datafile/users.275.788537229
channel ORA_DISK_1: starting piece 1 at 13-JUL-16
channel ORA_DISK_1: finished piece 1 at 13-JUL-16
piece handle=/u01/app/oracle/flash_recovery_area01/DBUPG/backupset/2016_07_13/o1_mf_nnndf_TAG20120713T151614_800shgw5_.bkp tag=TAG20120713T151614 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 13-JUL-16
channel ORA_DISK_1: finished piece 1 at 13-JUL-16
piece handle=/u01/app/oracle/flash_recovery_area01/DBUPG/backupset/2016_07_13/o1_mf_ncsnf_TAG20120713T151614_800sjm29_.bkp tag=TAG20120713T151614 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-JUL-16

Starting backup at 13-JUL-16
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=19 RECID=3 STAMP=788541412
channel ORA_DISK_1: starting piece 1 at 13-JUL-12
channel ORA_DISK_1: finished piece 1 at 13-JUL-12
piece handle=/u01/app/oracle/flash_recovery_area01/DBUPG/backupset/2016_07_13/o1_mf_annnn_TAG20120713T151652_800sjnf7_.bkp tag=TAG20120713T151652 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area01/DBUPG/archivelog/2016_07_13/o1_mf_1_19_800sjn5q_.arc RECID=3 STAMP=788541412
Finished backup at 13-JUL-16

RMAN> backup current controlfile;

Starting backup at 13-JUL-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 13-JUL-16
channel ORA_DISK_1: finished piece 1 at 13-JUL-16
piece handle=/u01/app/oracle/flash_recovery_area01/DBUPG/backupset/2016_07_13/o1_mf_ncnnf_TAG20120713T153435_800tkwl2_.bkp tag=TAG20120713T153435 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-JUL-16





Create spfile..

*.control_files='+DS8000_DG/dbclone/controlfile/Current.277.788541913'
*.db_name='dbupg'
*.db_unique_name='dbclone'
*.audit_file_dest='/u01/app/oracle/admin/dbclone/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.db_block_size=8192
*.db_create_file_dest='+MMC'
*.db_domain=''
*.db_recovery_file_dest_size=107374182400
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area01'
*.diagnostic_dest='/u01/app/oracle'
*.log_file_name_convert='+DS8000_DG','+MMC'
*.memory_target=1031798784
*.open_cursors=300

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 13 15:33:24 2016

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 1027182592 bytes
Fixed Size                  2227936 bytes
Variable Size             599785760 bytes
Database Buffers          419430400 bytes
Redo Buffers                5738496 bytes
SQL> show parameter db_n

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      dbupg
SQL> show parameter db_un

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      dbclone


RMAN> restore controlfile from '/oracle/g01/bkup01/DNAD101/rman_bkp/ora_df881013952_s12_s1';

Starting restore at 13-JUL-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=290 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output file name=+DS8000_DG/dbclone/controlfile/current.277.788541913
Finished restore at 13-JUL-16

RMAN> startup mount

database is already started
database mounted
released channel: ORA_DISK_1

RMAN>CATALOG START WITH '/oracle/g01/bkup01/DNAD101/rman_bkp/';

RMAN> run {
2> SET NEWNAME FOR DATABASE TO '+MMC';
3> restore database;
4> }

executing command: SET NEWNAME

Starting restore at 13-JUL-16
Starting implicit crosscheck backup at 13-JUL-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=290 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 13-JUL-16

Starting implicit crosscheck copy at 13-JUL-16
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 13-JUL-16

searching for all files in the recovery area
cataloging files...
no files cataloged

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 +MMC
channel ORA_DISK_1: restoring datafile 00002 to +MMC
channel ORA_DISK_1: restoring datafile 00003 to +MMC
channel ORA_DISK_1: restoring datafile 00004 to +MMC
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area01/DBUPG/backupset/2012_07_13/o1_mf_nnndf_TAG20120713T151614_800shgw5_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area01/DBUPG/backupset/2012_07_13/o1_mf_nnndf_TAG20120713T151614_800shgw5_.bkp tag=TAG20120713T151614
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:46
Finished restore at 13-JUL-16

RMAN> recover database;

Starting recover at 13-JUL-16
using channel ORA_DISK_1

starting media recovery

media recovery complete, elapsed time: 00:00:01
Finished recover at 13-JUL-16


SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 13 15:39:31 2016

SQL>  alter database open resetlogs

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home