Complete loss of database data, restore the database process

Source: Internet
Author: User
Tags key log query reset variable thread backup
Process | recovery | data | database

Recovery test, simulated database hard disk damage data loss.
1, Database Full backup,
2, backup data files, control files, SPFile, password files
3, delete the database (with DBCA delete), leaving only the Oracle program.

4, start the database instance

HB130000 Oracle$rman target/catalog rman/rman@omsora9

Recovery manager:release 9.2.0.1.0-64bit Production

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

Connected to target database (not started)
Connected to Recovery Catalog database

Rman> Startup Nomount

Startup failed:ora-01078:failure in processing system parameters
Lrm-00109:could not open parameter file '/oracle/oracle/app/oracle/product/9.2.
0.1/dbs/inithb130000.ora '

Trying to start the Oracle instance without parameter files ...
Oracle instance started

Total System Global area 156729832 bytes

Fixed Size 741864 bytes
Variable Size 104857600 bytes
Database buffers 50331648 bytes
Redo buffers 798720 bytes


5, query the original database dbid, restore SPFile
Rman> List incarnation Query the dbid of the original database.


List of Database incarnations
DB Key Inc key DB Name db ID CUR reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
15936 131731 HB130000 2380174037 YES 23440815 25-aug-05

Rman> set dbid=2380174037; Set dbid.

Executing Command:set DBID
rman> restore SPFile;

Starting restore at 13-sep-05

Using channel Ora_disk_1
Using channel Ora_disk_2
Using channel Ora_disk_3
Using channel Ora_disk_4
Channel ora_disk_1:starting datafile backupset restore
Channel Ora_disk_1:restoring SPFILE
Output Filename=/oracle/oracle/app/oracle/product/9.2.0.1/dbs/spfilehb130000.ora
Channel ora_disk_1:restored backup Piece 1
Piece Handle=/oradata/rmanbackup/hb130000_ctl_c-2380174037-20050913-00.bak Tag=n
Ull params=null
Channel Ora_disk_1:restore Complete
Finished restore at 13-sep-05

6. Close the database and use the SPFile file to start

rman> shutdown Immediate

Oracle instance shut down

rman> startup Nomount;

Connected to target database (not started)
Oracle instance started

Total System Global area 303530016 bytes

Fixed Size 741408 bytes
Variable Size 268435456 bytes
Database buffers 33554432 bytes
Redo buffers 798720 bytes

7. Recovery Control File

rman> restore Controlfile;

Starting restore at 13-sep-05

Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=13 devtype=disk
Allocated Channel:ora_disk_2
Channel ora_disk_2:sid=14 Devtype=disk
Allocated channel:ora_disk_3
Channel ora_disk_3:sid=15 Devtype=disk
Allocated Channel:ora_disk_4
Channel ora_disk_4:sid=16 devtype=disk
Channel ora_disk_1:starting datafile Backupset restore
Channel ora_disk_1:restoring controlfile
Output filename=/oracle/oracle/app/oracle/product /9.2.0.1/dbs/hb130000/control01
. CTL
Channel ora_disk_1:restored backup piece 1
piece handle=/oradata/ Rmanbackup/hb130000_ctl_c-2380174037-20050913-00.bak tag=n
ull params=null
Channel Ora_disk_1:restore Complete
Replicating controlfile
Input filename=/oracle/oracle/app/oracle/product/9.2.0.1/dbs/hb130000/ Control01.
CTL
Output filename=/oracle/oracle/app/oracle/product/9.2.0.1/dbs/hb130000/control02
. CTL
Output Filename=/oradata/hb130000/control03.ctl
finished restore at 13-sep-05


8. Database mount

Rman> ALTER DATABASE Mount;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR message STACK follows ===============
RMAN-00571: ===========================================================
Rman-03002:failure of Alter DB command at 09/13/2005 14:13:42
Ora-01990:error opening password file '/oracle/oracle/app/oracle/product/9.2.0.
1/DBS/ORAPW '
Ora-27037:unable to obtain file status
IBM AIX RISC system/6000 error:2: No such file or directory
Additional Information:3
Rman> ALTER DATABASE Mount;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR message STACK follows ===============
RMAN-00571: ===========================================================
Rman-03002:failure of Alter DB command at 09/13/2005 14:17:18
Ora-01100:database already mounted

9, database recovery.

rman> Restore Database;

Starting restore at 13-sep-05

Using channel Ora_disk_1
Using channel Ora_disk_2
Using channel Ora_disk_3
Using channel Ora_disk_4
Channel ora_disk_1:starting datafile backupset restore
Channel ora_disk_1:specifying DataFile (s) to restore from backup set
restoring DataFile 00006 to/oradata/hb130000/indx01.dbf
restoring DataFile 00008 to/oradata/hb130000/tools01.dbf
restoring datafile 00013 to/oradata/hb130000/ca.dbf
restoring DataFile 00015 to/oradata/hb130000/foglight.dbf
restoring DataFile 00017 to/oradata/hb130000/gdss.dbf
Channel ora_disk_2:starting datafile backupset restore
Channel ora_disk_2:specifying DataFile (s) to restore from backup set
restoring DataFile 00002 to/oradata/hb130000/undotbs01.dbf
restoring datafile 00004 to/oradata/hb130000/drsys01.dbf
restoring DataFile 00007 to/oradata/hb130000/odm01.dbf
restoring DataFile 00014 to/oradata/hb130000/quest.dbf
restoring DataFile 00021 to/oradata/hb130000/oem_repository.dbf
Channel ora_disk_3:starting datafile backupset restore
Channel ora_disk_3:specifying DataFile (s) to restore from backup set
restoring DataFile 00003 to/oradata/hb130000/cwmlite01.dbf
restoring DataFile 00005 to/oradata/hb130000/example01.dbf
restoring DataFile 00010 to/oradata/hb130000/xdb01.dbf
restoring DataFile 00016 to/oradata/hb130000/gwd.dbf
restoring DataFile 00020 to/oradata/hb130000/catalog_rman.dbf
Channel ora_disk_4:starting datafile backupset restore
Channel ora_disk_4:specifying DataFile (s) to restore from backup set
restoring DataFile 00001 to/oradata/hb130000/system01.dbf
restoring DataFile 00009 to/oradata/hb130000/users01.dbf
Restoring DataFile 00012 to/oradata/hb130000/gfb. Dbf
restoring DataFile 00019 to/oradata/hb130000/tgggg.dbf
Channel ora_disk_1:restored backup Piece 1
Piece Handle=/oradata/rmanbackup/df_hb130000_568897697_175_1.bak tag=tag20050913
T110814 Params=null
Channel Ora_disk_1:restore Complete
Channel ora_disk_2:restored backup Piece 1
Piece Handle=/oradata/rmanbackup/df_hb130000_568897694_173_1.bak tag=tag20050913
T110814 Params=null
Channel Ora_disk_2:restore Complete
Channel ora_disk_3:restored backup Piece 1
Piece Handle=/oradata/rmanbackup/df_hb130000_568897694_172_1.bak tag=tag20050913
T110814 Params=null
Channel Ora_disk_3:restore Complete
Channel ora_disk_4:restored backup Piece 1
Piece Handle=/oradata/rmanbackup/df_hb130000_568897695_174_1.bak tag=tag20050913
T110814 Params=null
Channel Ora_disk_4:restore Complete
Finished restore at 13-sep-05

Rman>


rman> Recover database;

Starting recover at 13-sep-05
Using channel Ora_disk_1
Using channel Ora_disk_2
Using channel Ora_disk_3
Using channel Ora_disk_4

Starting Media recovery

Channel ora_disk_1:starting archive log restore to default destination
Channel ora_disk_1:restoring Archive Log
Archive Log thread=1 sequence=32
Channel ora_disk_1:restored backup Piece 1
Piece Handle=/oradata/rmanbackup/df_hb130000_568897755_179_1.bak tag=tag20050913
T110915 Params=null
Channel Ora_disk_1:restore Complete
Archive Log filename=/oradata/rmanbackup/archive/hb130000_1_32.dbf thread=1 sequ
Ence=32
Unable to find archive log
Archive Log thread=1 sequence=33
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR message STACK follows ===============
RMAN-00571: ===========================================================
Rman-03002:failure of recover command at 09/13/2005 14:20:50
Rman-06054:media recovery requesting unknown Log:thread 1 SCN 26146497

rman> Recover database;

Starting recover at 13-sep-05
Using channel Ora_disk_1
Using channel Ora_disk_2
Using channel Ora_disk_3
Using channel Ora_disk_4

Starting Media recovery

Unable to find archive log
Archive Log thread=1 sequence=33
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR message STACK follows ===============
RMAN-00571: ===========================================================
Rman-03002:failure of recover command at 09/13/2005 14:26:33
Rman-06054:media recovery requesting unknown Log:thread 1 SCN 26146497


10, the database Resetlogs open
rman> ALTER DATABASE open resetlogs;

Database opened
New incarnation of database registered in recovery catalog
Starting full resync of recovery catalog
Full Resync Complete

Rman>


11. Fully back up the database.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.