一个再有经验的DBA,也需要熟悉熟悉当前的数据库环境才能动手。特别是11g之后,数据库有不少变化。
今天登录了一个新系统,是oracle 11.1.0.7的环境,想找listener.log看看,但是登录后,却发现传统路径下却找不到listener.log文件。
1 2 3 4 5 6 |
au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1>cd net* au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1/network>ls admin doc install jlib lib lib32 log mesg tools trace au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1/network>cd log au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1/network/log>ls au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1/network/log> |
用lsrctl status来看看日志放哪里了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1/network/log>lsnrctl status LSNRCTL for Solaris: Version 11.1.0.7.0 - Production on 28-JUN-2012 13:03:06 Copyright (c) 1991, 2008, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER_AU11QLG01TTELS2 Version TNSLSNR for Solaris: Version 11.1.0.7.0 - Production Start Date 16-JUN-2012 01:23:07 Uptime 12 days 11 hr. 39 min. 59 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /var/opt/oracle/listener.ora Listener Log File /opt/app/oracle/diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.117.184.85)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.117.184.82)(PORT=1521))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "SUCM01P.in.telstra.com.au" has 2 instance(s). Instance "SUCM01P1", status READY, has 1 handler(s) for this service... Instance "SUCM01P2", status READY, has 2 handler(s) for this service... Service "SUCM01P1.in.telstra.com.au" has 1 instance(s). Instance "SUCM01P2", status READY, has 2 handler(s) for this service... Service "SUCM01P2" has 1 instance(s). Instance "SUCM01P2", status UNKNOWN, has 1 handler(s) for this service... Service "SUCM01P2.in.telstra.com.au" has 1 instance(s). Instance "SUCM01P2", status READY, has 2 handler(s) for this service... Service "SUCM01PXDB.in.telstra.com.au" has 2 instance(s). Instance "SUCM01P1", status READY, has 1 handler(s) for this service... Instance "SUCM01P2", status READY, has 1 handler(s) for this service... Service "SUCM01P_XPT.in.telstra.com.au" has 2 instance(s). Instance "SUCM01P1", status READY, has 1 handler(s) for this service... Instance "SUCM01P2", status READY, has 2 handler(s) for this service... The command completed successfully au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1/network/log> au11qlg01ttels2:SUCM01P2:/opt/app/oracle/product/11.1.0/db_1/network/log> |
我们发现这却是一个xml文件。用more命令看了一下,大致能看明白,但是原来的listener.log文本文件去哪里了?
登录adrci看看:
1 2 3 4 5 6 7 8 |
au11qlg01ttels2:SUCM01P2:/opt/app/oracle>adrci ADRCI: Release 11.1.0.7.0 - Production on Thu Jun 28 13:25:11 2012 Copyright (c) 1982, 2007, Oracle. All rights reserved. ADR base = "/opt/app/oracle" adrci> |
注意我们这里的base不同于数据库的diagnostic_dest。
1 2 3 4 5 |
SQL> show parameter dia NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ diagnostic_dest string /opt/app/oracle/admin/SUCM01P |
我们看一下home:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
adrci> show home ADR Homes: diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2 diag/tnslsnr/au11qlg01ttels2/status adrci> adrci> show home ADR Homes: diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2 diag/tnslsnr/au11qlg01ttels2/status adrci> set home diag/tnslsnr/au11qlg01ttels2/status adrci> show tracefile diag/tnslsnr/au11qlg01ttels2/status/trace/status.log adrci> adrci> set home diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2 adrci> show tracefile diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2/trace/listener_au11qlg01ttels2.log adrci> au11qlg01ttels2:SUCM01P2:/opt/app/oracle/diag/tnslsnr/au11qlg01ttels2/status/trace>ls -l status.log -rw-r----- 1 oracle dba 512 Feb 11 10:26 status.log au11qlg01ttels2:SUCM01P2:/opt/app/oracle/diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2/trace>ls -l listener_au11qlg01ttels2.log -rw-r----- 1 oracle dba 1985339985 Jun 28 13:32 listener_au11qlg01ttels2.log au11qlg01ttels2:SUCM01P2:/opt/app/oracle/diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2/trace> |
在这里,结合日志的生成时间,我们找到了listener.log:/opt/app/oracle/diag/tnslsnr/au11qlg01ttels2/listener_au11qlg01ttels2/trace/listener_au11qlg01ttels2.log