【ORACLE】oracle資料檔案損壞,出現錯誤:ora-01033:oracle initialization or shutdown in progress

來源:互聯網
上載者:User

首先:問題的產生原因,出現這個錯誤是因為我將\oracle\product\10.1.0\oradata\oral下的一個檔案刪除掉後出現的。

    利用sql語句語句建立資料表空間時弄錯了,就一時心急把建立的檔案刪除了。結果問題就出來了。sysdba可以登入,但是在使用中就出現“資料庫未開啟,僅允許在固定表/視圖中查詢”,而normal使用者無法登入使用,出現ORA-01033: ORACLE initialization or shutdown in progress 的錯誤。

分析:這個錯誤的原因應該是Oracle在啟動後,使用者登入時是要將方案中原有配置資訊裝載進入,裝載過程中配置中有檔案未找到,所以就報出錯誤。

解決過程:

C:\Documents and Settings\DHai>sqlplus /nolog

SQL*Plus: Release 10.1.0.2.0 - Production on 星期一 9月 28 14:35:38 2009

Copyright (c) 1982, 2004, Oracle. All rights reserved.

SQL> connect sys/123 as sysdba;
已串連。
SQL> shutdown normal
ORA-01109: 資料庫未開啟

已經卸載資料庫。
ORACLE 常式已經關閉。
SQL> startup mount;
ORACLE 常式已經啟動。

Total System Global Area 171966464 bytes
Fixed Size                   787988 bytes
Variable Size             145750508 bytes
Database Buffers           25165824 bytes
Redo Buffers                 262144 bytes
資料庫裝載完畢。
SQL> alter database open;
alter database open
*
第 1 行出現錯誤:
ORA-01589: 要開啟資料庫則必須使用 RESETLOGS 或 NORESETLOGS 選項

SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出現錯誤:
ORA-01157: 無法標識/鎖定資料檔案 6 - 請參閱 DBWR 追蹤檔案
ORA-01110: 資料檔案 6: 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORAL\FSCREDIT40'

SQL> alter database datafile 6 offline drop;

資料庫已更改。

SQL> alter database open resetlogs;

資料庫已更改。

SQL> alter database datafile 6 offline drop;

資料庫已更改。

SQL> alter database open;
alter database open
*
第 1 行出現錯誤:
ORA-01531: 常式已開啟資料庫

SQL>shutdown normal
提示:資料庫已經關閉
已經卸載資料庫
ORACLE 常式已經關閉

SQL> startup mount;
ORACLE 常式已經啟動。

Total System Global Area 171966464 bytes
Fixed Size                   787988 bytes
Variable Size             145750508 bytes
Database Buffers           25165824 bytes
Redo Buffers                 262144 bytes
資料庫裝載完畢。

到此,問題解決了。
=============================================

============================================

網上另外的文章

=====================================

============================

ORACLE資料庫檔案損壞已解決。出現的問題是“Error:ORA-01033:ORACLE initialization or shutdown in progress”,後來從網上找了一些資料,最後加上自己的實踐終於解決了,不過有個問題,就是資料庫檔案好像都不能用了。

解決方案
在DOS環境下
sqlplus /NOLOG
SQL>connect sys/sys as sysdba
SQL>shutdown normal
SQL>startup mount
SQL>alter database open;

第 1 行出現錯誤:
ORA-01157: 無法標識/鎖定資料檔案 6 - 請參閱 DBWR 追蹤檔案
ORA-01110: 資料檔案 6: ''D:/ORACLE/ORADATA/ORAGWH/INDX01.DBF''

出現這種問題時繼續輸入
SQL> conn sys/sys as sysdba;
已串連。
SQL> alter database datafile 6 offline drop;

直到用scott登陸為止
SQL> conn scott/tiger

然後接著輸入即可
SQL>shutdown normal
SQL>startup

本文來自CSDN部落格,轉載請標明出處:http://blog.csdn.net/henlson/archive/2007/07/18/1696966.aspx

在輸入上述命令的時候,可能會出現下面的問題:

ORA-00313: 無法開啟日誌組 1 (線程 1) 的成員

解決方案如下:

   運行Oracle----Integrated Management Tools----SQLPlus WorkSheet

SQL> connect / as sysdba;

已串連。

SQL> shutdown immediate;

ORA-01109: 資料庫未開啟

已經卸載資料庫。

ORACLE 常式已經關閉。

SQL> startup;

ORACLE 常式已經啟動。

Total System Global Area 135338868 bytes

Fixed Size                   453492 bytes

Variable Size             109051904 bytes

Database Buffers           25165824 bytes

Redo Buffers                 667648 bytes

資料庫裝載完畢。

ORA-00313: 無法開啟日誌組 1 (線程 1) 的成員

ORA-00312: 聯機日誌 1 線程 1: 'C:\ORACLE\ORADATA\ORCL\REDO01.LOG'

查看C:\ORACLE\ORADATA\myoracle\REDO01.LOG還在,但是REDO02.LOG,REDO03.LOG被誤刪了.

趕緊換個常式OEMREP試試,結果還是一樣的錯誤!

蒙了,難道要重裝資料庫不成?有什麼辦法可以解決這個問題呢?

解決辦法:

SQL> shutdown immediate;

ORA-01109: 資料庫未開啟

已經卸載資料庫。

SQL> startup mount;

ORACLE 常式已經啟動。

SQL>select * from v$log;

GROUP#    THREAD# SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ----------

         1          1          0 104857600          1 NO UNCURRENT                 670680 05-12月-07

         2          1         15 104857600          1 NO   unactive                    696119 06-12月-07

         3          1          0 104857600          1 NO Unactive                     650182 05-12月-07

已選擇3行。

alter database clear unarchived logfile group 1;    /*重建記錄檔*/

資料庫已經更改.

alter database clear unarchived logfile group 2;

資料庫已經更改.

alter database clear unarchived logfile group 3;

資料庫已經更改.

SQL>shutdown;

已經卸載資料庫。

ORACLE 常式已經關閉。

SQL>startup;

ORACLE 常式已經啟動。

Total System Global Area 135338868 bytes

Fixed Size                   453492 bytes

Variable Size             109051904 bytes

Database Buffers           25165824 bytes

Redo Buffers                 667648 bytes

資料庫裝載完畢。

資料庫已經開啟。

問題解決!

但是,在對myoracle 常式進行同樣的操作後,也不知道是哪裡出了問題,

SQL>startup;

ORACLE 常式已經啟動。

Total System Global Area 135338868 bytes

Fixed Size                   453492 bytes

Variable Size             109051904 bytes

Database Buffers           25165824 bytes

Redo Buffers                 667648 bytes

資料庫裝載完畢。

ORA-03113: 通訊通道的檔案結束

在網上尋找資料,出現這樣的問題原因很多,一般是網路不通,或者是init.ora、C:\oracle\ora92\network\admin\sqlnet.ora或tnsnames.ora有問題.顯然這些不適合我.我的兩個常式,一個可以正常使用,另外一個有問題的!

在我關閉資料庫後,重新開啟,執行:

SQL>connect "/as sysdba";

SQL>select * from scott.emp;

ORA-27101 shared memory realm does not exist -

出現這個錯誤也有很多解釋,一般要檢查init.ora檔案的記憶體配置是否有問題,但是在沒有開啟資料庫的時候執行命令,也會出現這樣的錯誤提示,我的屬於後者,是由於沒有掛載資料庫造成的,這裡提醒一下.

    後來又亂琢磨了一回,還出現了錯誤:

ORA-24324: 未初始化服務控制代碼

ORA-01041: 內部錯誤,hostdef 副檔名不存在

這是越來越亂了,無奈之下,只好重頭再來整理一遍,從重新設定記錄檔開始,操作一樣,但是奇蹟出現了,錯誤消失了,也不提示通訊通道檔案結束了,資料庫正常了,呵呵,但是很暈!

解決問題知識整理:

首先,執行下面的語句看看group1是不是current日誌組

select * from v$log;

如果被刪除的日誌不是當前日誌組的成員,比較簡單

alter database clear logfile group 1;

如果你的庫是非歸檔的,或許要用下面的語句

alter database clear unarchived logfile group 1;

如果是當前日誌組損壞,但是資料庫是正常關閉的,上面的辦法也可以使用

如果日誌組中有活動的事務,那麼可能需要利用備份來恢複了:過程如下:

解決過程:Microsoft Windows XP [版本 5.1.2600](C) 著作權 1985-2001 Microsoft Corp.

C:\Documents and Settings\5201314>sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on 星期六 5月 27 11:19:52 2006Copyright (c) 1982, 2005, Oracle. All rights

reserved.

SQL> conn sys/dd as sysdba

已串連。

SQL> startup mount

ORA-01081: 無法啟動已在啟動並執行 ORACLE - 請首先關閉它

SQL> recover database until time '2006-05-19 13:45:02'; /*恢複*/

/*(recover database until cancel;alter database resetlogs;重建記錄檔),另外的寫法,不知哪個對.*/

完成介質恢複。

SQL> alter database open resetlogs;

資料庫已更改。           

SQL> shutdown immediate;

資料庫已經關閉。

已經卸載資料庫。

ORACLE 常式已經關閉。

SQL> startup

ORACLE 常式已經啟動。

Total System Global Area 205520896 bytes

Fixed Size 1248092 bytes

Variable Size 79692964 bytes

Database Buffers 117440512 bytes

Redo Buffers 7139328 bytes

資料庫裝載完畢。

資料庫已經開啟。

SQL>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.