Look in:

Web oracle-core-dba.blogspot.com

Wednesday, December 24, 2008

Simple Restore and Recovery process using RMAN on a Windows box.

C:\>set oracle_sid=SDR

C:\>sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 - Production on Wed Dec 17 05:16:07 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn sys/sys as sysdba
Connected to an idle instance
SQL> startup pfile=c:\oracle\database\initSDR.ora nomount
ORACLE instance started.

Total System Global Area 202448548 bytes
Fixed Size 454308 bytes
Variable Size 159383552 bytes
Database Buffers 41943040 bytes
Redo Buffers 667648 bytes
SQL>


C:\oracle\bin>rman

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

RMAN> connect target sys/sys

connected to target database: SDR (not mounted)

RMAN>


RUN
{
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\Backup\RMAN\SDR\%F';
RESTORE CONTROLFILE FROM 'D:\Backup\RMAN\SDR\C-3180286864-20081215-00';
ALTER DATABASE MOUNT;
}


RMAN> RUN
2> {
3> SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\Backup\RMAN\SDR\%F';
4> RESTORE CONTROLFILE FROM 'D:\Backup\RMAN\SDR\C-3180286864-20081215-00';
5> ALTER DATABASE MOUNT;
6> }

executing command: SET CONTROLFILE AUTOBACKUP FORMAT
using target database controlfile instead of recovery catalog

Starting restore at 17-DEC-08

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=D:\ORACLE\ORADATA\SDR\CONTROL01.CTL
output filename=D:\ORACLE\ORADATA\SDR\CONTROL02.CTL
output filename=C:\ORACLE\ORADATA\SDR\CONTROL03.CTL
Finished restore at 17-DEC-08

database mounted


RMAN> restore archivelog from time '14-DEC-08';

Starting restore at 17-DEC-08

using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=209
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\BACKUP\RMAN\SDR\92K28SQ3_1_1 tag=ORACLESRVR - SDR_12140803
0002 params=NULL
channel ORA_DISK_1: restore complete
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=210
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\BACKUP\RMAN\SDR\95K2BH5F_1_1 tag=ORACLESRVR - SDR_12150803
0005 params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 17-DEC-08

RMAN> restore database;

Starting restore at 17-DEC-08

using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\SDR\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\SDR\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\SDR\CWMLITE01.DBF
restoring datafile 00004 to D:\ORACLE\ORADATA\SDR\DRSYS01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\SDR\EXAMPLE01.DBF
restoring datafile 00006 to D:\ORACLE\ORADATA\SDR\INDX01.DBF
restoring datafile 00007 to D:\ORACLE\ORADATA\SDR\ODM01.DBF
restoring datafile 00008 to D:\ORACLE\ORADATA\SDR\TOOLS01.DBF
restoring datafile 00009 to D:\ORACLE\ORADATA\SDR\USERS01.DBF
restoring datafile 00010 to D:\ORACLE\ORADATA\SDR\XDB01.DBF
restoring datafile 00011 to D:\ORACLE\ORADATA\SDR\SDRD.ORA
restoring datafile 00012 to D:\ORACLE\ORADATA\SDR\SDRI.ORA
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\BACKUP\RMAN\SDR\94K2BGV8_1_1 tag=ORACLESRVR - SDR_12150803
0005 params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 17-DEC-08

RMAN> recover database until logseq 0 thread 1;

Starting recover at 17-DEC-08
using channel ORA_DISK_1

starting media recovery
media recovery complete

Finished recover at 17-DEC-08


RMAN> open resetlogs database;

database opened

RMAN>exit

2 comments:

Amelia said...

I have read somewhere that recovery using RMAN is not efficient as we do it the other way. This utility doesn't recover all the data. Is this point true about this recovery technique ? Please share some information so as to remove my confusion and I can use this process to recover my database.
sap upgrade tool

Amelia said...

I have read somewhere that recovery using RMAN is not efficient as we do it the other way. This utility doesn't recover all the data. Is this point true about this recovery technique ? Please share some information so as to remove my confusion and I can use this process to recover my database.
sap upgrade tool