未完全关闭数据库导致ORA-01012: not logged的解决

首先使用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 esb/esb
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>

 

 

 

 

 

 

 

 

 

ORA-01012:not logged on的解决办法

 

conn / as sysdba 报错ORA-01012: not logged on

 

发生原因:关闭数据库是shutdown 后面没有接关闭参数中的任何一个。
 

 nomal          --->所有连接都断开时才能关闭;

 transactional  --->等待事务结束后,主动断开连接;

 

 immediate      --->主动断开事务和连接  www.2cto.com  

 abort          --->立刻关闭数据库,这个操作是危险的,不会同步数据,不触发检查点,回滚段直接清  空,相当于掉电,每次启动都要实例恢复。

 

所以,数据库关闭很慢,这时我一心急,就直接退出了sqlplus,造成oracle文件被lock,当我再次startup时,操作失败,因为文件依然被锁定状态。报错ORA-01012: not logged on。

 

后来重启服务,就可以用了,看了oracle的报错解释,更让我费解。虽然问题解决了,但是生产环境是不能随便down机的,所以,这个问题待续。。。

   www.2cto.com  

kill oracle 进程 或者关掉oracle

 

ps -ef|grep ora_dbw0_$ORACLE_SID

kill  -9 pid

 

重新启动oracle

sqlplus sys as sysdba

startup;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值