Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset Database?

Status
Not open for further replies.

dbstudent

Programmer
Feb 14, 2006
26
0
0
US
After what kind of backup do you use RESET DATABASE command?
Thanks-
 
DBStudent,

The RESET DATABASE command is part of the RMAN (Oracle Recovery Manager) package. You use the comman to revert to a previous version of a database. Following is a sample scenario (from Oracle documentation) that illustrates the use of the command:
Code:
********************************************************************************
The following scenario makes an old incarnation of database trgt current again:

# step 1: obtain the primary key of old incarnation
LIST INCARNATION OF DATABASE trgt;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       2       TRGT     1334358386       NO  154381     OCT 30 2001 16:02:12
1       116     TRGT     1334358386       YES 154877     OCT 30 2001 16:37:39

# step 2: start instance and reset database to incarnation key 2
STARTUP FORCE NOMOUNT;
RESET DATABASE TO INCARNATION 2;

# step 3: restore control file from previous incarnation, then shut down instance 
# and mount control file
RESTORE CONTROLFILE;
STARTUP FORCE MOUNT;

# step 4: restore and recover the database to a point before the RESETLOGS
RESTORE DATABASE UNTIL SCN 154876;
RECOVER DATABASE UNTIL SCN 154876;

# step 5: make this incarnation the current incarnation and then list incarnations:
ALTER DATABASE OPEN RESETLOGS;
LIST INCARNATION OF DATABASE trgt;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       2       TRGT     1334358386       NO  154381     OCT 30 2001 16:02:12
1       116     TRGT     1334358386       NO  154877     OCT 30 2001 16:37:39
1       311     TRGT     1334358386       YES 154877     OCT 30 2001 17:17:03
Let us know if this illustration resolves your question.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top