Create The World With Creativity
 
Welcome, Guest:Log in | Register | Information Center | Languages | Search | Tags | FAQs | Lite
There was a problem with the request. Check your permission or contact with administrator.




Your Ad Here

Grade this thread

Quote Favorites Report
Starter:  Topic: : Recover Database from a total failure
myDBA 
4 Stars
 

Info: Moderator Offline Male
From: Not Specified 
Posts: 223  
Digest 1  
Credits: 40
Money: 1168 $OraclePoint
Registered on 2007-04-12
ProfileProfile BuddyBuddy PMPM Send EmailEmail Reply Reply QuotesQuotes   1 F 
Recover Database from a total failure



Keywords: RMAN, Catalog,
[url=http://www.oraclepoint.com]NdrwXwowdOraclePointGEzGEaiGL[/url]


Summary: The purpose of this article is to describe how to recover a database from a total failure using RMAN 8i. This article is meant to assist you in performing an incomplete recovery after losing all datafiles, online redo logs, and controlfiles. This is a scenario of RMAN backup with catalog (not controlfile). Therefore, we can do incomplete recovery.
[url=http://www.oraclepoint.com]3Smsq6DJqOraclePointmgPtutagG[/url]

You need Oracle Services for the database and an init.ora file.Additionally, if you have archive logs that have not been cataloged,you will be able to use them as part of the recovery.

1.RESTORE CONTROLFILE
[url=http://www.oraclepoint.com]NL4qR9gYCOraclePoint87IJybvhI[/url]


set ORACLE_SID=PROD
svrmgr> connect internal
[url=http://www.oraclepoint.com]rkRYNyn8iOraclePointXYFdlQWSi[/url]

svrmgr> startup nomount pfile=<init.ora>
svrmgr> Exit
[url=http://www.oraclepoint.com]Uy7Xv4g5rOraclePoint9qPGX1XwD[/url]

set ORACLE_SID=PROD
RMAN TARGET INTERNAL/password CATALOG  rman/rman@rcat
[url=http://www.oraclepoint.com]MZAvwZ1QAOraclePointHnTq9HmV4[/url]

RMAN>  run {
    allocate channel c1 type disk;
    restore controlfile;
[url=http://www.oraclepoint.com]g3yN1ed73OraclePointTUoWgEXS2[/url]

    alter database mount;
    release channel c1;
   }
[url=http://www.oraclepoint.com]wJHxQuG8tOraclePointOkFHG86Uy[/url]


2.QUERY TARGET AND CATALOG DATABASE

[url=http://www.oraclepoint.com]axvSGF7cmOraclePointA153nE0aU[/url]

Connect to the catalog database and issue the following:

set ORACLE_SID=RCAT
[url=http://www.oraclepoint.com]uhRev3j49OraclePointhzSVPFHhL[/url]

svrmgr> connect rman/rman
svrmgr>
select sequence#, thread#, low_scn, next_scn from rlh;
[url=http://www.oraclepoint.com]MeozfeuXHOraclePointyXiJHFbm2[/url]


  SEQUENCE#    THREAD#    LOW_SCN   NEXT_SCN
----------                 ----------     ----------         ----------
[url=http://www.oraclepoint.com]TLuRsjkEzOraclePointpLW1Y2eOW[/url]

       188                      1               37278
       189                      1               37891
       190                      1               38231
[url=http://www.oraclepoint.com]00uGyHo8POraclePointuZ2ltCWBv[/url]

       191                      1               38319
       192                      1               38389
       193                      1               38468
[url=http://www.oraclepoint.com]6lzvQBHHaOraclePoint0loVknGrb[/url]

       194                      1               38562
       195                      1               38649
       196                      1               38708
[url=http://www.oraclepoint.com]NVZcGzTriOraclePointWDjH0K8ub[/url]

       197                      1               38844

Note the last SCN is 197.  This is the last System Change Number that the RMAN catalog is aware of.
[url=http://www.oraclepoint.com]93iZ2KDNuOraclePointrTbJhxj04[/url]


Now connect to the target database:
[url=http://www.oraclepoint.com]YTl8pphxoOraclePointsuZJtRrIJ[/url]

set ORACLE_SID=PROD
svrmgr> connect internal
svrmgr> select * from v$log_history
[url=http://www.oraclepoint.com]3MXm5rEEOOraclePoint3oOwChXAN[/url]


     RECID      STAMP            THREAD#  SEQUENCE#   FIRST_CHANGE#    FIRST_TIM   NEXT_CHANGE#
----------         ----------          ----------      ---------- -              ------------             ---------     ------------
[url=http://www.oraclepoint.com]ChBrPwGYgOraclePointXGoh925lw[/url]

       188           410011317          1                    188            & 37278
       189           410011323          1                    189            & 37891
       190           410011328          1                    190            & 38231
[url=http://www.oraclepoint.com]lq21ifEViOraclePointmtizvF2dV[/url]

       191           410011332          1                    191            & 38319
       192           410011338          1                    192            & 38389
       193           410011341          1                    193            & 38468
[url=http://www.oraclepoint.com]njtJ81yfzOraclePointqZacBHT2q[/url]

       194           410011345          1                    194            & 38562
       195           410011349          1                    195            & 38649
       196           410011352          1                    196            & 38708
[url=http://www.oraclepoint.com]z6BXhu6XgOraclePointBO0W3jGBg[/url]

       197           410011551          1                    197            & 38844

Since the database has been mounted using a backup control file, thelast Log Sequence Number that the control file is aware of is 197. Thishappens to match the last LSN known by the catalog because a resync hasnot been performed since the last backup. But if you look in thearchive dump destination, you may see additional archive logs that havenot been cataloged. You need to catalog these files so that RMAN canuse them during the recovery.
[url=http://www.oraclepoint.com]71BwgbN0cOraclePointUTUAIQBfx[/url]


Directory of D:\ORACLE\oradata\PROD\archive
[url=http://www.oraclepoint.com]wbLScaRyTOraclePoint15UX2LZnr[/url]

0/03/00  11:46a        <DIR>          .
0/03/00  11:46a        <DIR>          ..
0/03/00  12:09p                 11,264  PRODT001S00198.ARC
[url=http://www.oraclepoint.com]22rTLAoMIOraclePoint5OosAF5Sh[/url]

0/03/00  12:09p                 11,264  PRODT001S00199.ARC
0/03/00  12:09p                 1,024    PRODT001S00200.ARC
0/03/00  12:09p                 1,024    PRODT001S00201.ARC
[url=http://www.oraclepoint.com]UkWnbR9yIOraclePointJOw2FoiZz[/url]


3. MANUALLY CATALOG ANY INTERMEDIATE ARCHIVED LOGS

[url=http://www.oraclepoint.com]iDCr9QVqQOraclePointbki96IVik[/url]

Archive logs 198 through 201 are available but have not been recorded in the catalog.
Perform the following for each available archive log:
[url=http://www.oraclepoint.com]mhYvrniitOraclePointMHICpMEXK[/url]

set ORACLE_SID=PROD
RMAN TARGET INTERNAL/password CATALOG  rman/rman@rcat
RMAN> catalog archivelog 'd:\oracle\oradata\prod\archive\PRODT001S00198.ARC';
[url=http://www.oraclepoint.com]Ut2kKbJJXOraclePointSe73HdR3L[/url]


4. RESTORE AND RECOVER DATABASE
[url=http://www.oraclepoint.com]6aton1wpgOraclePoint0t5JEnBox[/url]

The last archive log available has a log sequence number of 201, so youcan perform an incomplete recovery using logs up to and includingPRODT001S00201.ARC.

RMAN> run {
[url=http://www.oraclepoint.com]cy7zGbv0iOraclePointPQaaM2K1e[/url]

    allocate channel c1 type disk;
    set until logseq 201 thread 1;
    restore database;
[url=http://www.oraclepoint.com]BmKim4cv8OraclePointFxm3PayFh[/url]

    recover database;
    release channel c1;
    sql "alter database open resetlogs";
[url=http://www.oraclepoint.com]P2hyHyOhAOraclePointGs1ltcvRF[/url]

}

5. RESET THE DATABASE
[url=http://www.oraclepoint.com]pt1mynPq4OraclePointqf0Nv2uj9[/url]


Before you can use RMAN again with a target database that has beenopened with the RESETLOGS option, you must notify RMAN that you havereset the database incarnation.  The reset database command directsRMAN to create a new database incarnation record in the recoverycatalog.
[url=http://www.oraclepoint.com]iygi6OYg8OraclePoint2RO779xjw[/url]

RMAN> reset database;
RMAN> List Incarnation of database;
[url=http://www.oraclepoint.com]bydVe0VsvOraclePointMcVKBKrkF[/url]

List of Database Incarnations
DB Key  Inc Key       DB Name      DB ID              CUR         Reset SCN          Reset Time
-------      -------         --------        ----------------     ----          ------------          ------------
[url=http://www.oraclepoint.com]60l414Hx1OraclePointGlZ4DOWYt[/url]

1               2               PROD         4116816026       NO              1                     03-OCT-00
1               429           PROD         4116816026       YES            38872             03-OCT-00
[url=http://www.oraclepoint.com]WubI75dH7OraclePointnygttfVmW[/url]

6. BACKUP DATABASE


Immediately backup the database. Because the database is a newincarnation, the pre-RESETLOG backups are not usable. Prior to runningthe backup, remove the old archive log file from the archive dumpdestination.
[url=http://www.oraclepoint.com]OuKF2veuzOraclePointtHOcd94l5[/url]


RMAN> run {
    shutdown immediate;
[url=http://www.oraclepoint.com]yFCut1QckOraclePointwxNIC9SHz[/url]

    startup mount pfile=<init.ora>;
    allocate channel c1 type disk format 'e:\oracle\oradata\backup\df_%d_%p_%c_%s';
    backup database;
[url=http://www.oraclepoint.com]Emk4WrHyLOraclePointGsxAg3DQm[/url]

    release channel c1;
    allocate channel c1 type disk format 'e:\oracle\oradata\backup\archive\al_%d_%s_%c';
    backup (archivelog all delete input);
[url=http://www.oraclepoint.com]5hFeT3sb6OraclePointruDhyqHsC[/url]

    sql 'alter database open';
    release channel c1;
    }
[url=http://www.oraclepoint.com]z11A7ix8FOraclePointqAWS54XZN[/url]


Note: This article is original published at itpub.net.


[url=http://www.oraclepoint.com]QIpMzZPXOOraclePoint6f88UxyUt[/url]

[Lasted edited on 2008-07-31 11:11 myDBA ]


Tags: case recover 

2008-07-31 10:09
  Grade this thread



Similar Threads Forum Author Replies Views Last Post
My Practical Approach to Create Domain Index
Oracle Case Study R.Wang 0 438  2010-05-13 15:45
My Practical Approach to Create Domain Index
Oracle Database Administration R.Wang 0 231  2010-05-13 15:44
Duplicating Oracle Database with RMAN on Remote Server
Oracle Case Study R.Wang 0 343  2010-05-10 00:00
How to Change Character Set to UTF8 for Oracle Database?
Oracle Case Study R.Wang 0 386  2010-05-09 23:53
Oracle 11g Backup and Recovery Concepts
Oracle Database 11G R.Wang 1 1458  2009-11-21 01:39

  Quick Response
Title:
Content:




Upload: Disable
Username:
Password:
  



Recommend to a friend Print Article Mode





 


Powered by BMForum Powered by BMForum 2007 5.6 RSS Feed  
Processed in 0.09889507 second(s),8 queries  
Top