早上海南的同事打電話說他們的審計庫連不上了啓動也報錯,問了下最近作了些什麼操做,答覆是以前添加了一次磁盤。 猜想是添加磁盤啓動後/dev/sdx順序出錯,或者沒有正常的關閉數據庫致使數據庫沒法正常啓動。
遠程登過去,先看了一下alert日誌:
發現有以下報警:
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
Error 704 happened during db open, shutting down database
USER (ospid: 6460): terminating the instance due to error 704
Instance terminated by USER, pid = 6460
ORA-1092 signalled during: ALTER DATABASE OPEN...
opiodr aborting process unknown ospid (6460) as a result of ORA-1092
Tue Feb 23 10:59:31 2016
ORA-1092 : opitsk aborting process
嘗試啓動一次數據庫:
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 4728872960 bytes
Fixed Size 1314156 bytes
Variable Size 163578516 bytes
Database Buffers 1019898880 bytes
Redo Buffers 6004736 bytes
Database mounted.
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
Process ID: 2056
Session ID: 128 Serial number: 7
發現報的錯和alert日誌顯示的同樣。
這個錯大概是system表空間裏面的核心表被刪除了,因此數據庫啓動不起來。這裏,若是沒有備份的話,這個就不能用常規的手段啓動了。
首先去找到報ORA-00704的緣由:
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 4728872960 bytes
Fixed Size 1314156 bytes
Variable Size 163578516 bytes
Database Buffers 1019898880 bytes
Redo Buffers 6004736 bytes
Database mounted.
SQL> alter session set sql_trace=true;
SQL> select value from v$diag_info where name='Default Trace File';
VALUE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/iscba/iscba/trace/iscba_ora_22821.trc
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
Process ID: 2176
Session ID: 128 Serial number: 7
而後查看iscba_ora_22821.trc:sql
Trace file /u01/app/oracle/diag/rdbms/iscba/iscba/trace/iscba_ora_22821.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2/db_1
System name: Linux
Node name: h-badb-01
Release: 2.6.32-431.el6.x86_64
Version: #1 SMP Sun Nov 10 22:19:54 EST 2013
Machine: x86_64
VM name: VMWare Version: 6
Instance name: iscba
Redo thread mounted by this instance: 1
Oracle process number: 17
Unix process pid: 22821, image: oracle@h-badb-01 (TNS V1-V3)
*** 2016-02-25 10:41:03.622
*** SESSION ID:(202.3) 2016-02-25 10:41:03.622
*** CLIENT ID:() 2016-02-25 10:41:03.622
*** SERVICE NAME:() 2016-02-25 10:41:03.622
*** MODULE NAME:(sqlplus@h-badb-01 (TNS V1-V3)) 2016-02-25 10:41:03.622
*** ACTION NAME:() 2016-02-25 10:41:03.622數據庫
。。。省略N多字。bootstrap
發現最後又以下提示:
=====================
PARSE ERROR #139799411328680:len=56 dep=1 uid=0 oct=3 lid=0 tim=1456368102317169 err=942
select order#,columns,types from access$ where d_obj#=:1
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
*** 2016-02-25 10:41:42.317
USER (ospid: 22821): terminating the instance due to error 704
*** 2016-02-25 10:41:43.413
EXEC #139799435394504:c=309952,e=2052517,p=57,cr=758,cu=0,mis=0,r=0,dep=0,og=1,plh=0,tim=1456368103413294
ERROR #139799435394504:err=1092 tim=1456368103413356
這個地方就能肯定,是缺失 access$ 形成的數據庫啓動不起來。
爲了解決問題,咱們只有用很是規的手段來本身建立這個表,來進行恢復,步驟以下:
1.啓動數據庫到upgrade狀態
SQL> startup upgrade
ORACLE instance started.
Total System Global Area 4728872960 bytes
Fixed Size 1314156 bytes
Variable Size 163578516 bytes
Database Buffers 1019898880 bytes
Redo Buffers 6004736 bytes
Database mounted.
Database opened.
2.建立access$ 和相關的索引
SQL> create table access$
2 ( d_obj# number not null,
3 order# number not null,
4 columns raw(126),
5 types number not null)
6 storage (initial 10k next 100k maxextents unlimited pctincrease 0)
7 /
Table created.
SQL> create index i_access1 on
2 access$(d_obj#, order#)
3 storage (initial 10k next 100k maxextents unlimited pctincrease 0)
4 /
Index created.
注意:建立語句能夠在$ORACLE_HOME/RDBMS/ADMIN/dcore.bsq中找到
3.重啓數據庫
QL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 4728872960 bytes
Fixed Size 1314156 bytes
Variable Size 163578516 bytes
Database Buffers 1019898880 bytes
Redo Buffers 6004736 bytes
Database mounted.
Database opened.session
4.檢查狀態並用tnsname去鏈接
select status from v$instance;
sqlplus username/password@TNSNAMESoracle