ORA-01012

自上次的文件系统owner变成数字200,数据库启动不了的问题后,这两天还碰到类似的问题。

症状:以自己的ID试图连接数据库,出现如下错误:
SQL*Plus: Release 10.2.0.2.0 - Production on Mon Apr 19 22:20:37 2010
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Enter password:
ERROR:
ORA-12541: TNS:no listener

tnsping没问题,到server那端查一下listener的trace:

19-APR-2010 22:00:42 * (CONNECT_DATA=(SID=)(CID=(PROGRAM=sqlplus)(HOST=hostname)(USER=***))) * (ADDRESS=(PROTOCOL=tcp)(HOST=123.123.123.123
)(PORT=38565)) * establish * * 12518
TNS-12518: TNS:listener could not hand off client connection
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
IBM/AIX RISC System/6000 Error: 32: Broken pipe

这里来看,是通信上出了问题。ps查看一下进程,listener是在的,重新加载一下,错误依旧。试着在server那边直接连接上去:
$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Apr 19 22:27:32 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected.
SQL> select name from v$database;
select name from v$database
*
ERROR at line 1:
ORA-01012: not logged on

[@more@]

上面的错误就奇怪了,一开始显示connected,怎么后来显示没登陆上去,这样反复试了几次,还是一样的错误, ps查看一下所有的后台进程,也都在的。
$ ps -ef | grep -i cmn
oracle 1130568 1 0 Apr 14 - 0:09 ora_mman_
oracle 1134652 1 0 Apr 14 - 0:12 ora_mmon_
oracle 1138732 1 0 Apr 14 - 1:03 ora_pmon_
oracle 1142832 1 0 Apr 14 - 0:14 ora_dbw0_
oracle 1146930 1 0 Apr 14 - 0:09 ora_lgwr_
oracle 1151028 1 0 Apr 14 - 0:32 ora_ckpt_
oracle 1155126 1 0 Apr 14 - 0:08 ora_psp0_
oracle 1159222 1 0 Apr 14 - 0:02 ora_smon_
oracle 1163320 1 0 Apr 14 - 0:00 ora_reco_
oracle 1171516 1 0 Apr 14 - 0:08 ora_cjq0_
oracle 1175614 1 0 Apr 14 - 0:08 ora_mmnl_

从现象来看,登陆进sqlplus后,就不能接受何命令了。这情况下只能试着关了数据库,重新登陆sqlpus,这时的错误:
SQL> shutdown immediate;
ORA-24324: service handle not initialized
ORA-24323: value not allowed
ORA-27140: attach to post/wait facility failed
ORA-27300: OS system dependent operation:invalid_euid failed with status: 1
ORA-27301: OS failure message: Not owner
ORA-27302: failure occurred at: skgpwinit5
ORA-27303: additional information: startup euid = 200 (?), current euid = 222 (oracle)

这里的最后一行错误,给出了比较明显的错误:操作系统上的UID变了,只是当时没有留意,事后想想,这个提示是最有用的,但一直也没想到有人会去改用户的UID,只把错误“ORA-27140: attach to post/wait facility failed”认真的研究了, ORA-27140最有可能引起的是$ORACLE_HOME/bin/oracle的权限(6751)改了。

强行关数据库:
SQL> shutdown abort;
ORA-27120: unable to removed shared memory segment
IBM AIX RISC System/6000 Error: 1: Not owner
Additional information: 269366008
Additional information: 269342528

这里的错误提示就很明显了,不能释放共享内存段。ipcs查一下:
$ ipcs -a | grep -i dba
m 56623109 0xbebde68c --rw-rw---- oracle dba oracle dba 14 557850624 860330 700600 1:00:09 1:00:09 4:00:25
m 41943046 0x54a862f0 --rw-rw---- 200 dba 200 dba 0 775954432 1126490 1175648 23:56:51 23:56:51 4:31:53
m 6291463 0xd2d5bd68 --rw-rw---- oracle dba oracle dba 14 322969600 483556 700604 1:00:26 1:00:26 3:41:09
m 8 0x8ceaadd4 --rw-r----- oracle dba oracle dba 14 851456000 1208538 1323044 1:01:02 1:01:02 9:37:47
m 9 0x96391b4c --rw-r----- oracle dba oracle dba 14 549462016 1302774 1323038 1:00:10 1:00:10 9:38:22

这里有一行的owner/creator变成数字200,试着用ipcrm清除:
$ ipcrm -m 41943046
ipcrm: 0515-021 shmid(41943046): The user does not have the appropriate privileges to perform this operation.

这个时候只能叫OS组人介入,为什么会出不是oracle用户的共享内存段,反馈是,当时OS做certification时,建oracle用户用错了UID,最近把这UID从200改到了222,这就能解释,为什么ipcs里显示数字200,这也能说明为什么上次的文件系统的事了,当时的oracle用户UID=200,当把UID改成222,以前的文件系统的owner就变成200了。而uid=200在passwd是找不到对应的用户名,这时只能显示数字200了,但这里不能解释的是ps数据库后台进程时,输出的结果还是oracle,不是数字200.幸运的是,这是一台测试机器,要是生产库,这会是怎么样的后果?

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

转载于:http://blog.itpub.net/45188/viewspace-1033061/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值