Monday, December 8, 2014

RMAN point in time Restore & Recovery.

1. STARTUP NOMOUNT PFILE='D:\app\oradata\DBRMAN_BACKUP\dbrman_pfile.ora';

2. RESTORE CONTROLFILE FROM 'D:\app\oradata\DBRMAN_BACKUP\BKP_DFDBRMAN_865846921_113_1_3HPPNHK9';

3. ALTER DATABASE MOUNT;

4. RUN
{
  ALLOCATE CHANNEL DISK1 TYPE DISK;
  SET UNTIL TIME "to_date('2014-12-09:09:02:00', 'yyyy-mm-dd:hh24:mi:ss')";
  RESTORE DATABASE;
  RECOVER DATABASE;
};

C:\Users\rajib.pradhan>SET ORACLE_SID=DBRMAN
C:\Users\rajib.pradhan>RMAN TARGET/
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Dec 9 09:03:41 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: DBRMAN (DBID=3796675194)
RMAN> SHUTDOWN IMMEDIATE;
using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down
RMAN> STARTUP NOMOUNT PFILE='D:\app\oradata\DBRMAN_BACKUP\dbrman_pfile.ora';
connected to target database (not started)
Oracle instance started
Total System Global Area     535662592 bytes
Fixed Size                     1375792 bytes
Variable Size                377487824 bytes
Database Buffers             150994944 bytes
Redo Buffers                   5804032 bytes
RMAN> RESTORE CONTROLFILE FROM 'D:\app\oradata\DBRMAN_BACKUP\BKP_DFDBRMAN_865846921_113_1_3HPPNHK9';
Starting restore at 09-DEC-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=D:\APP\ORADATA\DBRMAN\CONTROL01.CTL
Finished restore at 09-DEC-14
RMAN> ALTER DATABASE MOUNT;
database mounted
released channel: ORA_DISK_1
RMAN> RUN
2> {
3>   ALLOCATE CHANNEL DISK1 TYPE DISK;
4>   SET UNTIL TIME "to_date('2014-12-09:09:02:00', 'yyyy-mm-dd:hh24:mi:ss')";
5>   RESTORE DATABASE;
6>   RECOVER DATABASE;
7> };

allocated channel: DISK1
channel DISK1: SID=63 device type=DISK
executing command: SET until clause
Starting restore at 09-DEC-14
Starting implicit crosscheck backup at 09-DEC-14
Crosschecked 24 objects
Finished implicit crosscheck backup at 09-DEC-14
Starting implicit crosscheck copy at 09-DEC-14
Finished implicit crosscheck copy at 09-DEC-14
searching for all files in the recovery area
cataloging files...
no files cataloged

channel DISK1: starting datafile backup set restore
channel DISK1: specifying datafile(s) to restore from backup set
channel DISK1: restoring datafile 00001 to D:\APP\ORADATA\DBRMAN\SYSTEM01.DBF
channel DISK1: restoring datafile 00002 to D:\APP\ORADATA\DBRMAN\SYSAUX01.DBF
channel DISK1: restoring datafile 00003 to D:\APP\ORADATA\DBRMAN\UNDOTBS01.DBF
channel DISK1: restoring datafile 00004 to D:\APP\ORADATA\DBRMAN\USERS01.DBF
channel DISK1: restoring datafile 00005 to D:\APP\ORADATA\DBRMAN\CATALOG_SPC01.DBF
channel DISK1: restoring datafile 00006 to D:\APP\ORADATA\DBRMAN\TBS_RAMN_CAT_01.DBF
channel DISK1: restoring datafile 00007 to D:\APP\ORADATA\DBRMAN\UNDOTBS02.DBF
channel DISK1: restoring datafile 00010 to D:\APP\ORADATA\DBRMAN\EXAMPLE01.DBF
channel DISK1: reading from backup piece D:\APP\ORADATA\DBRMAN_BACKUP\BKP_DFDBRMAN_865846474_112_1_3GPPNH6A
channel DISK1: piece handle=D:\APP\ORADATA\DBRMAN_BACKUP\BKP_DFDBRMAN_865846474_112_1_3GPPNH6A tag=TAG20141209T085434
channel DISK1: restored backup piece 1
channel DISK1: restore complete, elapsed time: 00:01:55
Finished restore at 09-DEC-14
Starting recover at 09-DEC-14
starting media recovery
archived log for thread 1 with sequence 218 is already on disk as file D:\APP\ORADATA\DBRMAN\REDO02.LOG
archived log file name=D:\APP\ORADATA\DBRMAN\REDO02.LOG thread=1 sequence=218
media recovery complete, elapsed time: 00:00:02
Finished recover at 09-DEC-14
released channel: DISK1
RMAN> ALTER DATABASE OPEN RESETLOGS;
database opened
RMAN>

No comments:

Post a Comment