Nobody wants database server to crash, but if it happens most recent backup has to be restored on a newly replaced server. There are some requirements before the restoring operation. First, a server oracle software installed on it. Second, it makes restore operation easy that the same folder structure as the old server. Third, autobackup feature must be enabled at the old server. Last but not least, DBID of the old database.
$ rman target /
Recovery Manager: Release 10.2.0.5.0 – Production on Thu Feb 24 11:42:26 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora’
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2094736 bytes
Variable Size 67111280 bytes
Database Buffers 83886080 bytes
Redo Buffers 6291456 bytes
RMAN> SET DBID=3044472081;
executing command: SET DBID
RMAN> run
2> {
3> allocate channel t1 type 'SBT_TAPE' parms="ENV=(NB_ORA_CLIENT=tedtdb,NB_ORA_SERV=bckserver)";
4> restore spfile from autobackup;
release channel t1;
5> 6> }
using target database control file instead of recovery catalog
allocated channel: t1
channel t1: sid=36 devtype=SBT_TAPE
channel t1: Veritas NetBackup for Oracle – Release 7.0 (2010070800)
Starting restore at 24-FEB-11
channel t1: looking for autobackup on day: 20110224
channel t1: looking for autobackup on day: 20110223
channel t1: looking for autobackup on day: 20110222
channel t1: autobackup found: c-3044472081-20110222-05
channel t1: SPFILE restore from autobackup complete
Finished restore at 24-FEB-11
released channel: t1
RMAN> shutdown immediate;
Oracle instance shut down
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 3221225472 bytes
Fixed Size 2099752 bytes
Variable Size 1560282584 bytes
Database Buffers 1644167168 bytes
Redo Buffers 14675968 bytes
RMAN> run
2> {
3> allocate channel t2 type 'SBT_TAPE' parms="ENV=(NB_ORA_CLIENT=tedtdb,NB_ORA_SERV=bckserver)";
restore controlfile from autobackup;
release channel t2;
}4> 5> 6>
allocated channel: t2
channel t2: sid=321 devtype=SBT_TAPE
channel t2: Veritas NetBackup for Oracle – Release 7.0 (2010070800)
Starting restore at 24-FEB-11
channel t2: looking for autobackup on day: 20110224
channel t2: looking for autobackup on day: 20110223
channel t2: looking for autobackup on day: 20110222
channel t2: autobackup found: c-3044472081-20110222-05
channel t2: control file restore from autobackup complete
output filename=/database/oradata/orcl/control01.ctl
output filename=/database/oradata/orcl/control02.ctl
output filename=/database/oradata/orcl/control03.ctl
Finished restore at 24-FEB-11
released channel: t2
RMAN> alter database mount;
database mounted
RMAN> run
2> {
3> allocate channel t3 type 'SBT_TAPE' parms="ENV=(NB_ORA_CLIENT=tedtdb,NB_ORA_SERV=bckserver)";
4> restore database;
5> recover database;
6> release channel t3;
7> }
allocated channel: t3
channel t3: sid=321 devtype=SBT_TAPE
channel t3: Veritas NetBackup for Oracle – Release 7.0 (2010070800)
Starting restore at 24-FEB-11
channel t3: starting datafile backupset restore
channel t3: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /database/oradata/orcl/users01.dbf
restoring datafile 00005 to /database/oradata/orcl/test01.dbf
channel t3: reading from backup piece bk_329_1_743772421
channel t3: restored backup piece 1
piece handle=bk_329_1_743772421 tag=HOT_DB_BK_LEVEL0
channel t3: restore complete, elapsed time: 00:32:39
channel t3: starting datafile backupset restore
channel t3: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /database/oradata/orcl/system01.dbf
restoring datafile 00002 to /database/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /database/oradata/orcl/sysaux01.dbf
channel t3: reading from backup piece bk_330_1_743772421
channel t3: restored backup piece 1
piece handle=bk_330_1_743772421 tag=HOT_DB_BK_LEVEL0
channel t3: restore complete, elapsed time: 00:02:55
Finished restore at 24-FEB-11
Starting recover at 24-FEB-11
starting media recovery
channel t3: starting archive log restore to default destination
channel t3: restoring archive log
archive log thread=1 sequence=102
channel t3: reading from backup piece al_333_1_743772654
channel t3: restored backup piece 1
piece handle=al_333_1_743772654 tag=TAG20110222T113054
channel t3: restore complete, elapsed time: 00:00:37
channel t3: starting archive log restore to default destination
channel t3: restoring archive log
archive log thread=1 sequence=101
channel t3: reading from backup piece al_332_1_743772654
channel t3: restored backup piece 1
piece handle=al_332_1_743772654 tag=TAG20110222T113054
channel t3: restore complete, elapsed time: 00:00:36
archive log filename=/fra/_1_101_743451264.dbf thread=1 sequence=101
archive log filename=/fra/_1_102_743451264.dbf thread=1 sequence=102
unable to find archive log
archive log thread=1 sequence=103
released channel: t3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/24/2011 13:59:15
RMAN-06054: media recovery requesting unknown log: thread 1 seq 103 lowscn 40854103
RMAN> alter database open resetlogs;
database opened
Comments
Post a Comment