通过使用resetlog恢复控制文件恢复数据库(二)
Size 1218604 bytes
VariableSize 62916564 bytes
DatabaseBuffers 150994944 bytes
RedoBuffers 2973696 bytes
ORA-00205:error in identifying control file, check alert log for more info
www.2cto.com
恢复控制文件
[oracle@rhel510.2.0]$ rman target /
RecoveryManager: Release 10.2.0.1.0 - Production on Mon Jun 25 10:26:22 2012
Copyright(c) 1982, 2005,
Oracle. All rightsreserved.
connectedto target database: orcl (not mounted)
RMAN>restore controlfile from'/opt/oracle/product/10.2.0/flash_recovery_area/CUUG/autobackup/2012_06_26/o1_mf_n_786973989_7yldk6mm_.bkp';
Startingrestore at 26-JUN-12
usingchannel ORA_DISK_1
channelORA_DISK_1: restoring control file
channelORA_DISK_1: restore complete, elapsed time: 00:00:03
outputfilename=/opt/oracle/product/10.2.0/oradata/cuug/control01.ctl
outputfilename=/opt/oracle/product/10.2.0/oradata/cuug/control02.ctl
outputfilename=/opt/oracle/product/10.2.0/oradata/cuug/control03.ctl
Finishedrestore at 26-JUN-12
把控制文件
标记trace文件
SQL>alter session set tracefile_identifier='cuug';
Sessionaltered.
SQL>alter database mount;
Databasealtered.
SQL>alter database backup controlfile to trace;
Databasealtered.
重建控制文件,先关闭数据库,删除之前从备份中恢复出来的控制文件,启动到nomount阶段
SQL>shutdown immediate
ORA-01109:database not open
Databasedismounted.
ORACLEinstance shut down.
SQL>startup nomount;
ORACLEinstance started.
www.2cto.com
TotalSystem Global Area 218103808 bytes
FixedSize 1218604 bytes
VariableSize 79693780 bytes
DatabaseBuffers 134217728 bytes
RedoBuffers 2973696 bytes
使用noresetlogs创建,因为联机日志还在,所以可以使用noresetlogs的方法创建
[oracle@rhel5orcl]$ ls *.ctl
control01.ctl control02.ctl control03.ctl
[oracle@rhel5orcl]$ rm *.ctl
[oracle@rhel5udump]$ vi cuug_ora_4744_cuug.trc
CREATECONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG
MAXLOGFILES16
MAXLOGMEMBERS3
MAXDATAFILES100
MAXINSTANCES8
MAXLOGHISTORY292
LOGFILE
GROUP 1'/opt/oracle/product/10.2.0/oradata/orcl/redo01.log' SIZE 50M,
GROUP 2'/opt/oracle/product/10.2.0/oradata/orcl/redo02.log' SIZE 50M,
GROUP 3'/opt/oracle/product/10.2.0/oradata/orcl/redo03.log' SIZE 50M,
GROUP 4'/opt/oracle/product/10.2.0/oradata/orcl/redo04.log' SIZE 50M
--STANDBY LOGFILE
DATAFILE
'/opt/oracle/product/10.2.0/oradata/orcl/system01.dbf',
'/opt/oracle/product/10.2.0/oradata/orcl/undotbs01.dbf',
'/opt/oracle/product/10.2.0/oradata/orcl/sysaux01.dbf',
'/opt/oracle/product/10.2.0/oradata/orcl/users01.dbf',
'/opt/oracle/product/10.2.0/oradata/orcl/rmans01.dbf',
'/opt/oracle/product/10.2.0/oradata/orcl/cuug01.dbf',
'/opt/oracle/product/10.2.0/oradata/orcl/ORCL/datafile/o1_mf_zxm_7ycm0twl_.dbf',
'/opt/oracle/product/10.2.0/oradata/orcl/ORCL/datafile/o1_mf_cuug_7ycm20jq_.dbf'
CHARACTERSET UTF8
;
此时打开数据库会提示错误
首先要恢复数据文件
查询数据文件
SQL>select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/opt/o