Showing posts with label Listener. Show all posts
Showing posts with label Listener. Show all posts

Friday, March 2, 2012

ORACLE 11G LISTENER CONTROL UTILITY

Listener Control Utility Overview
The Listener Control utility enables you to administer listeners. You can use its commands to perform basic management functions on one or more listeners. Additionally, you can view and change parameter settings. The basic syntax of Listener Control utility commands is as follows:
lsnrctl command listener_name
where listener_name is the name of the listener to be administered. If no name is specified, then the default name, LISTENER, is assumed.
You can also issue Listener Control utility commands at the LSNRCTL> program prompt. To obtain the prompt, enter lsnrctl with no arguments at the operating system command line. When you run lsnrctl, the program is started. You can then enter the necessary commands from the program prompt. The basic syntax of issuing commands from LSNRCTL> program prompt is as follows:
#su - oracle
$. oraenv
$lsnrctl
LSNRCTL> command listener_name
Note:You can combine commands in a standard text file, and then run them as a sequence of commands . To execute in batch mode, use the format:
lsnrctl @file_name
You can use either REM or # to identify comments in the batch script; all other lines are considered commands . Any commands that would typically require confirmation do not require confirmation during batch execution. For a majority of commands, the Listener Control utility establishes an Oracle Net connection with the listener that is used to transmit the command. To initiate an Oracle Net connection to the listener, the Listener Control utility must obtain the protocol addresses for the named listener or a listener named LISTENER. This is done by resolving the listener name with one of the following mechanisms:
·         listener.ora file in the directory specified by the TNS_ADMIN environment variable
·         listener.ora file in the $ORACLE_HOME/network/admin directory on UNIX operating systems and the %ORACLE_HOME%\network\admin directory on Windows operating systems
·         Naming method, for example, a tnsnames.ora file
If the listener name is LISTENER and it cannot be resolved, a protocol address of TCP/IP, port 1521 is assumed.



SET and SHOW Commands of the Listener Control Utility
You can use the SET command to alter parameter values for a specified listener. You set the name of the listener you want to administer with the SET CURRENT_LISTENER command. Parameter values remain in effect until the listener is shut down. If you want these settings to persist, use the SAVE_CONFIG command to save changes to the listener.ora. You can use the SHOW command to display the current value of a configuration setting.
 Distributed Operations
The Listener Control utility can perform operations on a local or a remote listener. To set up a computer to remotely administer a listener:
·         Ensure that the Listener Control utility (lsnrctl) executable is installed.
·         Ensure that the name of the listener you want to administer can be resolved through a listener.ora file or a naming method.
All commands except START can be issued when a listener is administered remotely. The Listener Control utility can only start the listener on the same computer from where the utility is running. When issuing commands, specify the listener name as an argument. For example:
LSNRCTL> SERVICES lsnr
If the name is omitted, then listener name set with the SET CURRENT_LISTENER command is used, or the default name, LISTENER is assumed.
Oracle Net Listener Security
Local listener administration is secure through local operating system authentication, which restricts listener administration to the user who started the listener or to the superuser. By default, no other user can administer the listener. However, you can optionally configure a password. If the listener control client is installed locally and a password is configured, a check for password authentication is done. If this check fails, local operating system administration authentication is attempted.
In contrast, you must configure a password for remote listener administration, that is, when the listener control utility is installed on a remote computer. In this case, local operating system authentication is not used, and the user executing the listener control utility on the remote computer does not have to be a superuser or the same user who started the listener process.
Use the Listener Control utility's CHANGE_PASSWORD command or Oracle Net Manager to set or modify an encrypted password in the PASSWORDS_listener_name parameter in the listener.ora file. If the PASSWORDS_listener_name parameter is set to an unencrypted password, you must manually remove it from the listener.ora file prior to modifying it. If the unencrypted password is not removed, you will be unable to successfully set an encrypted password.
If the PASSWORDS_listener_name parameter is set in the listener.ora file or the CHANGE_PASSWORD command has been used to create a new, encrypted password, then the Listener Control utility will require a SET PASSWORD command prior to any protected command, such as STOP.
Note:  If you are administering the listener remotely over an insecure network and require maximum security, configure the listener with a secure protocol address that uses the TCP/IP with SSL protocol. If the listener has multiple protocol addresses, ensure that the TCP/IP with SSL protocol address is listed first in the listener.ora file.
Listener Control Utility Commands
CHANGE_PASSWORD: Use the CHANGE_PASSWORD command to establish an encrypted password or change an encrypted password set with the PASSWORDS_listener_name parameter in the listener.ora file. If a password is set, then issue then issue the SET PASSWORD command prior to this command.
lsnrctl CHANGE_PASSWORD [listener_name]
LSNRCTL> SET PASSWORD
Password: takd01
The command completed successfully
LSNRCTL> CHANGE_PASSWORD
Old password: takd01
New password: smd01
Reenter new password: smd01
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tpc)(HOST=sales-server)(PORT=1521)))
Password changed for LISTENER
The command completed successfully
LSNRCTL> SAVE_CONFIG
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
Saved LISTENER configuration parameters.
Listener Parameter File   /oracle/network/admin/listener.ora
Old Parameter File   /oracle/network/admin/listener.bak
The command completed successfully

EXIT: Use the EXIT command to exit from the Listener Control utility.  If a password is set, then the SET PASSWORD command does not need to be issued prior to this command.
LSNRCTL> EXIT

HELP: Use the command HELP to provide a list of all the Listener Control utility commands or provide syntax help for a particular Listener Control utility command.If a password is set, then the SET PASSWORD command does not need to be issued prior to this command.
lsnrctl HELP command
LSNRCTL> HELP
The following operations are available
An asterisk (*) denotes a modifier or extended command:
change_password,exit ,quit,reload ,services,set* ,show*,spawn , start, status ,stop ,trace , version

QUIT:  Use the QUIT command to exit the Listener Control utility and return to the operating system prompt.  If a password is set, then the SET PASSWORD command does not need to be issued prior to this command. LSNRCTL> QUIT
 RELOAD: Use the RELOAD command to reread the listener.ora file. This command enables you to add or change statically configured services without actually stopping the listener. In addition, the database services, instances, service handlers, and listening endpoints that were dynamically registered with the listener will be unregistered and subsequently registered again.
lsnrctl RELOAD listener_name
LSNRCTL> RELOAD
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
The command completed successfully

SAVE_CONFIG: Use the SAVE_CONFIG command to compare the current configuration state of the listener, including trace level, trace file, trace directory, and logging to the listener.ora file. Any changes are stored in listener.ora, preserving formatting, comments, and case as much as possible. Prior to modification of the listener.ora file, a backup of the file, called listener.bak, is created.
lsnrctl SAVE_CONFIG listener_name
LSNRCTL> SAVE_CONFIG listener
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
Saved LISTENER configuration parameters.
Listener Parameter File   /oracle/network/admin/listener.ora
Old Parameter File   /oracle/network/admin/listener.bak
The command completed successfully

SERVICES: Use the SERVICES command to obtain detailed information about the database services, instances, and service handlers (dispatchers and dedicated servers) to which the listener forwards client connection requests.
lsnrctl SERVICES listener_name

SET: Use the SET command to alter the parameter values for the listener. Parameter values changes remain in effect until the listener is shut down. To make the changes permanent, use the SAVE_CONFIG command to save changes to the listener.ora file.
lsnrctl SET parameter
If you are using the SET commands to alter the configuration of a listener other than the default LISTENER listener, use the SET CURRENT_LISTENER command to set the name of the listener you want to administer.
LSNRCTL> SET
The following operations are available with set.
An asterick (*) denotes a modifier or extended command.
current_listener , displaymode,inbound_connect_timeout,log_file,log_directory
log_status,password ,raw_mode,save_config_on_stop ,startup_waittime ,trc_file
trc_directory, trc_level

SET CURRENT_LISTENER
Use the SET CURRENT_LISTENER command to set the name of the listener to administer. Subsequent commands that would normally require listener_name can be issued without it.
LSNRCTL> SET CURRENT_LISTENER listener_name

SET DISPLAYMODE
Use the SET DISPLAYMODE command to change the format and level of detail for the SERVICES and STATUS commands.
LSNRCTL> SET DISPLAYMODE {compat | normal | verbose | raw}
compat: Specify to display output that is compatible with older versions of the listener.
normal: Specify to display output in a formatted and descriptive output. Oracle recommends this mode.
verbose: Specify to display all data received from the listener in a formatted and descriptive output.
raw: Specify to display all data received from the listener without any formatting. This output should be used only if recommended by Oracle Support Services.


SET INBOUND_CONNECT_TIMEOUT
Use the SET INBUND_CONNECT_TIMEOUT command to specify the time, in seconds, for the client to complete its connect request to the listener after the network connection had been established. If the listener does not receive the client request in the time specified, then it terminates the connection. In addition, the listener logs the IP address of the client and an ORA-12525:TNS: listener has not received client's request in time allowed error message to the listener.log file.
LSNRCTL> SET INBOUND_CONNECT_TIMEOUT time

SET LOG_DIRECTORY
Use the command SET LOG_DIRECTORY to set destination directory where the listener log file is written. By default, the log file is written to the $ORACLE_HOME/network/log directory on UNIX operating systems and the %ORACLE_HOME%\network\log directory on Windows.
lsnrctl SET LOG_DIRECTORY directory

SET LOG_FILE
Use the command SET LOG_FILE to set the name for the listener log file. By default, the log file name is listener.log.
lsnrctl SET LOG_FILE file_name

SET LOG_STATUS
Use the command SET LOG_STATUS to turn listener logging on or off.
lsnrctl SET LOG_STATUS {on | off}

SET PASSWORD
Use the command SET PASSWORD prior to privileged Listener Control utility commands, such as SAVE_CONFIG and STOP. The password entered should match the one established for the PASSWORDS_listener_name parameter in the listener.ora file or set by the CHANGE_PASSWORD command.
LSNRCTL> SET PASSWORD
Password: password


 SET SAVE_CONFIG_ON_STOP
Use the command SET SAVE_CONFIG_ON_STOP to specify whether or not changes made to the parameter values for the listener by the SET commands are to be saved to the listener.ora file at the time the listener is stopped with the STOP command. When changes are saved, the Listener Control utility tries to preserve formatting, comments, and letter case. Prior to modification of the listener.ora file, a back up of the file, called listener.bak, is created. To have all parameters saved right away, use the SAVE_CONFIG command.
lsnrctl SET SAVE_CONFIG_ON_STOP  {on | off}

 SET STARTUP_WAITTIME
Use the command SET STARTUP_WAITTIME to specify the amount of time for the listener to wait before responding to a START command.
lsnrctl SET STARTUP_WAITTIME time

SET TRC_DIRECTORY
Use the command SET TRC_DIRECTORY to set the destination directory where the listener trace files are written. By default, the trace file are written to the $ORACLE_HOME/network/trace directory on UNIX operating systems and the %ORACLE_HOME%\network\trace directory on Windows.
lsnrctl SET TRC_DIRECTORY directory

SET TRC_FILE
Use the command SET TRC_FILE to set the name of the listener trace file. By default, the trace file name is listener.trc.
lsnrctl SET TRC_FILE file_name

SET TRC_LEVEL
Use the command SET TRC_LEVEL to set a specific level of tracing for the listener.
lsnrctl SET TRC_LEVEL level
level: Specify one of the following trace levels:
  • off for no trace output
  • user for user trace information
  • admin for administration trace information
  • support for Oracle Support Services trace information
SHOW
Use the command SHOW to view the current parameter values for the listener. All of the SET parameters, except SET PASSWORD, have equivalent SHOW parameters.
lsnrctl SHOW parameter
 SPAWN
Use the SPAWN command to start a program stored on the computer on which the listener is running, and which is listed with an alias in the listener.ora file.
lsnrctl SPAWN listener_name alias (arguments='arg1,arg2,...')
listener_name: Specify the listener name, if the default name of LISTENER is not used.
alias: The alias of the program to be spawned off is specified by a listener.ora file entry, similar to the following:
alias = (PROGRAM=(NAME=)(ARGS=)(ENVS=))
nstest = (PROGRAM=(NAME=nstest)(ARGS=test1)(ENVS='ORACLE_HOME=/usr/oracle'))
START
Use the command START to start the named listener.
lsnrctl START listener_name
STATUS
Use the command STATUS to display basic status information about a listener, including a summary of listener configuration settings, listening protocol addresses, and a summary of services registered with the listener.
lsnrctl STATUS listener_name
STOP
Use the command STOP to stop the named listener.
lsnrctl STOP listener_name

TRACE
Use the command TRACE to turn on tracing for the listener.
lsnrctl trace level listener_name
level: Specify one of the following trace levels:
  • off for no trace output
  • user for user trace information
  • admin for administration trace information
  • support for Oracle Support Services trace information
VERSION
Use the command VERSION to display the current version of Listener Control utility.
lsnrctl VERSION listener_name

Thursday, March 1, 2012

Configuration of LISTENERS & STATUS

Hi Guys,

This article will explain how to configure the listeners and tnsnames as well as how to check the service status. 

Basically listeners registration will happen in two ways.
1. Dynamic listeners
2.Static listeners

While installing the oracle database software  if you choose database creation as a option at that time database will create a default listener, its name is LISTENER and that is dynamic listener. After that when your creating extra listeners all those will be part of static listeners.

The major difference between dynamic listener and static listener:
Whenever we are bringing up the database , the listener automatically bringup its services also. But in static listener we need to manually start the listeners and need to check the its status also.

From oracle 11g Release 2 onwards, oracle given a option that we can create dynamic  listeners which is created for user requirement.


Basically using netca command we can create listeners and tnsnames .  In unix flavour or windows flavour netca command is available in $ORACLE_HOME/bin directory.


PMON will search for tnsnames.ora in the following order:
  • $HOME/.tnsnames.ora
  • $TNS_ADMIN/tnsnames.ora
  • /var/opt/oracle/tnsnames.ora or /etc/tnsnames.ora (depending on platform)
  • $ORACLE_HOME/network/admin/tnsnames.ora


How to create listeners using Putty or SILENT MODE

Step1:  Copy the netca response file[file name is netca_typ.rsp] to some other location.

Login through putty,
copy the file from $ORACLE_HOME/network/install
#su - oracle
$. oraenv
$cd $ORACLE_HOME/network/install
$pwd
/u01/app/oracle/product/11.2.0.3/server/network/install
$ cp netca_typ.rsp /u01/app/oracle

Step2 :  Modify the response file
$cd /u01/app/oracle
$vi netca_typ.rsp

Ex: Below is the file content
[GENERAL]
RESPONSEFILE_VERSION="11.2"
CREATE_TYPE="CUSTOM"
[Session]
TOPLEVEL_COMPONENT={"oracle.net.ca","11.2"}
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""custom""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER_DB11G_1590"}
LISTENER_PROTOCOLS={"TCP;1590"}
LISTENER_START=""LISTENER_DB11G_1590""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}


Based on your requirement change LISTENER_NAMES, LISTENER_PROTOCOLS's port number, LISTENER_START values and save it.


Step 3: Configure the listener
Got to $ORACLE_HOME/bin
$cd $ORACLE_HOME/bin

[oracle@inatechsrv bin]$ ./netca  /silent  /responsefile  /mnt/netca_typ.rsp
Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /mnt/netca_typ.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Configuring Listener:LISTENER_DB11G_1590
Listener configuration complete.
Oracle Net Listener Startup:
    Running Listener Control:
      /u01/app/oracle/product/11.2.0.3/server/bin/lsnrctl start LISTENER_DB11G_1590
    Listener Control complete.
    Listener started successfully.
Profile configuration complete.
Oracle Net Services configuration successful. The exit code is 0

[oracle@inatechsrv bin]$ lsnrctl status LISTENER_DB11G_1590
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-MAR-2012 13:10:38
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=inatechsrv.blr.com)(PORT=1590)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_DB11G_1590
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                01-MAR-2012 13:10:24
Uptime                    0 days 0 hr. 0 min. 15 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.3/server/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/inatechsrv/listener_db11g_1590/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=inatechsrv.blr.com)(PORT=1590)))
The listener supports no services
Now listener is create but still its showing NO SUPPORT SERVICEs it means this listener will not accept the new connections.  Now You change as  either static listener or dynamic listener to accept the new connections .

STEP4:

--------------------------------------------
Case 1: STATIC LISTENER

Step1:
If you want static listener , go to listener.ora check current listener entry ,it should be similar to below entry.

Note:  In Oracle 11g Release 2 , by default it will show dynamic listener format.

If you want to enable as static listener , change your LISTENER as similiar as below.  May be some entries will not be there just add it.

Ex:
LISTENER_DB11G_1590=
  (DESCRIPTION=
    (ADDRESS_LIST=
  (ADDRESS=(PROTOCOL=tcp)(HOST=inatechsrv.blr.com)(PORT=1590))))
SID_LIST_LISTENER_DB11G_1590=
  (SID_LIST=
    (SID_DESC=
      (SID_NAME=DB11G)
      (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/server)
      (PROGRAM=extproc)))
ADR_BASE_LISTENER_DB11G_1590 = /u01/app/oracle

Step2:  Check the listener services
$lsnrctl status LISTENER_DB_1590
it will show

[oracle@inatechsrv admin]$ lsnrctl status LISTENER_DB11G_1590
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-MAR-2012 13:36:43
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=inatechsrv.blr..com)(PORT=1590)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_DB11G_1590
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                22-FEB-2012 11:15:34
Uptime                    8 days 2 hr. 21 min. 9 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.3/server/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/inatechsrv/listener_db11g_1580/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=inatechsrv.blr.com)(PORT=1590)))
Services Summary...
Service "DB11G.amk.com" has 1 instance(s).
  Instance "DB11G", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@inatechsrv admin]$

Now listener is fine, it will accept the incoming connection.  Note: UNKNOWN means its static listener

Case 2: DYNAMIC LISTENER
 Step1:
By default in oracle 11g release 2 onwards  If you are creating any listeners, we will get dynamic listener configuration format.

It should be similar to

ADR_BASE_LISTENER_DB11G_1580 = /u01/app/oracle
LISTENER_DB11G_1590 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = inatechsrv.blr.com)(PORT = 1590)) )  )

 Step 2:    Check in tnsnames.ora file whether below entry is there or not.

If not just add similar to below

 LISTENER_DB11G_1590 =(ADDRESS = (PROTOCOL = TCP)(HOST = inatechsrv.blr.com)(PORT = 1590))

Step3:  Add the listener entry into  Initialization parameter file .
If you want dynamic listener , we need to set LOCAL_LISTENER parameter

Note: If database uses spfile then

$sqlplus '/as sysdba'
SQL>alter system set local_listener=LISTENER_DB11G_1590 scope=spfile;
SQL>shut immediate
SQL>startup

Note: If you want you can set multiple listeners as a dynamic listeners
SQL>alter system set local_listener=LISTENER_DB11G_1590,LISTENER_DB11G_1600 scope=spfile;


When database is bringup pmon will check these listeners entry is available or not in tnsnames.ora . If not then database will not UP. I hope now you understand while listener name entry should present in TNSNAMES.ORA file.

If database using pfile, just open the pfile and add the entry, save it. Rebounce the database.

step4: Check the listener status
[oracle@inatechsrv admin]$ lsnrctl status LISTENER_DB11G_1590
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-MAR-2012 13:52:15
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=inatechsrv.blr.com)(PORT=1590)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_DB11G_1590
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                22-FEB-2012 11:15:34
Uptime                    8 days 2 hr. 36 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.3/server/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/inatechsrv/listener_db11g_1590/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=inatechsrv.blr.com)(PORT=1590)))
Services Summary...
Service "DB11G.com" has 1 instance(s).
  Instance "DB11G", status READY, has 1 handler(s) for this service...
The command completed successfully
Note: Status READY means its dynamic listener.


HOWEVER , For same database we can create multiple listeners, we can configure some listeners as dynamic and some listeners as static.
----------------------------------------------------------

STEP5: Configure the tnsname entry

When you create listeners automatically tnsnames. ora file also creating.
Tnsnames entry required if you want to access the database remotely otherwise no need to worry for this step.

As per oracle 11g Release 2
tnsname.ora entry should be

DB11G =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = inatechsrv.blr.com)(PORT = 1590))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = DB11G.amk.com)
    )
  )

This service name should be equavalent to database service name.
To find database service name
SQL>show parameter services_names;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      DB11G.amk.com
Note: If these two things not matches means your connection will not establish.

If you have multiple listeners then net service would be
ex:
DB11G =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = inatechsrv.blr.com)(PORT = 1590))
     (ADDRESS = (PROTOCOL = TCP)(HOST = inatechsrv.blr.com)(PORT = 1580))
     )
    (CONNECT_DATA =
      (SERVICE_NAME = DB11G.amk.com)
    )
  )
As per above example same database using two listeners and two ports, it can either static or dynamic or both.


STEP6:  Check the listener services
[oracle@inatechsrv admin]$ lsnrctl service LISTENER_DB11G_1590
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-MAR-2012 14:47:14
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=inatechsrv.blr.com)(PORT=1590)))
Services Summary...
Service "DB11G.amk.com" has 1 instance(s).
  Instance "DB11G", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
The command completed successfully

Here ESTABLISHED IS 0 means no connections till now.

[oracle@inatechsrv admin]$ sqlplus sys@DB11G
SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 1 14:47:22 2012
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> !

[oracle@inatechsrv admin]$ lsnrctl service LISTENER_DB11G_1590
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-MAR-2012 14:47:39
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=inatechsrv.blr.com)(PORT=1590)))
Services Summary...
Service "DB11G.amk.com" has 1 instance(s).
  Instance "DB11G", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:1 refused:0 state:ready
         LOCAL SERVER
The command completed successfully
[oracle@inatechsrv admin]$

Here established is 1 means one connection is accepted.  If still shows its zero means some where you missed one step.

Now listener is configured and its accepting new connections from remotely also.


Using the TNSPING Utility to Test Connectivity from the Client

The TNSPING utility determines whether the listener for a service on an Oracle Net network can be reached successfully.

[oracle@inatechsrv admin]$ tnsping DB11G
TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 01-MAR-2012 15:04:07
Copyright (c) 1997, 2011, Oracle.  All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0.3/server/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = inatechsrv.blr.com)(PORT = 1590))) (CONNECT_DATA = (SERVICE_NAME = DB11G.amk.com)))
OK (0 msec)
You have new mail in /var/spool/mail/oracle
[oracle@inatechsrv admin]$

Note: OK means its able to reach within 0 msecs. We can accept upto 20msec. For above 20msecs, we say its connectivity issue it can network or database performance issue.

Using the TRCROUTE Utility to Test Connectivity from the Client

The Trace Route Utility (TRCROUTE), in Linux and UNIX environments, enables administrators to discover the path or route a connection is taking from a client to a server. If TRCROUTE encounters a problem, then it returns an error stack to the client .

[oracle@inatechsrv admin]$ trcroute DB11G
Trace Route Utility for Linux: Version 11.2.0.3.0 - Production on 01-MAR-2012 15:07:13
Copyright (c) 1995, 2011, Oracle.  All rights reserved.
Route of TrcRoute:
------------------

Node: Client            Time and address of entry into node:
-------------------------------------------------------------
01-MAR-2012 15:07:13 ADDRESS= PROTOCOL=TCP  HOST=inatechsrv.blr.com  PORT=1590

Node: Server            Time and address of entry into node:
-------------------------------------------------------------
01-MAR-2012 15:07:13




SOME ISSUES

1.  SQL> startup nomount
Issue:
ORA-01078: failure in processing system parameters
ORA-00119: invalid specification for system parameter LOCAL_LISTENER

Solution:  Local_listener parameter is not setted in parameter file.

2.
Issue:
 SQL>STARTUP;ORA-00119: invalid specification for system parameter LOCAL_LISTENERORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521))
Cause: The listener address specification is not valid.
Action: Make sure that all fields in the listener address (protocol, port, host, key, ...) are correct.


3.
Issue: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor.

Solution: Service  names not matching.

4.
Issue: The listener support no services.
Solution: PMON not yet registered. Local_listener parameter is not matching with its listener.



Let us know if any doubt on this document. Please contact me murali9231@gmail.com





ORACLE 11G LISTENER's NET SERVICE CONCEPTS

ORACLE  NET SERVICES
Oracle Net, a component of Oracle Net Services, enables a network session from a client application to an Oracle Database server. When a network session is established, Oracle Net acts as the data courier for both the client application and the database.
Oracle Net is a software component that resides on both the client and the database server. Oracle Net is layered on top of network Oracle protocol support, rules that determine how applications access the network and how data is subdivided into packets for transmission across the network.
Oracle Net has two software components:
·         Oracle Net Foundation Layer
·         Oracle Protocol Support

Oracle Net Foundation Layer

On the client side, applications communicate with Oracle Net foundation layer to establish and maintain connections.

A network protocol sends client request information to an Oracle protocol support layer, which then sends information to the Oracle Net foundation layer. The Oracle Net foundation layer then communicates with the Oracle Database server to process the client request.

Oracle Protocol Support

The Oracle Net foundation layer uses Oracle protocol support to communicate with the following industry-standard network protocols:
·         TCP/IP (version 4 and version 6)
·         TCP/IP with SSL
·         Named Pipes
·         SDP
One of the most common connect identifiers is a net service name, a simple name for a service. The following CONNECT command uses a connect string that uses net service name sales as the connect identifier:
SQL> CONNECT hr@DB11G
Enter password: password
When net service name DB11G is used, connection processing takes place by first mapping DB11G to the connect descriptor. This mapped information is accessed by naming methods. The following naming methods are available:
·     Local naming
·     Directory naming
·     Easy Connect naming
·     External naming

Using localized management, network address information is stored in tnsnames.ora files on each computer in the network. Using centralized management, network address information is stored in centralized directory server.
OSI Communication Layers

Configuring Service Registration

Service registration allows processes, such as an Oracle database, to identify their available services to the listener, which then acts as a port mapper for those services. The listener uses the dynamic service information about the database and instance received through service registration before using statically configured information in the listener.ora file.
Dynamic service registration is configured in the database initialization file. It does not require any configuration in the listener.ora file. However, listener configuration must be set to listen on the ports named in the database initialization file, and must not have parameters set that prevent automatic registration, such as COST parameters
Setting Initialization Parameters for Service Registration
To ensure service registration works properly, the initialization parameter file should contain the following parameters:
·     SERVICE_NAMES for the database service name
·     INSTANCE_NAME for the instance name
·     LOCAL_LISTENER for the local listener
·         REMOTE_LISTENER for the remote listener
Registering Information with a Local Listener
·         By default, the PMON process registers service information with its local listener on the default local address of TCP/IP, port 1521. If the listener configuration is synchronized with the database configuration, then PMON can register service information with a nondefault local listener or a remote listener on another node. Synchronization occurs when the protocol address of the listener is specified in the listener.ora file and the location of the listener is specified in the initialization parameter file.
·         To have PMON register with a local listener that does not use TCP/IP, port 1521, configure the LOCAL_LISTENER parameter in the initialization parameter file to locate the local listener.
ALTER SYSTEM SET LOCAL LISTENER=["]listener_address["][,...];

In the preceding command, listener_address is resolved to the listener protocol addresses through a naming method, such as a tnsnames.ora file on the database server.
Monitoring Services of a Listener
The SERVICES command of the Listener Control utility provides detailed information about the services and instances registered with a listener and the service handlers allocated to each instance. To show information about the services and instances from the command line, enter:
lsnrctl SERVICES [listener_name]