Oracle static listener registration details, oracle details
Oracle static listener registration details
There are a lot of articles on oracle listening for static registration on the Internet, but most of them are a simple example, there is no detailed example. Here, we will give a specific example using oracle 10gR2. 0.1 under linux as4.
1. Add a static registered node to the $ ORACLE_HOME/network/admin/listener. ora file.
[oracle@prudent oracle]$ cd $ORACLE_HOME/network/admin[oracle@prudent admin]$ vi listener.ora# listener.ora Network Configuration File: /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /mydatafile2/app/oracle/oracle/product/11.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = ORCL) (ORACLE_HOME = /mydatafile2/app/oracle/oracle/product/11.2.0/db_1) (GLOBAL_DBNAME=WOO.COM) ) )LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) (ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521)) ) )
Note that GLOBAL_DBNAME = WOO. COM
SID_NAME = ORCL
This SID_NAME should be consistent with the $ ORACLE_SID that you provide external services.
[oracle@prudent admin]$ echo $ORACLE_SID ORCL
2. Configure the nodes in tnsnames. ora.
[oracle@prudent admin]$ vi tnsnames.ora# tnsnames.ora Network Configuration File: /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.ORCL= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) )WOOORCL= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = WOO.COM) ) )
SERVICE_NAME = WOO. COM in tnsname WOOORCL
The service name here is WOO. COM instead of the general ORCL, because in listener. WOO has been registered in ora. COM, lsnrctl will listen to WOO. and corresponding to SID_NAME = ORCL.
3. Start listeners and services
[oracle@prudent oracle]$ cat dbstartlsnrctl startsqlplus /nolog <<EOFconnect /as sysdbastartupEOF[oracle@prudent oracle]$ ./dbstartLSNRCTL for Linux: Version 11.2.0.1.0 - Production on 13-FEB-2011 20:11:15Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionSystem parameter file is /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/listener.oraLog messages written to /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prudent)(PORT=1521)))Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionStart Date 13-FEB-2011 20:11:15Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/listener.oraListener Log File /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/log/listener.logListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prudent)(PORT=1521)))Services Summary...Service "WOO.COM" has 1 instance(s). Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...Service "ORCL" has 1 instance(s). Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...The command completed successfullySQL*Plus: Release 11.2.0.1.0 - Production on Sun Feb 13 20:11:16 2011Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL> Connected to an idle instance.SQL> ORA-32004: obsolete and/or deprecated parameter(s) specifiedORACLE instance started.Total System Global Area 461373440 bytesFixed Size 1220000 bytesVariable Size 75498080 bytesDatabase Buffers 381681664 bytesRedo Buffers 2973696 bytesDatabase mounted.Database opened.SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options
We can see that
Service "WOO. COM" has 1 instance (s ).
Instance "ORCL", status UNKNOWN, has 1 handler (s) for this service...
Being monitored.
4. Verify that the service can arrive
[oracle@prudent oracle]$ tnsping WOOORCLTNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 13-FEB-2011 20:14:59Copyright (c) 1997, 2005, Oracle. All rights reserved.Used parameter files:/mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/sqlnet.oraUsed TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = WOO.COM)))OK (10 msec)
5. Use the static registration service to log on to oracle
[oracle@prudent oracle]$ sqlplus system/oracle@WOOORCLSQL*Plus: Release 11.2.0.1.0 - Production on Sun Feb 13 20:17:27 2011Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsSQL> select count(*) from date_log; COUNT(*)----------SQL>
So far: the static registration has been verified to be successfully resolved, listened, and connected.
How to configure oracle static registration listening
You can use netca to configure my configuration (oracle11g ):
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 5DOHK4UVIM4P7BE) (PORT = 1521 ))
)
)
ADR_BASE_LISTENER = E: \ app \ Administrator
SID_LIST_LSTNR =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS = ONLY: E: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ bin \ lrlr11.dll ")
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = E: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1)
(SID_NAME = ORCL)
)
)
Oracle listener registration problems
Unknown indicates that this is static registration and does not affect usage. If you have to see ready, you have to change it to dynamic registration.
Use netmgr to modify listener settings. The listener name uses the default name listener and listens on the default port 1521. do not specify the database service. Then restart the listener:
Lsnrctl restart