合 glogin.sql配置不当引起sqlplus hang的假象分析
Tags: Oracle
不久前遇到的一个问题,"故障"现象如下:
A主机上跑了两个单实例的数据库testa和testb,对testa实例进行例行重启时先shutdown immediate,然后再通过sqlplus '/as sysdba'连进去尝试重启时发现,sqlplus Hang住不动了
sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.3.0 Production on Sat Feb 28 16:53:32 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance. <====停在这里不动了
此时使用sqlplus '/as sysdba'连接另一个实例testb是OK的,由于是测试环境于是将testb实例也shutdown immediate,准备重启主机,重启之前对于已经关闭的testb实例用sqlplus '/as sysdba'也无法连上去,现象同testa。主机重启势在必行了,但主机重启后现象依旧,两个实例都无法连接。使用"truss -dfaie -o /tmp/sched_trace.out.02271 sqlplus '/as sysdba'"命令对sqlplus '/as sysdba'的过程进行了跟踪,直奔sched_trace.out.02271文件结尾处发现了以下内容
2949918: 15664107: 0.8794: kopen("/oracle/app/oracle/product/11.2.0/db_1/rdbms/mesg/oraus.msb", O_RDONLY) = 8
2425346: 14746339: 0.8891: kopen("/oracle/app/oracle/product/11.2.0/db_1/rdbms/mesg/oraus.msb", O_RDONLY) = 6
2949918: 15664107: 0.8915: kopen("/oracle/app/oracle/product/11.2.0/db_1/rdbms/mesg/oraus.msb", O_RDONLY) = 8
2949918: 15664107: 0.8960: statx("/oracle/app/oracle/product/11.2.0/db_1/sqlplus/admin/glogin.sql", 0x0FFFFFFFFFFFDA40, 176, 010) = 0
2949918: 15664107: 0.8963: statfs("/oracle/app/oracle/product/11.2.0/db_1/sqlplus/admin/glogin.sql", 0x0FFFFFFFFFFFD620) = 0
2949918: 15664107: 0.8979: kopen("/oracle/app/oracle/product/11.2.0/db_1/sqlplus/admin/glogin.sql", O_RDONLY|O_LARGEFILE) = 8
2425346: 14746339: 0.9041: kopen("/oracle/app/oracle/product/11.2.0/db_1/rdbms/mesg/oraus.msb", O_RDONLY) = 6
2949918: 15664107: 0.9065: kopen("/oracle/app/oracle/product/11.2.0/db_1/rdbms/mesg/oraus.msb", O_RDONLY) = 11
2949918: 15664107: 0.9086: kopen("/oracle/app/oracle/product/11.2.0/db_1/rdbms/mesg/oraus.msb", O_RDONLY) = 11
2425346: 14746339: 906.0540: kopen("/oracle/app/oracle/product/11.2.0/db_1/rdbms/mesg/diaus.msb", O_RDONLY) = 5
2425346: 14746339: 906.0565: statx("/oracle/app/oracle", 0x0FFFFFFFFFFFDAF0, 176, 0) = 0