iSelfSchooling.com  Since 1999     References  |  Search more  | Oracle Syntax  | Free Online Oracle Training

    Home      .Services     Login       Start Learning     Certification      .                 .Share your BELIEF(s)...

 

. Online Accounting        .Copyright & User Agreement   |
    .Vision      .Biography     .Acknowledgement

.Contact Us      .Comments/Suggestions       Email2aFriend    |

 

Online Oracle Training for beginners and advanced - The most comprehensive Oracle tutorial

The authors do not guarantee or take any responsibility for the accuracy, or completeness of the information.

DBAs - Fundamentals II

 

Lesson 01 | Lesson 02 | Lesson 03 | Lesson 04 | Lesson 05 | Lesson 06 | Lesson 07 | Lesson 08 | Lesson 09 | Lesson 10 | Lesson 11 | Lesson 12 | Lesson 13 | Lesson 14 | Lesson 15 | Lesson 16 | Lesson 17 | Lesson 18 | Lesson 19 | Lesson 20 | Lesson 21 | Lesson 22 | Lesson 23 | Lesson 24 | Lesson 25 | Lesson 26 | Lesson 27 | Lesson 28 | Lesson 29 |

 

Lesson 25

"The object of the superior man is truth." -Confucius

 

Server Side Configuration

 

You configure LISTENER in your Database Server to listen and establish connections for incoming client requests. You can have multiple listeners running on a database server. You should configure a listener with one or more protocol addresses that specifies its listening port numbers. A client must be configured with the same type of protocol addresses to converse with the listener. On the client side, the PMAN background process provides information to the listener about its instance. Its job is to make sure that if a user process got disconnected, clean the entire remaining task.

You connect to the Oracle database either through a dedicated server or shared server.

 

Configuring a Listener

The listener"s configuration file is stored in listener.ora, which is located in the default directory $ORACLE_HOME/network/admin on UNIX and %ORACLE_HOMEon Windows. If you are going to relocate the configuration file make sure to set the TNS_ADMIN environment variable.

 

An example of listener.ora:

LISTENER4MYDBS=

     (DESCRIPTION=

          (ADDRESS_LIST=

               (ADDRESS=(PROTOCOL=tcp) (HOST=mycomupter) (PORT=1521))

               (ADDRESS=(PROTOCOL=ipc) (KEY=extproc))

          )

     )

SID_LIST_LISTENER4MYDBS=

     (SID_LIST=

          (SID_DESC=

               (GLOBAL_DBNAME=mydbs.company)

               (ORACLE_HOME=/u01/app/oracle/product/9.2.0)

               (PROGRAM=extproc)

               SID_NAME=mydbs)

          )

     )

 

LISTENER4MYDBS is just a listener name and can be any name. The listening location area (ADDRESS=) specifies where a listener is listening for a connection.

For each address you may use a different protocol type such as TCP, NMP, IPC, SPX and etc. If you use TCP, you should specify the host name (or an IP address) and the port number to be used. If you use NMP (Named Pipes) for a network using Novel, you should specify your Machine Name and the Pipe Name. If you use IPC (Interprocess Communication), you should specific the library name that will be accessed on the same node. The IPC protocol will be used only when client and server run on the same machine or node. If you use SPX, the IPX/SPX Microsoft protocol, you should specify a service name. For other protocol, you may have to specify the relevant information for establishing the Oracle connectivity.

The resets of above parameter are very much self-explanatory.

 

Also, you can have the following control parameter settings:

ADMIN_RESTRICTIONS_listener4mydbs=TRUE

It will restrict any modification to the listener dynamically using the SET command.

 

PASSWARDS_listener4mydbs=(X6Z76H07Y34D)

It enforces to enter the password for stopping the listener.

 

LOG_DIRECTORY_listener4mydbs=$ORACLE_HOME/network/admin

It defines a log directory destination.

 

LOG_FILE_listener4mydbs=listener4mydbs.log

It defines a log file name.

 

LOGGING_listener4mydbs=ON

It enables or disables logging.

 

TRACE_DIRECTORY_listener4mydbs=$ORACLE_HOME/network/admin/trace

It defines a trace directory destination.

 

TRACE_FILE_listener4mydbs=listener4mydbs.trc

It defines a trace file name.

 

TRACE_LEVEL_listener4mydbs=(OFF|ADMIN|USER|SUPPORT)

It enable or disable (OFF) a trace for debugging purposes. You use the SUPPORT level only when requested by Oracle Support. The USER level provides user trace and the ADMIN level provides administration information.

 

Listener Control Commands

# lsnrctl command listener_name

General format.

 

# lsnrctl help

It will list lsnrctl commands.

 

# lsnrctl stop listener4mydbs

It stops the listener.

 

# lsnrctl start listener4mydbs

It starts listener.

 

# lsnrctl reload listener4mydbs

It reloads the modified listener file.

 

# lsnrctl status listener4mydbs

It displays the listener"s status.

 

# lsnrctl services

It displays the registered services.

 

# lsnrctl

It will enable listener utility.

LSNRCTL>

You can use listener utility to use the SHOW and SET commands. For example setting password.

LSNRCTL> SET PASSWORD

 

Configuring Service Registration

The SERVICE_NAMES and the INSTANCE_NAME parameter must be set in the database initialization parameter file (PFILE).

SERVICE_NAMES=mydbs.company

INSTANCE_NAME=mydbs

 

"When I hear somebody sigh, 'Life is hard,' I am always tempted to ask, 'Compared to what?'" -Sydney Harris

 

Questions:

Q: How do you configure a LISTENER in your database server?

Q: Can you have multiple listeners running on a database server?

Q: How do you configure a LISTENER with one or more protocol?

Q: Describe the PAMN background process jobs?

Q: Describe the following listener configuration file (listener.ora).

LISTENER4MYDBS=

     (DESCRIPTION=

          (ADDRESS_LIST=

               (ADDRESS=(PROTOCOL=tcp) (HOST=mycomupter) (PORT=1521))

               (ADDRESS=(PROTOCOL=ipc) (KEY=extproc))

          )

     )

SID_LIST_LISTENER4MYDBS=

     (SID_LIST=

          (SID_DESC=

               (GLOBAL_DBNAME=mydbs.company)

               (ORACLE_HOME=/u01/app/oracle/product/9.2.0)

               (PROGRAM=extproc)

               SID_NAME=mydbs)

          )

     )

Q: How can you assign a password to you listener?

Q: How do you turn on the trace utility on a listener on the user level?

Q: How do you start a listener?

Q: How do you stop a listener?

Q: What does the reload command do in the listener?