Sunday, 21 June 2015

RMAN full backup restore


Restore from Full Database Backup

 

1.      We need full database backup from rman and we need to have this rman logs also.

[oracle@localhost cold_backup]$ rman target /

 

Recovery Manager: Release 11.2.0.1.0 - Production on Sat May 23 15:09:21 2015

 

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: TEST (DBID=2178615226)

 

RMAN> backup database plus archivelog;

 

Starting backup at 23-MAY-15

current log archived

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=30 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=2 RECID=1 STAMP=880470585

channel ORA_DISK_1: starting piece 1 at 23-MAY-15

channel ORA_DISK_1: finished piece 1 at 23-MAY-15

piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2015_05_23/o1_mf_annnn_TAG20150523T150948_bp0lq739_.bkp tag=TAG20150523T150948 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16

Finished backup at 23-MAY-15

 

Starting backup at 23-MAY-15

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=/u01/app/oracle/oradata/test/system01.dbf

input datafile file number=00002 name=/u01/app/oracle/oradata/test/sysaux01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/test/undotbs01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf

channel ORA_DISK_1: starting piece 1 at 23-MAY-15

channel ORA_DISK_1: finished piece 1 at 23-MAY-15

piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2015_05_23/o1_mf_nnndf_TAG20150523T151008_bp0lqvkc_.bkp tag=TAG20150523T151008 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:01:46

Finished backup at 23-MAY-15

 

Starting backup at 23-MAY-15

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=3 RECID=2 STAMP=880470717

channel ORA_DISK_1: starting piece 1 at 23-MAY-15

channel ORA_DISK_1: finished piece 1 at 23-MAY-15

piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2015_05_23/o1_mf_annnn_TAG20150523T151158_bp0lv7y4_.bkp tag=TAG20150523T151158 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 23-MAY-15

 

Starting Control File and SPFILE Autobackup at 23-MAY-15

piece handle=/u01/app/oracle/flash_recovery_area/TEST/autobackup/2015_05_23/o1_mf_s_880470721_bp0lvc70_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 23-MAY-15

Restore & Recovery:

1.      Startup the database in nomount mode.

SQL> startup nomount

ORACLE instance started.

 

Total System Global Area  622149632 bytes

Fixed Size                  2215904 bytes

Variable Size             381681696 bytes

Database Buffers          234881024 bytes

Redo Buffers                3371008 bytes

2.      Then connect to the rman and then set the DBID

[oracle@localhost test]$ rman target /

 

Recovery Manager: Release 11.2.0.1.0 - Production on Sat May 23 15:16:15 2015

 

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: TEST (not mounted)

 

RMAN> set DBID=2178615226

 

executing command: SET DBID

3.      Then restore the control file from auto backup.

RMAN> restore controlfile from autobackup;

 

Starting restore at 23-MAY-15

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=20 device type=DISK

 

recovery area destination: /u01/app/oracle/flash_recovery_area

database name (or database unique name) used for search: TEST

channel ORA_DISK_1: AUTOBACKUP /u01/app/oracle/flash_recovery_area/TEST/autobackup/2015_05_23/o1_mf_s_880470721_bp0lvc70_.bkp found in the recovery area

channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150523

channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/flash_recovery_area/TEST/autobackup/2015_05_23/o1_mf_s_880470721_bp0lvc70_.bkp

channel ORA_DISK_1: control file restore from AUTOBACKUP complete

output file name=/u01/app/oracle/oradata/test/control01.ctl

output file name=/u01/app/oracle/flash_recovery_area/test/control02.ctl

Finished restore at 23-MAY-15

 

4.      Restore the database from the rman full backup.

RMAN> alter database mount;

 

database mounted

released channel: ORA_DISK_1

 

RMAN> restore database;

 

Starting restore at 23-MAY-15

Starting implicit crosscheck backup at 23-MAY-15

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=20 device type=DISK

Crosschecked 3 objects

Finished implicit crosscheck backup at 23-MAY-15

 

Starting implicit crosscheck copy at 23-MAY-15

using channel ORA_DISK_1

Finished implicit crosscheck copy at 23-MAY-15

 

searching for all files in the recovery area

cataloging files...

cataloging done

 

List of Cataloged Files

=======================

File Name: /u01/app/oracle/flash_recovery_area/TEST/autobackup/2015_05_23/o1_mf_s_880470721_bp0lvc70_.bkp

 

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/test/system01.dbf

channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/test/sysaux01.dbf

channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/test/undotbs01.dbf

channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/test/users01.dbf

channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/TEST/backupset/2015_05_23/o1_mf_nnndf_TAG20150523T151008_bp0lqvkc_.bkp

channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2015_05_23/o1_mf_nnndf_TAG20150523T151008_bp0lqvkc_.bkp tag=TAG20150523T151008

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:01:35

Finished restore at 23-MAY-15

5.      Recover the database.

RMAN> recover database;

 

Starting recover at 23-MAY-15

using channel ORA_DISK_1

 

starting media recovery

 

archived log for thread 1 with sequence 3 is already on disk as file /u01/app/oracle/flash_recovery_area/TEST/archivelog/2015_05_23/o1_mf_1_3_bp0lv5g7_.arc

archived log file name=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2015_05_23/o1_mf_1_3_bp0lv5g7_.arc thread=1 sequence=3

unable to find archived log

archived log thread=1 sequence=4

Finished recovery at 23-MAY-15

 

6.      Then open the database with resetlogs.

RMAN> alter database open resetlogs;

 

database opened

No comments:

Post a Comment