Search This Blog

Total Pageviews

Sunday 24 July 2011

RMAN restore database from SNAPSHOT CONTROLFILE

CONFIGURE SNAPSHOT CONTROLFILE NAME

================================================
in my case this is the location ...
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/app/oracle/product/11.2/dbs/snapcf_orcl.f'; # default

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

RMAN> connect target /

connected to target database (not started)

RMAN> startup force nomount pfile='/tmp/spfileorcl.ora';

Oracle instance started

Total System Global Area 839282688 bytes

Fixed Size 2217992 bytes
Variable Size 608176120 bytes
Database Buffers 213909504 bytes
Redo Buffers 14979072 bytes

RMAN> restore controlfile from '/opt/app/oracle/product/11.2/dbs/snapcf_orcl.f' ;

Starting restore at 24-JUL-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=/opt/app/oracle/oradata/orcl/control01.ctl
output file name=/opt/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 24-JUL-11




RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1



RMAN> exit


Recovery Manager complete.
oracle@apt-amd-02:/opt/app/oracle/oradata/orcl> !sql
sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Jul 24 05:27:12 2011

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select group#, first_change#, status, archived from v$log;

GROUP# FIRST_CHANGE# STATUS ARC
---------- ------------- ---------------- ---
4 12374116 CURRENT NO
6 0 UNUSED YES
5 0 UNUSED YES

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@apt-amd-02:/opt/app/oracle/oradata/orcl> rman

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Jul 24 05:28:15 2011

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

RMAN> connect target /

connected to target database: ORCL (DBID=1267852645, not open)

RMAN> restore database;

Starting restore at 24-JUL-11
Starting implicit crosscheck backup at 24-JUL-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Crosschecked 2 objects
Finished implicit crosscheck backup at 24-JUL-11

Starting implicit crosscheck copy at 24-JUL-11
using channel ORA_DISK_1
Finished implicit crosscheck copy at 24-JUL-11

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /opt/app/oracle/flash_recovery_area/ORCL/autobackup/2011_07_23/o1_mf_s_757265596_72otfxny_.bkp
File Name: /opt/app/oracle/flash_recovery_area/ORCL/autobackup/2011_07_23/o1_mf_n_757269308_72oy1z1v_.bkp
File Name: /opt/app/oracle/flash_recovery_area/ORCL/autobackup/2011_07_23/o1_mf_n_757280782_72p98jvx_.bkp
File Name: /opt/app/oracle/flash_recovery_area/ORCL/autobackup/2011_07_24/o1_mf_n_757315149_72qbthrt_.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 /opt/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /opt/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /opt/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /opt/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /opt/app/oracle/oradata/orcl/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /opt/app/oracle/oradata/orcl/anujtest.dbf
channel ORA_DISK_1: restoring datafile 00007 to /opt/app/oracle/oradata/orcl/tsapexf01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /opt/app/oracle/oradata/orcl/tsapexu01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /opt/app/oracle/oradata/orcl/test.dbf
channel ORA_DISK_1: restoring datafile 00010 to /opt/app/oracle/oradata/orcl/rman.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/RmanBackup/databasefiles_ORCL_0lmi5sv0_21_20110723
channel ORA_DISK_1: piece handle=/home/oracle/RmanBackup/databasefiles_ORCL_0lmi5sv0_21_20110723 tag=TAG20110723T152936
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:55
Finished restore at 24-JUL-11

RMAN> recover database;

Starting recover at 24-JUL-11
using channel ORA_DISK_1

starting media recovery

unable to find archived log
archived log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/24/2011 05:32:02
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 1 and starting SCN of 12374116

RMAN> alter database open resetlogs;

database opened

RMAN> exit


Recovery Manager complete.
oracle@apt-amd-02:/opt/app/oracle/oradata/orcl> !sql
sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Jul 24 05:35:09 2011

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select group#, first_change#, status, archived from v$log;

GROUP# FIRST_CHANGE# STATUS ARC
---------- ------------- ---------------- ---
4 12374117 CURRENT NO
5 0 UNUSED YES
6 0 UNUSED YES

SQL>

Oracle DBA

anuj blog Archive