Oracle数据库丢失控制文件的恢复四则(2)

control_files                        string      /u02/oradat/bkt/control01.ctl,/u02/flash_recovery_area/bkt/control02.ctl

[root@master ~]# rm /u02/oradat/bkt/control01.ctl

rm: remove regular file`/u02/oradat/bkt/control01.ctl'? y

[root@master ~]# rm/u02/flash_recovery_area/bkt/control02.ctl

rm: remove regular file`/u02/flash_recovery_area/bkt/control02.ctl'? y

sys@BKT> alter system switch logfile ;

System altered.

sys@BKT> alter system archive logcurrent ;

System altered.

看来不是立刻写入控制文件中。

Errors in file/u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_m000_6382.trc:

ORA-00210: cannot open the specified controlfile

ORA-00202: control file:'/u02/oradat/bkt/control01.ctl'

ORA-27041: unable to open file

Linux-x86_64 Error: 2: No such file ordirectory

Additional information: 3

sys@BKT> create tablespace test1datafile '/u02/oradat/bkt/test1_01.dbf' size 10m ;

Tablespace created.

如果及时的发现数据库未关闭,可以使用下面的命令将重建控制文件的脚本输出到trace文件中,方便后面的控制文件重建操作。

sys@BKT> alter database backupcontrolfile to trace ;

Database altered.

alter :

Backup controlfile written to trace file/u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_ora_5933.trc

Completed: alter database backupcontrolfile to trace

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/39530324a23506ac239184a9154a11ab.html