In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what is the difference between static registration and dynamic registration of Oracle listeners". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what is the difference between static registration and dynamic registration of Oracle listeners?"
When you run the status of the lsnrctl command, you will often see the following return value:
The service "test" contains 1 routine.
Routine "mydata", status UNKOWN, contains a handler for this service.
Service "a" contains 1 routine.
Routine "mydata", status READY, contains a handler for this service.
Here, the status UNKOWN indicates static registration (manually fill in the parameters)
A record with a status of READY, indicating dynamic registration (the listener.ora parameter is automatically obtained from the parameter file by the PMON process)
I. static registration
In the monitoring configuration, the global database name in the database service can write anything that has nothing to do with the database. As long as you ensure that the SID is correct, you can connect to the database.
Due to static registration, the parameters are manually statically added, regardless of the database. The database cannot confirm that the listening is configured correctly. Therefore, the status display status in lsnrctl is unkown. That is, it is not guaranteed to connect to the database.
Note: static registration listening, when the client configures the tnsnames.ora service name, the "(Oracle 8i or higher) service name" should be the same as the global database name when the server statically registers the listener. Otherwise, it cannot be connected.
The lsnrctl displays as follows
The service "test" contains 1 routine.
Routine "mydata", status UNKOWN, contains a handler for this service.
Test is the value read from the "global database name" in the database service (that is, the value of GLOBAL_DBNAME in the configuration file) from the listening configuration process, and "mydata" is the value read by SID (that is, the value of SID_NAME) from the listening configuration in the database service.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / orahome/oracle/product/10.2.0/db_1)
(SID_NAME = mydata)
)
)
When the client configures tnsname, the service name (SERVICE_NAME) is test. Otherwise, you cannot connect to the database.
ABC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.23) (PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =
Test)
)
)
The ABC here is named for the service. Can be any value, when the client connects to the server, fill in the host string, that is, name ABC for this service.
Second, dynamic registration
1. Default dynamic registration
Pmon dynamically reads the service_ namespace value from the parameter file when the database starts to mount or open. Service_names can be multiple values.
Service_names defaults to the global database name when dbca builds the database.
Set the parameter service_names to'a _
Alter system set service_names='a,b,c'
Then:
The lsnrctl status is as follows:
The service "test" contains 1 routine.
Routine "mydata", status UNKOWN, contains a handler for this service.
Service "a" contains 1 routine.
Routine "mydata", status READY, contains a handler for this service.
Service "b" contains 1 routine.
Routine "mydata", status READY, contains a handler for this service.
Service "c" contains 1 routine.
Routine "mydata", status READY, contains a handler for this service.
The service "mydata.ccddt.cn" contains a routine.
Routine "mydata", status READY, contains a handler for this service.
The above service names a, b, c and mydata.ccddt.cn are all READY and are dynamic registrations.
The last "mydata.ccddt.cn" is added here, which PMON registers dynamically with the listener by default.
Note: regardless of the value of the parameter service_names, pmon automatically registers a listener with the global database name (in this case, mydata.ccddt.cn) as the service name.
By default, if dynamic registration snooping is enabled, the port number must be 1521. If you enable dynamic snooping registration for other ports, you must configure it.
By looking at the v$session, the connection with the status of SYS$USERS is connected to the server through static registration listening.
2. Dynamic monitoring registration of custom ports
To enable dynamic snooping registration other than the default port 1521, Oracle does not register dynamically by default. To enable dynamic registration, you must set the local_listener parameter. And configure tnsnames.ora on the server to specify listening parameters, or directly specify listening parameters by modifying local_listener. The steps are as follows:
1) Server side
Netmgr, configure listener, listener port is 1525 (non-default port)
Save configuration
2), specify monitoring parameters
(1) method 1: specify directly by modifying the local_listener parameter
SQL > alter system set LOCAL_LISTENER=' (ADDRESS= (PROTOCOL=TCP) (HOST=192.168.1.23) (PORT=1525))'
System altered
SQL > alter system register
System altered
(2) Law 2:
Create $ORACLE_HOME/network/admin/tnsnames.ora on the Oracle server side. Parse the file, location, and fill in the following
Mytest =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS= (PROTOCOL=TCP) (HOST = 192.168.1.23) (PORT = 1525))
)
)
The mytest here can also be changed to other strings according to your needs. Such as an or b, etc.
Set parameters to specify listening parameters through the information in the tnsnames.ora
SQL > alter system set local_listener=mytest
System altered
SQL > alter system register
3. Check the listener status
LSNRCTL > status
Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=192.168.1.23) (PORT=1525)
STATUS of the LISTENER
-
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0-Production
Start Date 15-MAR-2011 10:43:47
Uptime 0 days 0 hr. 0 min. 56 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File / orahome/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File / orahome/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oraserver) (PORT=1525))
Services Summary...
Service "a" has 1 instance (s).
Instance "mydata", status READY, has 1 handler (s) for this service...
Service "b" has 1 instance (s).
Instance "mydata", status READY, has 1 handler (s) for this service...
Service "c" has 1 instance (s).
Instance "mydata", status READY, has 1 handler (s) for this service...
Service "mydata" has 1 instance (s).
Instance "mydata", status READY, has 1 handler (s) for this service...
Service "mydataXDB" has 1 instance (s).
Instance "mydata", status READY, has 1 handler (s) for this service...
Service "mydata_XPT" has 1 instance (s).
Instance "mydata", status READY, has 1 handler (s) for this service...
The command completed successfully so far, I believe you have a deeper understanding of "what is the difference between static registration and dynamic registration of Oracle listeners". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.