Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle static snooping

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle static and dynamic snooping

What is registration? Registration is to register the database as a service with the listener. The client does not need to know the database name and instance name, but only needs to know the service name provided by the database to apply for a connection to the database. This service name may or may not be the same as the instance name. During the startup of the database server, the database server registers the appropriate service with the listener (whenever a database is started, two pieces of information are registered to the listener by default: the instance and the service corresponding to the database server. ) is equivalent to this: there is a listener (Listener) between the database server and the client. In the listener, the corresponding service name of the corresponding database is recorded (a database may have multiple service names). When the client needs to connect to the database, it only needs to provide the service name to establish a connection between the client and the server. Static registration is the configuration of reading listener.ora files when the instance is started, and registering the instance and service with the listener. Whenever a database is started, two pieces of information are registered with the listener by default: the instance and service corresponding to the database server. When registering statically, the GLOBAL_DBNAME in listener.ora provides the service name, and the SID_NAME in listener.ora provides the registered instance name. When adopting the static registration method The content in listener.ora is as follows: SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = D:\ oracle\ product\ 11.2.0\ db_1) (PROGRAM = extproc)) (SID_DESC = (GLOBAL_DBNAME = orcl) (ORACLE_HOME = D:\ oracle\ product\ 11.2.0\ db_1) (SID_NAME = orcl)) (SID_DESC = (GLOBAL_DBNAME = orcl1) (ORACLE_HOME = D:\ oracle\ product\ 11.2.0\ db_1) (SID_NAME = orcl) this file indicates that the database is a single instance The instance is named orcl and provides two services: orcl and orcl1. Dynamic registration dynamic registration is when the instance starts, the PMON process dynamically registers the instance and the service into the listener according to the two parameters of instance_name,service_names in the init.ora. The first step is to specify the values of the two parameters instance_name,service_names in init.ora. You can view the values of these two parameters through show parameter service_names and show parameter instance_name under sqlplus. The instance value registered to the monitor is obtained from the instance_name parameter in the init.ora file. If the parameter does not have a set value, it takes the value of db_name in the init.ora file. The service value registered to the monitor is obtained from the parameter service_names in the init.ora file. If the parameter does not have a set value, the database registers itself by splicing the values of db_name and db_domain in the init.ora file. If you choose to provide a service_ name, you can use a fully qualified name (such as orcl.oracle.com) or an acronym

(for example, orcl). If an abbreviated name is selected and the db_domain parameter is set, the service registered to the monitor will be a spelling of the service_ name value and the db_ domain value

Answer it. For example, the following setting will cause the service orcl.oracle.com to be registered for listening: db_domain=oracle.com service_names=orcl When using the dynamic registration method, the content in listener.ora is as follows: SID_LIST_LISTENER = (SID_LIST = (SID_NAME = PLSExtProc) (ORACLE_HOME = D:\ oracle\ product\ 11.2.0\ db_1) (PROGRAM = extproc) optionally, you can specify multiple service values in the service_names parameter, separated by commas This is useful for shared server configurations. Dynamic registration is only registered to the default listener by default (name is LISTENER, port is 1521, protocol is TCP). If you need to register with a non-default listener, you need to configure the local_listener parameter! If the values of service_names and instance_name are not explicitly set, dynamic registration will occur only if the database is started after the listening run; in this case, if the monitoring later restarts, the dynamic registration information will be lost. Obviously, it is best to start listening before all databases are started, so as to avoid the loss of dynamic registration information caused by restarting listening without explicitly setting the values of service_names and instance_name. Setting explicit values for the initialization parameters service_names and instance_name is a desirable approach and suggestion. Because if the listener needs to restart while the database is running, only if you explicitly set the values of service_names and instance_name in the init.ora file, the PMON process of each database will complete the dynamic registration in a very short period of time. 4. To query whether a service is registered statically or dynamically, you can use the command lsnrctl status to check whether a service is registered statically or dynamically. When the instance status is UNKNOWN, the service is statically registered. At this point, the monitor is used to indicate that it does not know any information about the instance, and it checks whether the instance exists only when the customer makes a connection request. Dynamically registered databases are indicated by status READY or status BLOCKED (for a standby database) in the status information. Whenever the database is closed, the dynamically registered database is dynamically logged off from the monitor, and the information related to it disappears from the status list. In this way, the listener always knows the status of the database, whether it is running or closed. This information will be used for fallback of connection requests and load balancing.

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: 264

*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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report