Skip to main content

Posts

Showing posts from January, 2012

Write a Message to the Oracle Alert Log

This tip comes from Marco Gilbert, DBA at MRQ, in Ste-Foy, Quebec, Canada. If you want to write a message to the alert log, you can use the undocumented KSDWRT procedure of the DBMS_SYSTEM package. This procedure has two parameters, the first one must be "2" to write to the alert file, the second one is the message you want to write. Here is an example: execute sys.dbms_system.ksdwrt(2,to_char(sysdate)|| ' -- '); (1=Trace, 2=alert, 3=both).

Oracle listener startup failure

Problem: when trying to restart Oracle 11g listener, got below error: TNS-12560: TNS:protocol adapter error TNS-00507: Connection closed Linux Error: 29: Illegal seek checked sqlnet.ora, listener.ora and ORACLE_HOME etc. environment variables, no incorrect/abnormal settings found checked TCP/IP port usage by "lsof -i:1521" and "netstat -anp |grep 1521|grep LISTEN", didn't find any application listen on it. checked /etc/hosts, seems normal #more /etc/hosts 10.11.5.32 host.some.domain host ::1 localhost6.localdomain6 localhost6 #127.0.0.1 localhost.localdomain localhost <===== this is the root cause, but didn't think about it at first checked /etc/nsswitch.conf and /etc/resolv.conf, normal tried to start Oracle 10g listener on same machine, "lsnrctl start" finished without error, but listener was not running: TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: