控制文件没有了后,系统不会自己down,但是shutdown immedate时,就会报错了
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/ORADATA/app/oradata/orcl11g/control01.ctl'
ORA-27041: unable to open file
直接shutdown abort;
然后startup nomount;
打算用rman来恢复
然后用set dbid xxxxxx来做,但是nomount下,v$database是看不见的。咋办,如何得到dbid? 怎么办
1.alter session set tracefile_identifier = arup;
2.alter system dump datafile '/ORADATA/app/oradata/orcl11g/system01.dbf' block min 1 block max 10;
3.去到trace的目录/ORADATA/app/diag/rdbms/orcl11g/orcl11g/trace,
ls *ARUP*
看到dump出来了system tablespace的头block文件trc
view orcl11g_ora_23536_ARUP.trc
往下找,可以找到
Start dump data block from file /ORADATA/app/oradata/orcl11g/system01.dbf minblk 1 maxblk 10
V10 STYLE FILE HEADER:
Compatibility Vsn = 186646528=0xb200000
Db ID=972690783=0x39fa155f, Db Name='ORCL11G'
这里就找到了dbid了
赶紧在rman里面
set dbid 972690783
restore controlfile from autobackup;
如果不执行set dbid 972690783,会报
Starting restore at 10-APR-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=189 device type=DISK
recovery area destination: /ORADATA/app/flash_recovery_area
database name (or database unique name) used for search: ORCL11G
channel ORA_DISK_1: AUTOBACKUP /ORADATA/app/flash_recovery_area/ORCL11G/autobackup/2015_04_10/o1_mf_s_876691401_blhj5tm7_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP /ORADATA/app/flash_recovery_area/ORCL11G/autobackup/2015_04_10/o1_mf_s_876691401_blhj5tm7_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/ORADATA/app/oradata/orcl11g/control01.ctl
output file name=/ORADATA/app/flash_recovery_area/orcl11g/control02.ctl
Finished restore at 10-APR-1
虽然会报,但是其实控制文件还恢复成功了的,这是因为我用了catalog管理功能,如果没有catalog功能,不设置dbid是恢复不了的。
接着
alter database mount;
recover database;
alter database open resetlogs;
done!
没有评论:
发表评论