Professional Documents
Culture Documents
04 Oracle Net Services-2 PDF
04 Oracle Net Services-2 PDF
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracledb.newfocus.biz)(PORT
= 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME=/u01/app/oracle/product/9.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = gpdb92.newfocus.biz)
(ORACLE_HOME=/u01/app/oracle/product/9.2.0)
(SID_NAME = gpdb92)
)
)
• Bequeath Connections
o Only for UNIX – OS has ability to spawn a new
process and pass (bequeath) information to new
process
1. Client contacts listener on specific port –
service name resolution has happened at this
point
2. Listener spawns a server process and passes
client information to the server process
3. Server process sends “RESEND” packet to client
4. Client sends “CONNECT” packet to server process
5. Server responds back with “ACCEPT” packet – and
the connection is established
Note:
Windows can simulate bequeath connection by setting up
USE_SHAERD_SOCKET registry entry
• Redirect Connections
Net Manager
Profile sqlnet.ora
Service Naming tnsnames.ora
Listeners listner.ora
Oracle Names Server names.ora (New technology - OID)
Other parameters
• PASSWORDS
Managing Listener
LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:
LSNRCTL> show
The following operations are available after show
An asterisk (*) denotes a modifier or extended command:
rawmode displaymode trc_file
trc_directory trc_level log_file
log_directory log_status current_listener
startup_waittime snmp_visible save_config_on_stop
LSNRCTL> set
The following operations are available after set
An asterisk (*) denotes a modifier or extended command:
LSNRCTL>
Dynamic registration of service
• Oracle 9i instance automatically registers with
listener –
o Listener must be running on same machine
o Listener name must be LISTENER
o Listener port must be 1521
o Must use the fllowing init.ora parameters
Instance_name=GPDB92
Service_name=GPDB92.newfocus.biz
• PMON does registration
• Useful for load balancing & automatic fail-over
• No Service listed in listner.ora – use lsnrctl
services
• Listener should beo started before the instance –
otherwise there is a time lag
• Listener must run on same machine as DB instance
• Init.ora entry – if listener is not default
o Local_listener=”(ADDRESS_LIST = (Address =
(Protocol = TCP) (host=oracledb.newfocus.biz)
(Port=1522)))”
Connect Time Failover
If one listener is down, client connects to another
listener. The following entry is place in tnsnames.ora
ORCL =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=DBPROD)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=DBFAIL)(PORT=1521))
)
(CONNECT_DATA=(SERVICE_NAME=PROD)(SERVER=DEDICATED)
)
)
ORCL =
(DESCRIPTION=
(FAILOVER=ON)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=DBPROD)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=DBFAIL)(PORT=1521))
)
(CONNECT_DATA=(SERVICE_NAME=PROD)(SERVER=DEDICATED)
(FAILOVER_MODE=(TYPE=select)(METHOD=basic))
)
)
ORCL =
(DESCRIPTION=
(LOAD_BALANCE=ON)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=MWEISHAN-DELL)(PORT=1522))
(ADDRESS=(PROTOCOL=TCP)(HOST=MWEISHAN-DELL)(PORT=1521))
)
(CONNECT_DATA=(SERVICE_NAME=ORCL))
)
Tools
• Ping
• Lsnrctl status
• Lsnrctl services
• Listener.log
• Sqlplus scott/manager from server machine – without
listener
Listener Logging
LOG_DIRECTORY_LISTENER =
LOG_FILE_LISTENER =
• * delimited file
• Listener startup and shutdown
• Successful and unsuccessful connection attempts
• network errors
Listener Tracing
TRACE_LEVEL_LISTENER = ADMIN (OFF, USER, ADMIN, SUPPORT)
TRACE_FILE_LISTENER = LISTENER.trc
TRACE_DIRECTORY_LISTENER =
sqlplus shekhar/password@machine_name
Listener.ora (Server)
In listener.ora
GLOBAL_DB_NAME = prodDB & SID_NAME – prodDB
GLOBAL_DB_NAME = testDB & SID_NAME – testDB
How to connect
Sqlplus shekhar/password@prodDB
Sqlplus shekhar/password@testDB
Example 1:
Parameters
• names.default_domain
• names.directory_path
• sqlnet.expire_time
• trace_level_client
• trace_file_client
Specifies the name of the (client) trace file. The
default is sqlnet.trc.
Common Errors