ITPub博客

首页 > 数据库 > Oracle > 关闭oracle异常:ORA-01012: not logged on

关闭oracle异常:ORA-01012: not logged on

Oracle 作者:urgel_babay 时间:2016-02-29 17:26:12 0 删除 编辑
2014.12.31
        今天是2014年的最后一天,此时此刻加班中,公司大厦停电,所有的服务器都要关闭。

在对一个生产库做shutdown immediate 的时候,可能是因为网络掉线了,导致正在shutdown的时候出现异常。当时看着一直卡在shutdown immediate,本以为是需要的时间长一点,但是十分钟后还是卡在那里,于是去看alert,结果alert也没有更新:
Private strand flush not complete
  Current log# 7 seq# 92151 mem# 0: /u02/logfile/redo71.log
  Current log# 7 seq# 92151 mem# 1: /u03/logfile/redo72.log
Thread 1 advanced to log sequence 92152 (LGWR switch)
  Current log# 8 seq# 92152 mem# 0: /u04/logfile/redo81.log
  Current log# 8 seq# 92152 mem# 1: /u02/logfile/redo82.log
Wed Dec 31 20:02:45 2014
Shutting down instance (immediate)
Stopping background process SMCO
Shutting down instance: further logons disabled
Wed Dec 31 20:03:05 2014
Stopping background process CJQ0
Wed Dec 31 20:03:05 2014
Stopping background process QMNC
Stopping background process MMNL
Stopping background process MMON
License high water mark = 153
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL

然后想重新sqlplus 连进入 去再次shutdown。可以出现这样的情况:

[oracle@zhanglin ~]$ export ORACLE_SID=zhanglin
[oracle@zhanglin ~]$ hostname
zhanglin
[oracle@zhanglin ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Dec 31 20:11:57 2014

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

Connected.
SQL> shutdown
ORA-01012: not logged on
SQL>
SQL> startup
ORA-01012: not logged on
SQL>

查看后台进程时oracle还在:
[oracle@zhanglin ~]$ ps -ef | grep oracle
root     14422 25243  0 18:06 ?        00:00:00 sshd: oracle [priv]
oracle   14424 14422  0 18:06 ?        00:00:00 sshd: oracle@pts/2
oracle   14425 14424  0 18:06 pts/2    00:00:00 -bash
oracle   16150     1  6 20:02 ?        00:00:36 oraclezhanglin (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
root     16165 25243  0 20:08 ?        00:00:00 sshd: oracle [priv]
root     16167 25243  0 20:08 ?        00:00:00 sshd: oracle [priv]
oracle   16169 16165  0 20:08 ?        00:00:00 sshd: oracle@pts/4
oracle   16170 16167  0 20:08 ?        00:00:00 sshd: oracle@pts/1
oracle   16171 16170  0 20:08 pts/1    00:00:00 -bash
oracle   16172 16169  0 20:08 pts/4    00:00:00 -bash
oracle   16230 16171  0 20:09 pts/1    00:00:00 tail -f alert_zhanglin.log
oracle   16280 16172  0 20:11 pts/4    00:00:00 sqlplus   as sysdba
root     16284 25243  0 20:11 ?        00:00:00 sshd: oracle [priv]
oracle   16286 16284  0 20:11 ?        00:00:00 sshd: oracle@pts/3
oracle   16287 16286  0 20:11 pts/3    00:00:00 -bash
oracle   16316 16287  0 20:11 pts/3    00:00:00 tail -f alert_zhanglin.log
oracle   16318 16280  0 20:11 ?        00:00:00 oraclezhanglin (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   16320 16280  0 20:11 pts/4    00:00:00 /bin/bash
oracle   16346 16320  0 20:11 pts/4    00:00:00 sqlplus   as sysdba
oracle   16348 16346  0 20:11 ?        00:00:00 oraclezhanglin (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   16378 16346  0 20:12 pts/4    00:00:00 /bin/bash
oracle   16402 16378  0 20:12 pts/4    00:00:00 ps -ef
oracle   16403 16378  0 20:12 pts/4    00:00:00 grep oracle
oracle   25738     1  0 Dec25 ?        00:00:50 ora_pmon_zhanglin
oracle   25740     1  0 Dec25 ?        00:00:12 ora_psp0_zhanglin
oracle   25742     1  0 Dec25 ?        00:00:00 ora_vktm_zhanglin
oracle   25746     1  0 Dec25 ?        00:00:00 ora_gen0_zhanglin
oracle   25748     1  0 Dec25 ?        00:00:00 ora_diag_zhanglin
oracle   25750     1  0 Dec25 ?        00:00:00 ora_dbrm_zhanglin
oracle   25752     1  0 Dec25 ?        00:43:48 ora_dia0_zhanglin
oracle   25754     1  0 Dec25 ?        00:00:21 ora_mman_zhanglin
oracle   25756     1  0 Dec25 ?        00:09:17 ora_dbw0_zhanglin
oracle   25758     1  0 Dec25 ?        00:08:18 ora_dbw1_zhanglin
oracle   25760     1  0 Dec25 ?        00:08:17 ora_dbw2_zhanglin
oracle   25762     1  0 Dec25 ?        00:08:26 ora_dbw3_zhanglin
oracle   25764     1  0 Dec25 ?        00:08:01 ora_dbw4_zhanglin
oracle   25766     1  0 Dec25 ?        00:08:37 ora_dbw5_zhanglin
oracle   25768     1  0 Dec25 ?        00:07:47 ora_dbw6_zhanglin
oracle   25770     1  0 Dec25 ?        00:08:01 ora_dbw7_zhanglin
oracle   25772     1  0 Dec25 ?        00:08:24 ora_dbw8_zhanglin
oracle   25774     1  0 Dec25 ?        00:08:10 ora_dbw9_zhanglin
oracle   25776     1  0 Dec25 ?        00:08:29 ora_dbwa_zhanglin
oracle   25778     1  0 Dec25 ?        00:08:40 ora_dbwb_zhanglin
oracle   25780     1  0 Dec25 ?        00:08:26 ora_dbwc_zhanglin
oracle   25782     1  0 Dec25 ?        00:07:55 ora_dbwd_zhanglin
oracle   25784     1  0 Dec25 ?        00:08:15 ora_dbwe_zhanglin
oracle   25786     1  0 Dec25 ?        00:08:40 ora_dbwf_zhanglin
oracle   25788     1  0 Dec25 ?        01:01:25 ora_lgwr_zhanglin
oracle   25790     1  0 Dec25 ?        00:06:00 ora_ckpt_zhanglin
oracle   25792     1  0 Dec25 ?        00:01:41 ora_smon_zhanglin
oracle   25794     1  0 Dec25 ?        00:00:00 ora_reco_zhanglin

此时就没辙了。
没办法不得不采用强制手段了。

1、shutdown abort
2、kill -9 oracle 进程 方法:ps -ef|grep ora_dbw0_$Oracle_SID   找到这个进程 直接kill 掉。

[oracle@zhanglin dblog]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Dec 31 20:22:58 2014

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

Connected.
SQL> shutdown abort
ORACLE instance shut down.
SQL>


后来startup了一次,可以正常起来,然后在shutdown immediate 正常关闭。谢天谢地!

2015年1月1号,元旦三天 加班中度过。。。祝所有的技术人员 新年快乐,事事顺利!


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30936525/viewspace-2016673/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2016-02-29

  • 博文量
    203
  • 访问量
    339134