未完全關閉資料庫導致ORA-01012: not logged的解決

還不算暈發表於2013-10-10
首先使用SHUTDOWN NORMAL方式關閉資料庫,在資料庫未關閉時CTRL+Z停止執行,退出用SQLPLUS重登陸,出現報錯:ORA-01012: not logged on


實驗如下:

首先執行
SYS@bys1>shutdown
ORA-01013: user requested cancel of current operation


[oracle@bys001 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Sep 7 09:05:08 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected.
ERROR:
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0


SYS@bys1>startup
ORA-01012: not logged on
SYS@bys1>conn / as sysdba
Connected to an idle instance.
ERROR:
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0

SYS@bys1>conn bys/bys
ERROR:
ORA-01090: shutdown in progress - connection is not permitted
Process ID: 0
Session ID: 0 Serial number: 0

Warning: You are no longer connected to ORACLE.

解決方法:

找到程式,kill掉就可以了。

[oracle@bys001 ~]$ ps -ef |grep ora_dbw0_
oracle    6519     1  0 Sep06 ?        00:00:15 ora_dbw0_bys1
oracle   20947 20924  0 09:08 pts/0    00:00:00 grep ora_dbw0_
[oracle@bys001 ~]$ kill -9 6519
[oracle@bys001 ~]$ ps -ef |grep ora_dbw0_
oracle   20949 20924  0 09:08 pts/0    00:00:00 grep ora_dbw0_

[oracle@bys001 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Sep 7 09:08:22 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SYS@bys1>startup
ORACLE instance started.
Total System Global Area  631914496 bytes
Fixed Size                  1338364 bytes
Variable Size             264242180 bytes
Database Buffers          360710144 bytes
Redo Buffers                5623808 bytes
Database mounted.
Database opened.
SYS@bys1>

相關文章