www.oraclebd.com Forum Index www.oraclebd.com
Open Oracle discussion Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Oracle Listener

 
Post new topic   Reply to topic    www.oraclebd.com Forum Index -> Technical Docs
View previous topic :: View next topic  
Author Message
Nayan



Joined: 30 Sep 2007
Posts: 31
Location: BANGLADESH

PostPosted: Thu Jun 26, 2008 11:52 am    Post subject: Oracle Listener Reply with quote

Listener basic and advance configuration.
By Liakat hossain (Nayan)
MCP,OCAAD9i, OCA10g AS ,OCPDBA8i,9i,10g,11g.
Mail-dba_nayan1@yahoo.com
nayan@oraclebd.com
Liakat.hossain@hotmail.com
Cell:+880-181961311.


listener ….

What is listener..
Oracle listener is main oracle server side networking component that listen for incoming connection request on behalf of a database.


[color=cyan]Characteristics of listener….

1. A listener process can listen for more than one database.

2. Muliple listener can listen on behalf of single database to perform load Balancing.

3. The listener can listen with multiple protocols
.
4. The default name of oracle listener in oracle net is LISTENER.

5. There is only one listener,ora file configure per database.

6. There may be numerous listeners on server.

Basic listener configuration……

Go to-- configuration and migration tools—under oracle home –open net manager.

Than click local you see following…

ICON
PROFILE
SERVICE NAMING
LISTENER

Now click the listener folder
Click the plus sign icon or select create from edit Manu.
Listener name dialog box appears choose the listener name.
Select the listing location from drop down list box.
Choose protocol, host name, port.
Choose database service name from dropdown list box at the top right of the screen.
Choose the global database name, home directory, Sid.
Save your setting file –save network configuration.


Sample listener.ora

# listener.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.

#--------------------------------------------

#----ADDED BY TNSLSNR 28-FEB-2007 19:18:51---

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = alin)
(ORACLE_HOME = f:\oracle)
(SID_NAME = orcl)
)
)

LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = alin)(PORT = 1521))
)


#----ADDED BY TNSLSNR 05-MAR-2007 01:23:15---
LOGGING_LISTENER = ON
#--------------------------------------------

#----ADDED BY TNSLSNR 05-MAR-2007 13:11:12---
PASSWORDS_LISTENER = 5DF0A4484662467F
#--------------------------------------------


Static service registration
When the oracle software is installed the listener.ora file configure following default configuration.

Listener name -------Listener
Port -------1521
Protocol -------Tcp/ip
Sid name -------default instance name
Host name -------default host name.






Managing the listener using LSNRCTL

The lsnrctl utility manages the Oracle listener processes. The lsnrctl command can be executed without parameters, in which the lsnrctl shell will be invoked, or it can execute commands directly when specified on the command line.


TO START LISTENER defaut listener(port 1521).

Lsnrctl>start

To start another listener.

Lsnrctl>start <<listener name>>

TO stop LISTENER defaut listener(port 1521).

Lsnrctl>stop

To stop another listener.

Lsnrctl>stop <<listener name>>


To refresh listener with current change.

Lsnrctl>reload.

LSNRCTL>exit

Use the EXIT command to exit from the Listener Control utility.

LSNRCTL>help<<command>>

When you enter a command as an argument to HELP, the Listener Control utility displays information about how to use the command. When you enter HELP without an argument, the Listener Control utility displays a list of all the commands.


LSNRCTL>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> SET [parameter]

When you enter SET without an argument, the Listener Control utility displays a list of all the parameters.


LSNRCTL> SET DISPLAYMODE {compat | normal | verbose | raw}

Use the SET DISPLAYMODE command to change the format and level of detail for the and commands


Arguments
[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 Corporation 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.

LSNRCTL> SET INBUUND_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 LOG_DIRECTORY /usr/oracle/admin

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 SAVE_CONFIG_ON_STOP {on | off}

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.

LSNRCTL> SET STARTUP_WAITTIME 10



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

LSNRCTL>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





Listener advance configuration


Port number.
Range is 1 TO 65535.
Port 1023 for os.
Poer 1521 is default.

Listener trace level

set trace directory

LSNRCTL> set trc_directory c:\oracle\admin\orcl\temp

See trace directory

Lsnrctl>show tarce_directory.

TRACE LEVEL set TRC_LEVEL <value>
Value Description
0 - 1 off
2 - 3 err
4 - 5 user
6 - 14 admin
15 dev
16 - 99 support

LSNRCTL> set TRC_LEVEL 0



Prevent remote modification of listener.ora.

Lsnrctl>admin_restrictions_<<listener_name>>=ON.




Listener password

The first thing to do is to put a password on your listener. By default the listener comes with no password, and anyone can change listener settings through the lsnrctl tool.

To password protect your listener, perform the following as your Oracle user:

$ lsnrctl
LSNRCTL> change_password
Old password: <<press enter here>>
New password: <<enter new password>>
Reenter new password: <<reenter password>>
If you have done all of this correctly, you will see the following:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=<port>)))
Password changed for <listener name>
The command completed successfully.

if the listener you are protecting does not have the default name of LISTENER, you must do set cur <listenername> before issuing the change_password command.


save the configuration.
LSNRCTL> save_config.
Should you want to remove the listener password do the following:

LSNRCTL> set password
Password:
The command completed successfully
LSNRCTL> stop
The command completed successfully


LISTENER FOR ORACLE RAC

EXAMPLE listener.ora file
On node 1:
[oracle@salmon1]$ more $ORACLE_HOME/network/admin/listener.ora

LISTENER_SALMON1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = salmon1-vip)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.184)(PORT = 1521))
)
)
)

SID_LIST_LISTENER_SALMON1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = dont read)
(ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
(PROGRAM = extproc)
)
)
On node 2:
[oracle@salmon2]$ more $ORACLE_HOME/network/admin/listener.ora

LISTENER_SALMON2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = salmon2-vip)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.185)(PORT = 1521))
)
)
)

SID_LIST_LISTENER_SALMON2 =
(SID_LIST =
(SID_DESC =
(SID_NAME = dont read)
(ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
(PROGRAM = extproc)
)
)

.


TRANSPARENT APPLICATION FAILOVER



Processes external to the Oracle 10g RAC cluster control the Transparent Application Failover (TAF). This means that the failover types and methods can be unique for each Oracle Net client. The re-connection happens automatically within the OCI library which means that you do not need to change the client application to use TAF.


To test TAF on the new installed RAC cluster, configure the tnsnames.ora file for TAF on a non-RAC server where you have either the Oracle database software or the Oracle client software installed.

Here is an example how my /network/admin/tnsnames.ora: looks like:
ORCLTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1vip)(PORT = 1521))—this is the 1st address

(ADDRESS = (PROTOCOL = TCP)(HOST = rac2vip)(PORT = 1521))—this 2nd address

(ADDRESS = (PROTOCOL = TCP)(HOST = rac3vip)(PORT = 1521))—this is third address

(LOAD_BALANCE = yes)

(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)


The following SQL statement can be used to check the sessions's failover type, failover method, and if a failover has occured:
Sql>select instance_name, host_name,
NULL AS failover_type,
NULL AS failover_method,
NULL AS failed_over
FROM v$instance
UNION
SELECT NULL, NULL, failover_type,
failover_method, failed_over
FROM v$session
WHERE username = 'SYSTEM';


Example of a Transparent Application Failover (TAF)

Here is an example of a Transparent Application Failover:
su – oracle

$ sqlplus system@orcltest

SQL> select instance_name, host_name,
2 NULL AS failover_type,
3 NULL AS failover_method,
4 NULL AS failed_over
5 FROM v$instance
6 UNION
7 SELECT NULL, NULL, failover_type,
failover_method, failed_over
8 FROM v$session
9 WHERE username = 'SYSTEM';


INSTANCE_NAME HOST_NAME FAILOVER_TYPE FAILOVER_M FAI
---------------- ---------- ------------- ---------- ---
orcl1 rac1pub
SELECT BASIC NO

SQL>


The above SQL statement shows that I'm connected to "rac1pub" for instance "orcl1".
In this case, execute shutdown abort on "rac1pub" for instance "orcl1":

SQL> shutdown abort
ORACLE instance shut down.
SQL>



Now rerun the SQL statement:

SQL> select instance_name, host_name,
2 NULL AS failover_type,
3 NULL AS failover_method,
4 NULL AS failed_over
5 FROM v$instance
6 UNION
7 SELECT NULL, NULL, failover_type,
failover_method, failed_over
8 FROM v$session
9 WHERE username = 'SYSTEM';


INSTANCE_NAME HOST_NAME FAILOVER_TYPE FAILOVER_M FAI
---------------- ---------- ------------- ---------- ---
orcl2 rac2pub
SELECT BASIC YES

SQL>


The SQL statement shows that the sessions has failed over to instance "orcl2".

RETRYING A CONNECTION


With the RETRIES and DELAY parameters as part of the failover node sub parameter, the connections to the nodes are automatically retried to the number of times specified by the parameter. In this scenario the connection is retried 20 times with a delay of 15 seconds between every retry. Unlike the other option where one node in the cluster fails and the connection is reestablished on one of the other surviving nodes, under this option, the connection is retried on the same node and no backup node is defined as part of the configuration. Similarly there is no significance to the load-balancing parameter and has been set to off.
SUMSKYDB =
(DESCRIPTION =
(ADDRESS_LIST =
(LOAD_BALANCE=OFF)
(FAILOVER=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=ORADB3)(PORT=1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SUMSKYDB.SUMMERSKYUS.COM)
(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=20)(DELAY=15)
)
)
)








[b]Conclusion….

Oracle listener is a central gear for oracle network environment .so you should be concerned about it. This document I was try to detain all side about listener .if you need further clarifying please contract with me. [/color][/b]








































_________________
Liakat Hossain (Consultant DBA)
MCP,OCA9i(PL/SQL),OCA10g AS, OCP8i, OCP9i,OCP10g,OCP11g.
====================================
"The greatest thing in the world is not so much where we are, but in what direction we are moving.
"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.oraclebd.com Forum Index -> Technical Docs All times are GMT + 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group