Practice: Listener Configuration

 

In this practice you will configure the listener using Oracle Net Manager and then view the results in the listener.ora file.

 

 

Assumptions

 

UNIX setup:

  • If Oracle9i client software is not available on your workstation, the listener.ora file must be edited by hand. Sample networking files can be found in your $ORACLE_HOME/network/admin/samples directory. Copy listener.ora from the samples directory to listener.ora in your $HOME/network/admin directory and edit by hand using vi.
  • $ cd $TNS_ADMIN
  • $ cp $ORACLE_HOME/network/admin/samples/listener.ora listener.ora
  •  

    NT setup:

    ·        If this is a single user machine (your personal desktop or laptop), you can go to %ORACLE_HOME%\network\admin and rename all files from .ora to .old to preserve them. Later when you have finished the practices, you can remove your newly created network files and rename the .old back to .ora to reset your environment.    

     

    Instructions

     

    1.      Create a listener called listener01 (or any name not currently being used) by using Oracle Net Manager. The listener must be configured for the server that contains your Oracle database. The listener must be configured for the TCP/IP protocol only and must listen for incoming connections on an unused port (ask your system administrator, or if on a single user machine try 8001.  If another process is using it, increment by 1 and try again).

     

    Note: If Oracle9i Net software is loaded on the local PC and the database is on a different server, the listener configuration file (listener.ora) will be created on the client PC using Oracle Net Manager and, in later steps, transferred via FTP or similar file transfer application on the server. 

     

    • If Oracle9i is available on the PC, go to the NT Start menu on the client PC, select Programs > Oracle - Oracle Home > Network Administration > Oracle Net Manager.
    • Click the Local icon in the Net Configuration tree then click the Listeners folder. Select Create from the Edit menu item, or click the + icon.
    • Enter a name for your listener (listener01) in the Choose Listener Name dialog box that appears and click OK. The name of the new listener will appear below the Listeners folder in the left-hand pane of Net Manager.
    • Click the new listener name and select Listening Locations from the drop-down menu on the right-hand pane in Net Manager (if not already selected).
    • Click the Add Address button. A tab for the address details of the listener will appear.
    • Select TCP as the protocol, if not already selected.
    • Enter the name of the server in the Host field, and the port number assigned for your listener in the Port field (the port number is provided by your system administrator). Leave TCP as the default value for the Protocol.
    • Select Database Services from the drop-down menu on the right side of the screen in Net Manager.
    • Click the Add Database button. A tab for the database appears, on behalf of which the listener will listen for incoming connections.

     

    • Enter a name for the global database in the Global Database Name field (the Global Database Name is typically <sid>.<db_domain>).
    • Enter the directory, defined as your $ORACLE_HOME on the server, in the Oracle Home Directory field (Issue the env command from the UNIX prompt to get the home directory or the set command in NT).
    • Enter your database system identifier (ORCL for example) in the SID field.
    • From the drop-down menu on the right side of the screen in Net Manager, select “General Parameters” and then choose the “Logging and Tracing” tab. Make sure logging is enabled and the log file to be used is $HOME/NETWORK/LOG/listener01.log.
    • Save your configuration by selecting “Save Network Configuration” from the File menu item in Net Manager.

     

    • Move the listener.ora file to the database server if necessary.

    (See NOTE in question 1).

     

     

    2.      View the contents of the listener.ora file to verify the configuration details.

     

    ·        $ cd $TNS_ADMIN

    ·        $ view listener.ora (you can use more or pg also or notepad in Windows)

     

     

    This completes this practice.

     

     

     

    ã Oracle Corporation, 2002

    Practice #<number>: <topic title>

    Practice: Control the listener using the Listener Control Utility (lsnrctl)

     

    In this practice you will use the listener control utility lsnrctl to start the listener, and set and show some of its attributes.

     

     

    Assumptions

     

    ·        If your database and listener are on a UNIX server, you must have permissions to execute the lsnrctl utility. If you do not have permissions see your system administrator.  

     

     

    Instructions

     

    1.      If you have created the listener.ora file on your computer, then use FTP (ASCII mode) to transfer it to your $TNS_ADMIN directory on the UNIX server.  When the listener.ora file is properly placed, start your listener by issuing lsnrctl start listener01 from your prompt.  If you encounter difficulties, use the lsnrctl command output and the listener log file to troubleshoot. 

     

    Lsnrctl start listener01 (substitute your listener name here)

     

     

    2.      To see a list of commands available in the listener control utility, go into lsnrctl and type help. This will show you the commands available to you in the listener control utility.

     

    $ lsnrctl

    LSNRCTL> help

     

     

    3.      While still in the listener control utility, issue the command status listener01 (substitute your listener name).  This will tell you information about your listener including for which database services it is listening.

     

    LSNRCTL> status listener01 (substitute your listener name here)

     

    This completes this practice.

     

     

     

    ã Oracle Corporation, 2002

    1