当控制文件丢失解决办法



x
rman 下
connect target /
这里要记住你的dbid
RMAN> show all
2> ;


RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f';
第二步先进行一次备份 backup format '/uo1/app/oracle/rmanbak/full_%T_%u.bak' database plus archivelog;
备份完之后记住spfile 的位置  '/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_04_28/o1_mf_s_878224692_bmyf1o7h_.bkp'

为了确保安全 我们不采用rm将spfie删除 而是采用 mv spfileORCL.ora sfiel.ora;   这只是将spfile改了名字;

在rman下
RMAN> shutdown immediate;


using target database control file instead of recovery catalog
Oracle instance shut down

 startup nomount;


connected to target database (not started)
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl.ora'


starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2260088 bytes
Variable Size                281019272 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5517312 byt
这里会报错  LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl.ora'找不到spfile

设置dbid:
RMAN> set dbid 1403717444


executing command: SET DBID

RMAN> restore spfile from autobackup;


Starting restore at 28-APR-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=111 device type=DISK


channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150428
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150427
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150426
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150425
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150424
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150423
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150422
channel ORA_DISK_1: no AUTOBACKUP in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/28/2015 15:38:55
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

从autobackup 找不到制定的spfile路径要从之前的listbackup 显示的路径里查找

RMAN> restore spfile from '/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_04_28/o1_mf_s_878224692_bmyf1o7h_.bkp';


Starting restore at 28-APR-15
using channel ORA_DISK_1


channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_04_28/o1_mf_s_878224692_bmyf1o7h_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 28-APR-15

这时候就恢复完成了
在dbs里就能看到你的控制文件spfileORCL.ora
 
测试
rman下shutdown 数据库

之后startup  如果不能启动 在设置一下你的dbid  就可以了

数据库重新启动完成!


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30163683/viewspace-1609007/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30163683/viewspace-1609007/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值