Monday, June 9, 2014

Flashback database to before resetlogs

1.After opening the database with resetlogs, If there is need to revert back the database before resetlogs.Bounce the database in mount mode.
[oracle@ol6-112-rac1 trace]$ rman target="/"

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jun 9 13:50:36 2014

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

connected to target database: CVRMAN (DBID=659771233)

RMAN> list incarnation of database;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       CVRMAN   659771233        PARENT  1          17-SEP-11
2       2       CVRMAN   659771233        PARENT  995548     06-JUN-14
3       3       CVRMAN   659771233        PARENT  1158202    08-JUN-14
4       4       CVRMAN   659771233        ORPHAN  1158656    08-JUN-14
5       5       CVRMAN   659771233        PARENT  1158656    08-JUN-14
6       6       CVRMAN   659771233        PARENT  1161659    09-JUN-14
7       7       CVRMAN   659771233        CURRENT 1164623    09-JUN-14

RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> startup mount ;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     275578880 bytes

Fixed Size                     2227584 bytes
Variable Size                180355712 bytes
Database Buffers              88080384 bytes
Redo Buffers                   4915200 bytes


2.Flashback the database to before resetlogs
RMAN> flashback database to before resetlogs;

Starting flashback at 09-JUN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK


starting media recovery
media recovery complete, elapsed time: 00:00:15

Finished flashback at 09-JUN-14

3.Open the database with resetlogs
RMAN>
RMAN> sql "alter database open resetlogs";

sql statement: alter database open resetlogs

RMAN> list incarnation of database;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       CVRMAN   659771233        PARENT  1          17-SEP-11
2       2       CVRMAN   659771233        PARENT  995548     06-JUN-14
3       3       CVRMAN   659771233        PARENT  1158202    08-JUN-14
4       4       CVRMAN   659771233        ORPHAN  1158656    08-JUN-14
5       5       CVRMAN   659771233        PARENT  1158656    08-JUN-14
6       6       CVRMAN   659771233        PARENT  1161659    09-JUN-14
7       7       CVRMAN   659771233        ORPHAN  1164623    09-JUN-14
8       8       CVRMAN   659771233        CURRENT 1164623    09-JUN-14


No comments: