Thursday, January 31, 2013

1 Use netca to configure Oracle Listener

netca (Network Configuration Assistant) is Oracle command line for configure the Oracle listener.
Enterprise Manager has dependence on the listener. If listener is not running, we can not login to the Enterprise manager as EM require connects to database to verify the password. If the listener is started after the EM started, we can login to the EM but the agent would fail connect to TNS. In this case, we need to bounce the EM.

Note: Listener name is not case sensitive. LISTENER_ORACLEDB is same as LISTENER_oracledb.

Use the netca GUI to create the listener


image
image
image
image
image
image
image
image
lsnrctl status

image
The listener is listen to the default port 1521. The oracle database would auto register to the listener ( PMON processes). 

Use responds file to create the listener

Prepare the responds file

The tip for the responds file is INSTALL_TYPE. If you want to have the custom listener name and port instead of default name <LISTENER> and port 1521. We need to set this property as “CUSTOM”

[GENERAL]
RESPONSEFILE_VERSION="11.2"
CREATE_TYPE="CUSTOM"
SHOW_GUI=false
LOG_FILE=""/u01/app/oracle/product/11.2.0/network/tools/log/netca.log""
[oracle.net.ca]
INSTALL_TYPE=""CUSTOM""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER_ORACLEDB1"}
LISTENER_PROTOCOLS={"TCP;7001"}
LISTENER_START=""LISTENER_ORACLEDB1""
INSTALLED_COMPONENTS={"server","client","net8","javavm"}

Execute the netca

$ORACLE_HOME/bin/netca –silent -responsefile=/local_dir/netca.rsp

image
image

Manually Create the listener

Manually create the listener.ora file and start the listener from command line.
LISTENER_ORACLEDB1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = panda1.localdomain)(PORT = 7001))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC7001))
    )
  )
 
ADR_BASE_LISTENER_ORACLEDB1 = /u01/app/oracle
 

lsnrctl stop LISTENER_ORACLEDB
lsnrctl status LISTENER_ORACLEDB


If listener dost not listen to the default port

In the example blow, my listener is set to listen port 7001 hence the database instance would not connect to the listener automatically.
image
The solution is to set the local listener ( LOCAL_LISTENER) parameter.

set local listener

localhost can refer to the local host or the host name on the host ( In this example, panda1 ) or the remote host where the listener is running.
alter system set LOCAL_LISTENER='(ADDRESS = (PROTOCOL=TCP)(HOST=localhost)(PORT=7001))' scope=both;

image
Alternately, we can put the host configuration in the tnsname.ora.
LISTENER_ORACLEDB1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 7003))
 

and change the LOCAL_LISTENER point to the LISTENER_ORACLEDB1
alter system set LOCAL_LISTENER='LISTENER_ORACLEDB1' scope=both;


We must create the entry in the tnsname.ora first otherwise we could get the error while trying to run the alter system command.
image

Reference

1 comments:

  1. Thankfully, we do not have to live in a less-connected world anymore due to social media sites like Facebook, Twitter, Google+, LinkedIn, and even picture-based sites like Instagram and Pinterest. Connecting and networking are easier than ever before. I'll go over a few of my favorites and how they can help you to expand your network tools and connect with new people.

    ReplyDelete

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates