搜尋此網誌

星期五, 5月 06, 2011

Startup Listener with password using Script

If the listener.ora set with password, you can't stop listener like "lsnrctl stop".

You will receive the error message like below :

[oracle@localhost ~]$ lsnrctl stop

LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 06-MAY-2011 07:48:15

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
TNS-01169: The listener has not recognized the password


I wrote a script to stop listener with password

======== Script Start Hear ===========
#!/usr/bash

export PATH
unset USERNAME
export ORACLE_HOME=/home/oracle/OraHome1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=ABC
export JRE_HOME=/usr/java/jre1.6.0_24

lsnrctl< Current Listener is LISTENER
LSNRCTL> The command completed successfully
LSNRCTL> Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
The command completed successfully

沒有留言: