下面是数据中的数据文件,参数文件,控制文件全部丢失,只有RMAN备份的文件,包括数据文件,参数文件,控制文件。恢复数据库到备份状态
RMAN> delete backup;
RMAN> backup database;
RMAN> backup spfile;
RMAN> shutdown abort;
Oracle instance shut down
[oracle@huang11 ~]$ rm /sof/oracle/oradata/orcl/* -rf
[oracle@huang11 ~]$ rm /sof/oracle/admin/orcl -rf
[oracle@huang11 ~]$ rm /sof/oracle/10g/dbs/*orcl* -rf
[oracle@huang11 ~]$ rm /sof/oracle/10g/dbs/*ORCL* -rf
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/sof/oracle/10g/dbs/initorcl.ora'
下面是恢复spfile文件。
RMAN> restore spfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_nnsnf_TAG20100119T113309_5ob9zoq0_.bkp';
RMAN> startup force;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 01/19/2010 11:36:50
RMAN-04014: startup failed: ORA-09925: Unable to create audit trail file
Linux Error: 2: No such file or directory
Additional information: 9925
[oracle@huang11 ~]$ mkdir /sof/oracle/admin/orcl/{a,b,c,d,u}dump -p
RMAN> startup force;
Oracle instance started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 01/19/2010 11:40:25
ORA-00205: error in identifying control file, check alert log for more info
RMAN> restore controlfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp';
Starting restore at 19-JAN-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
channel ORA_DISK_1: restoring control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/19/2010 11:41:13
ORA-19870: error reading backup piece /sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp
ORA-19504: failed to create file "/sof/oracle/oradata/orcl/control01.ctl"
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory
[oracle@huang11 ~]$ mkdir /sof/oracle/oradata/orcl
RMAN> restore controlfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp';
Starting restore at 19-JAN-10
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output filename=/sof/oracle/oradata/orcl/control01.ctl
output filename=/sof/oracle/oradata/orcl/control02.ctl
output filename=/sof/oracle/oradata/orcl/control03.ctl
Finished restore at 19-JAN-10
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
RMAN> recover database;
Starting recover at 19-JAN-10
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/19/2010 11:43:12
RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 560763
SQL> alter database open resetlogs;
Database altered.
如果这里还是不能成功的时候我们就要加隐藏参数。
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
SQL> shutdown abort;
SQL> startup force;
SQL> alter database open resetlogs;
s
成功后取消隐藏参数。
SQL> alter system reset "_allow_resetlogs_corruption" scope=spfile sid='*';
System altered.
SQL> shutdown immediate;
SQL> startup
下面我们查看数据是否能正常查询。
SQL> select count(*) from luo.luo;
COUNT(*)
----------
14
数据能正常查询,说明正常。
本文转自7343696 51CTO博客,原文链接:
http://blog.51cto.com/luoping/267862
,如需转载请自行联系原作者