事情起由是在Oracle
修改之前記錄其dbid
引用
SQL> select dbid from v$database;
DBID
修改dbid
引用
SQL> exec dbms_backup_restore
PL/SQL procedure successfully completed
貌似執行成功了
引用
Tue Mar
CKPT: terminating instance due to error
Instance terminated by CKPT
Tue Mar
再次啟動數據庫報錯
引用
Tue Mar
Errors in file /ora
ORA
ORA
dump Oracle數據文件頭
引用
SQL> ALTER SESSION SET EVENTS
通過跟蹤文件可以看到dbid以被重置為
引用
V
Compatibility Vsn =
Db ID=
Activation ID=
Control Seq=
File Number=
還有一種途徑是通過bbed工具觀察
引用
struct kcvfhhdr
ub
ub
ub
當然第一反應是重建控制文件
引用
SQL> alter database backup controlfile to trace;
Database altered
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE
MAXLOGFILES
MAXLOGMEMBERS
MAXDATAFILES
MAXINSTANCES
MAXLOGHISTORY
LOGFILE
GROUP
GROUP
GROUP
DATAFILE
CHARACTER SET ZHS
;
郁悶的是重建控制文件不成功
引用
CREATE CONTROLFILE REUSE DATABASE
*
ERROR at line
ORA
ORA
想到還有另外一種語法重建控制文件(重建控制文件之前
引用
Create controlfile reuse set database
MAXINSTANCES
MAXLOGHISTORY
MAXLOGFILES
MAXLOGMEMBERS
MAXDATAFILES
Datafile
LOGFILE GROUP
GROUP
GROUP
似乎重建成功了!但是進行recover的時候報錯了!
引用
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE;
ORA
ORA
[]
可以看到控制文件在重建的過程中進行了dbid重置
引用
SQL> select dbid from v$database;
DBID
問題到這裡似乎失去了頭緒
引用
SQL> STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE
MAXLOGFILES
MAXLOGMEMBERS
MAXDATAFILES
MAXINSTANCES
MAXLOGHISTORY
LOGFILE
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
GROUP
GROUP
GROUP
DATAFILE
CHARACTER SET ZHS
Control file created
嘗試打開數據庫
SQL> alter database open RESETLOGS;
出現數據庫掛起狀態
引用
SMON: enabling cache recovery
Tue Mar
Errors in file /ora
ORA
Tue Mar
Errors in file /ora
ORA
Tue Mar
由於shutdown abort實例不起作用
引用
[ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
ora
[ora
引用
[ora
key shmid owner perms bytes nattch status
key semid owner perms nsems
key msqid owner perms used
[root@test ~]# ipcrm
[root@test ~]# ipcrm
再次嘗試將實例打開
引用
SQL> alter session set events
Session altered
SQL> alter database open;
alter database open
*
ERROR at line
ORA
ORA
SQL> recover database;
Media recovery complete
SQL> alter database open;
Database altered
後續工作就是將tempfile添加到temp表空間中
引用
SQL> alter tablespace temp add tempfile
Tablespace altered
From:http://tw.wingwit.com/Article/program/Oracle/201311/18247.html