這篇文章給大家介紹ORACLE服務器異常斷電及控制文件故障的處理步驟是什么,內容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
創(chuàng)新互聯建站是一家專業(yè)從事網站設計制作、做網站的網絡公司。作為專業(yè)網站設計公司,創(chuàng)新互聯建站依托的技術實力、以及多年的網站運營經驗,為您提供專業(yè)的成都網站建設、成都全網營銷推廣及網站設計開發(fā)服務!
這里只是簡單的記錄操作步驟,以做備忘。
一、版本
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1 .0 - Production
PL/SQL Release 11.2.0.1 .0 - Production CORE 11.2.0.1
二、故障
SQL> startup mount;
ORACLE 例程已經啟動。
Total System Global Area 1046224896 bytes
Fixed Size 1379212 bytes
Variable Size 708838516 bytes
Database Buffers 331350016 bytes
Redo Buffers 4657152 bytes
數據庫裝載完畢。
SQL> alter dabase open;
alter dabase open
*
第 1 行出現錯誤:
ORA-00940: 無效的 ALTER 命令
SQL> alter database open;
alter database open
*
第 1 行出現錯誤:
ORA-01122: 數據庫文件 1 驗證失敗
ORA-01110: 數據文件 1: 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF'
ORA-01207: 文件比控制文件更新 - 舊的控制文件
三、處理步驟
SQL> alter database backup controlfile to trace as 'G:\ctl1.txt';
數據庫已更改。
SQL> shutdown immediate;
ORA-01109: 數據庫未打開
已經卸載數據庫。
ORACLE 例程已經關閉。
SQL> startup nomount;
ORACLE 例程已經啟動。
Total System Global Area 1046224896 bytes
Fixed Size 1379212 bytes
Variable Size 708838516 bytes
Database Buffers 331350016 bytes
Redo Buffers 4657152 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG' SIZE 50M BLOCKSIZ
E 512,
9 GROUP 2 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG' SIZE 50M BLOCKSIZ
E 512,
10 GROUP 3 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG' SIZE 50M BLOCKSIZ
E 512
11 DATAFILE
12 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF',
13 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF',
14 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF',
15 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF',
16 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF'
17 CHARACTER SET ZHS16GBK;
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG
*
第 1 行出現錯誤:
ORA-01503: CREATE CONTROLFILE ??
ORA-01229: data file 2 is inconsistent with logs
ORA-01110: data file 2: 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF'
我們使用resetlogs進行重建避開和redo logs的校驗
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS NOARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG' SIZE 50M BLOCKSIZ
E 512,
9 GROUP 2 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG' SIZE 50M BLOCKSIZ
E 512,
10 GROUP 3 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG' SIZE 50M BLOCKSIZ
E 512
11 DATAFILE
12 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF',
13 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF',
14 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF',
15 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF',
16 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF'
17 CHARACTER SET ZHS16GBK;
控制文件已創(chuàng)建。
SQL> alter database mount;
alter database mount
*
第 1 行出現錯誤:
ORA-01100: ??????
SQL> alter session set nls_language='american';--中文字符集顯示亂碼,需要更改session字符集
Session altered.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01100: database already mounted
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF'
進行recover數據庫,需要使用resetlogs和手動指定歸檔日志這里其實就是redolog中的一個
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
SQL> recover database using backup controlfile;
ORA-00279: change 28088746 generated at 12/16/2017 20:32:45 needed for thread 1
ORA-00289: suggestion :
G:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_12_19\O1_MF_1_572_%U_.ARC
ORA-00280: change 28088746 for thread 1 is in sequence #572
Specify log: {=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log
'G:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_12_19\O1_MF_1_572_%U_.ARC'
ORA-27041: unable to open file
OSD-04002: ????????????
O/S-Error: (OS 2) ??????????????????????
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 0
Current log sequence 0
SQL> recover database using backup controlfile;
ORA-00279: change 28088746 generated at 12/16/2017 20:32:45 needed for thread 1
ORA-00289: suggestion :
G:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_12_19\O1_MF_1_572_%U_.ARC
ORA-00280: change 28088746 for thread 1 is in sequence #572
Specify log: {=suggested | filename | AUTO | CANCEL}
G:\app\Administrator\oradata\orcl\REDO01.LOG
ORA-00310: archived log contains sequence 571; sequence 572 required
ORA-00334: archived log: 'G:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG'
SQL> recover database using backup controlfile;
ORA-00279: change 28088746 generated at 12/16/2017 20:32:45 needed for thread 1
ORA-00289: suggestion :
G:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_12_19\O1_MF_1_572_%U_.ARC
ORA-00280: change 28088746 for thread 1 is in sequence #572
Specify log: {=suggested | filename | AUTO | CANCEL}
G:\app\Administrator\oradata\orcl\REDO02.LOG 這里指定是redolog中的一個
Log applied.
Media recovery complete.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
G:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF
G:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
G:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
G:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 1046224896 bytes
Fixed Size 1379212 bytes
Variable Size 708838516 bytes
Database Buffers 331350016 bytes
Redo Buffers 4657152 bytes
數據庫裝載完畢。
數據庫已經打開。
至此恢復完成。
關于ORACLE服務器異常斷電及控制文件故障的處理步驟是什么就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
分享名稱:ORACLE服務器異常斷電及控制文件故障的處理步驟是什么
文章鏈接:http://jinyejixie.com/article20/gpejjo.html
成都網站建設公司_創(chuàng)新互聯,為您提供App開發(fā)、網站策劃、品牌網站建設、網頁設計公司、動態(tài)網站、品牌網站制作
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯