标签归档:ORA-01012

ORA-01012: not logged on

今天接到现场反馈,数据库出现ORA-01012: not logged on错误提示,这个问题上次也出现过一次,当时按照网上说的方法,直接重启数据库了,问题解决了,同时也导致因为数据库重启,现场破坏,而alert日志中无任何异常信息,所以不知从何处下手分析。这次我上数据库准备查看时,发现数据库已经正常,监控也显示正常,说明数据库已经恢复正常。从此我推理这个问题应该是外部因素导致,而不是数据库本身的bug,从而决定要找出该问题的原因来。有个重要的因素,该数据库是我几个月前因为undo损坏做过恢复的,查看相关参数,发现processes是默认值150,是不是该值导致的不敢肯定,因为一般process超了会报ORA-00020错误,而这次只有ORA-01012。但是心中还是没有底,总感觉这个的可能性最大,于是想通过试验来证实下自己的想法
1、数据库版本(10g结果相同)
SQL> select * from v$version where rownum=1;

BANNER
—————————————————————-
Oracle9i Enterprise Edition Release 9.2.0.4.0 – Production

2、创建pfile,修改processes,重启数据库,查看processes值
SQL> select name,value from v$parameter where name=’processes’;

NAME VALUE
——————– ——————–
processes 30

3、查看系统processes数量
SQL> select count(*) from v$process;

COUNT(*)
———-
13

4、添加数据库连接数(为了增加process数目)
[oracle@localhost ~]$ sqlplus chf/xifenfei

SQL*Plus: Release 9.2.0.4.0 – Production on Wed Jul 27 23:11:50 2011

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 – Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 – Production

SQL> !

5、重复3和4,发现当process数量为29时出现激动人心一幕
5.1)继续访问数据库
[oracle@localhost ~]$ sqlplus system/xifenfei

SQL*Plus: Release 9.2.0.4.0 – Production on Wed Jul 27 23:12:06 2011

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:
ORA-00020: maximum number of processes (%s) exceeded

Enter user-name:

5.2)使用其他用户访问
[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 – Production on Wed Jul 27 23:12:49 2011

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn / as sysdba
Connected to an idle instance.
SQL> select * from dual;
select * from dual
*
ERROR at line 1:
ORA-01012: not logged on

SQL> conn chf/xifenfei
ERROR:
ORA-00020: maximum number of processes (%s) exceeded

[oracle@localhost ~]$ sqlplus “/ as sysdba”

SQL*Plus: Release 9.2.0.4.0 – Production on Wed Jul 27 23:29:52 2011

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected.
SQL> select * from dual;
select * from dual
*
ERROR at line 1:
ORA-01012: not logged on
现象说明:
1)终于发现了ORA-01012错误,期待了很久。发现只有当sys登录系统,对数据库进行查询或者操作之时才会出现ORA-01012,其他用户只要一登录数据库就会提示ORA-00020错误。

2)当process达到数据库最大限时,sysdba登录系统是也显示不正常
2.1)当使用sqlplus “/ as sysdba”登录时,缺少:
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 – Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 – Production
2.2)当使用conn / as sysdba登录时,提示为:
Connected to an idle instance.

发表在 ORA-xxxxx | 标签为 | 2 条评论