Wednesday, November 17, 2010

RMAN Incomplete Recovery ( Controlfile & All Datafile Lost)

Hi,

I am going to post different RMAN recovery scenarios below is the first one.

RMAN Incomplete Recovery ( Controlfile & All Datafile Lost) :----

Suppose we have lost all the controlfiles and datafiles of a database then we have to do incomplete recovery. Below are steps performed to do incomplete recovery.

1) Startup Database in Nomount Mode. we have to startup in nomount Mode because we have lost the controlfile and we have to restore it in nomount mode.
[oracle@test orcl]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Nov 12 14:57:21 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> startup force nomount;
ORACLE instance started.
Total System Global Area 536870912 bytes
Fixed Size 1220408 bytes
Variable Size 176160968 bytes
Database Buffers 352321536 bytes
Redo Buffers 7168000 bytes
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

2) After putting database in nomount mode we have to connect to RMAN and start the recovery of controlfile from auto backup. ( if one knows the controlfile location then it can be restored from that location)

[oracle@test orcl]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Nov 12 14:58:27 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: orcl (not mounted)
RMAN> set dbid xx...xxxxxx ( set the dbid -- we can get it through old backups logs)
executing command: SET DBID
RMAN> run
2> {
3> allocate channel ch01 type sbt_tape; ( manually allocate channel as we dont have controlfie)
4> restore controlfile from autobackup;
5> release channel ch01;
6> }
using target database control file instead of recovery catalog
allocated channel: ch01
channel cho1: sid=120 devtype=SBT_TAPE
channel cho1: Symantec/BackupExec/1.1.0
Starting restore at 17-NOV-10
channel cho1: looking for autobackup on day: 20101117
starting up daemon
channel cho1: looking for autobackup on day: 20101116
………………………………………………………………………………
channel cho1: autobackup found: c-1345678888-20101116-02
starting up daemon
channel tape1: control file restore from autobackup complete
output filename=/u01/oradata/orcl/control01.ctl
output filename=/u01/oradata/orcl/control02.ctl
output filename=/u01/oradata/orcl/control03.ctl
Finished restore at 16-NOV-10
released channel: cho1

3) After restoring controlfile mount the database and recover database.

RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 16-NOV-10
allocated channel: cho1
channel cho1: sid=120 devtype=SBT_TAPE
channel cho1: Symantec/BackupExec/1.1.0
allocated channel: cho1
channel cho1: sid=120 devtype=DISK
starting up daemon
starting up daemon
channel cho1: starting datafile backupset restore
channel cho1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oradata/orcl/system01.dbf
restoring datafile 00002 to /u01/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /u01/oradata/orcl/sysaux01.dbf
restoring datafile 00004 to /u01/oradata/orcl/users01.dbf
restoring datafile 00005 to /u01/oradata/orcl/example01.dbf
restoring datafile 00006 to /u01/oradata/orcl/ops_data1.dbf
channel cho1 : reading from backup piece ppcvvvvv_1_1
starting up daemon
channel cho1: restored backup piece 1
piece handle=ppcvvvvv_1_1 tag=TAG20101111343434
channel cho1: restore complete, elapsed time: 00:10:06
Finished restore at 16-NOV-10
RMAN> recover database;
Starting recover at 16-NOV-10
using channel cho1
using channel cho1
starting media recovery
starting up daemon
channel cho1: starting archive log restore to default destination
channel cho1: restoring archive log
archive log thread=1 sequence=35
channel cho1: restoring archive log
archive log thread=1 sequence=36
channel cho1: reading from backup piece 0ccgggoo9o_1_1
starting up daemon
channel cho1: restored backup piece 1
piece handle=0ccgggoo9o_1_1 tag=TAG20101111
channel cho1: restore complete, elapsed time: 00:00:02
archive log filename=/u03/arch/1_00_73048.dbf thread=1 sequence=35
archive log filename=/u03/arch/1_00_73048.dbf thread=1 sequence=36
archive log filename=/u03/arch/1_00_73448.dbf thread=1 sequence=37
archive log filename=/u03/arch/1_00_73448.dbf thread=1 sequence=38
archive log filename=/u03/arch/1_00_73448.dbf thread=1 sequence=39
archive log filename=/u03/arch/1_00_73448.dbf thread=1 sequence=40

media recovery complete, elapsed time: 00:00:15
Finished recover at 16-NOV-10

RMAN> sql 'alter database open resetlogs';
sql statement: alter database open resetlogs
RMAN> exit
Recovery Manager complete.

After Opening database in resetlogs mode will create new incarnation.

1 comment:

  1. Hotel Casino & RV Resort in Ridgefield, OR - Mapyro
    The property is 615 square feet (3.9 m2) with a view of the town. It is located 전주 출장샵 just outside 창원 출장샵 the town of Tunica 양주 출장안마 on the Ohio River. 창원 출장마사지 The casino 사천 출장샵

    ReplyDelete