老久沒有修復控制檔案重建了,今天又弄乙個

2021-09-24 15:41:58 字數 2096 閱讀 2179

2023年11月30日 16:58:00 galdys 閱讀數 7933

1.sql>shutdown abort 如果資料庫是開啟狀態,強行關閉

2.sql>sqlplus / as sysdba

3.sql>startup

oracle 例程已經啟動。

total system global area 293601280 bytes

fixed size 1248624 bytes

variable size 121635472 bytes

database buffers 167772160 bytes

redo buffers 2945024 bytes

資料庫裝載完畢。

ora-01122: 資料庫檔案 1 驗證失敗

ora-01110: 資料檔案 1:

'f:/oracle/product/10.2.0/db_1/oradata/orcldw/system01.dbf'

ora-01207: 檔案比控制檔案更新 - 舊的控制檔案

4.sql>alter database backup controlfile to trace as 'f:/aa';

資料庫已更改。

5.sql>shutdown immediate 如果資料庫是開啟狀態,則關閉

ora-01109: 資料庫未開啟

已經解除安裝資料庫

6.sql>startup nomount;

oracle 例程已經啟動。

total system global area 105979576 bytes

fixed size 454328 bytes

variable size 79691776 bytes

database buffers 25165824 bytes

redo buffers 667648 bytes

7.editplus之類的編輯器開啟在第四步生成的f:/aa檔案;

其實在這個檔案中的已經告訴你咋樣恢復你的資料庫了,找到startup nomount字樣,然後下面可以看到類似語句,這個檔案有好幾個類似的生成控制檔案語句,主要針對不懂的環境執行不同的語句,象我的資料庫沒有做任何備份,也不是在歸檔模式,就執行這句

create controlfile reuse database "orcldw" noresetlogs noarchivelog

maxlogfiles 16

maxlogmembers 3

maxdatafiles 100

maxinstances 8

maxloghistory 292

logfile

group 1 'f:/oracle/product/10.2.0/db_1/oradata/orcldw/redo01.log' size 50m,

group 2 'f:/oracle/product/10.2.0/db_1/oradata/orcldw/redo02.log' size 50m,

group 3 'f:/oracle/product/10.2.0/db_1/oradata/orcldw/redo03.log' size 50m

datafile

'f:/oracle/product/10.2.0/db_1/oradata/orcldw/system01.dbf',

'f:/oracle/product/10.2.0/db_1/oradata/orcldw/undotbs01.dbf',

'f:/oracle/product/10.2.0/db_1/oradata/orcldw/sysaux01.dbf',

'f:/oracle/product/10.2.0/db_1/oradata/orcldw/users01.dbf',

'f:/oracle/product/10.2.0/db_1/oradata/orcldw/example01.dbf'

character set zhs16gbk

;執行上面這段語句,這個語句重建控制檔案,然後你可以看著f:/aa檔案完成下面的恢復工作了,

8.sql>recover database (恢復指定表空間、資料檔案或整個資料庫)

9.sql>alter database open 開啟資料庫

重建控制檔案

1 在庫完好的時候先備份一下controlfile以備不時之需 sql alter database backup controlfile to trace sql exit cd oracle base admin oracle sid udump ls ltrh tail 1 rw r 1ora...

重建控制檔案原理

非正常關機後 noresetlogs重建控制檔案 控制檔案中scn來自 最後一次將日誌寫入磁碟的scn sql select checkpoint change from v datafile checkpoint change 928548 928548 928548 928548 sql sel...

ORACLE控制檔案的重建

資料庫系統執行一段時間後有很多引數需要調整,有些引數可在 oracle home dbs init ora檔案中調整,而有些引數必須要在 oracle的 控制檔案中調整。如 oracle的預設資料檔案個數為30個,在系統需要擴表空間而資料檔案個數不夠時就需要進行調整。一種方法是將所有資料全倒出來,重...