Oracle Listener static configuration, dynamic registration, and LOCAL_LISTENER question 1.1. oracleListener static service configuration and dynamic service registration 1.1.1 what is service registration first some basic concepts: Oracle instance, Oracle database, Oracle Server, Oracle service: www.2cto.com Oracle instance = Oracle SGA memory + Oracle background process Oracle Database = core file (Data file, control file, logfile) OracleServer = Oracle instance + Oracle Database in HA environment, ORACLE Server = 1 ORACLE instance + 1 Oracle database. In the RAC environment of the two hosts, ORACLEServer = 2 ORACLE instances + 1 Oracle database. oracle service: provides external services. One Oracle database can have multiple services. If you want to implement failover or Server Load balancer during connection, or you want to configure transparent distributed connections between instances in RAC, it is necessary to use the service_names parameter. To enable these functions, you only need to set service_names in the database parameter file of each instance to the same value and reference this value in the service_name setting of the Client Connection Request. Service Registration refers to registering a database as a service to a listener. By default, two pieces of information are registered to the listener at any time: the instance and service corresponding to the database server. The client www.2cto.com does not need to know the Database Name and Instance name. You only need to know the service name provided by the database to external users and can apply to connect to the database. When the database server starts, the database server registers the corresponding service with the listener. 1.1.2 Dynamic Registration is performed by the PMON process at instance startup according to the instance_name and service_names parameters in init. ora to dynamically register the instance and service to listener. First, specify the instance_name and service_names values in init. ora. If these two parameters are not specified, the system will take the default value (the Instance value will take the value of db_name In the init. ora file, and the service name will be db_name + db_domain ). It should be noted that during dynamic registration, service registration includes not only service_names registration, but also service_names does not include the default db_name + db_domain. You can specify multiple service values in the service_names parameter. The values are separated by commas (,), which is useful for shared server configuration. Because the PMON process is executed once every minute, if the listener is started later than the Oracle Server, it takes up to one minute for PMON to register these services to the listener process. listener is not required for dynamic registration. ora, which is used for static configuration. If the file exists, the file cannot contain static configuration information about the database. It can only contain information similar to the following: SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = ...) (PROGRAM = extproc) otherwise, it will be treated as static registration, and the dynamic registration feature will be invalid (PMON automatic registration will be invalid, and altersystem register will not be registered ), however, if local_listener is used. configure in ora, also need to be in listener. in ora, You can dynamically register. By default, Dynamic Registration of www.2cto.com is only registered to the default LISTENER (the name is LISTENER, the port is 1521, and the protocol is TCP), because pmon only dynamically registers a LISTENER whose port is equal to 1521. To register with a non-default listener, configure the local_listener parameter and add the listener information to tnsnames. in the ora file (or set the local_listener parameter to LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP) (HOST = xxx. xxx. xxx. xxx) (PORT = 1522 ))). Note: It is the tnsnames. ora file, because pmon needs to read relevant information from tnsnames. ora when dynamically registering a listener. LISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = DaveDai) (PORT = 1522) and run it with sys using the handler (here you can also directly modify the init file): SQL> alter system set local_listener = listener scope = both; SQL> alter system register; or: SQL> alter system set LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP) (HOST = xxx. xxx. xxx. xxx) (PORT = 1522) '; 1.1.3 static registration is to read the listener when the instance is started. configure the ora file to register the instance and service to the listener. During static registration at www.2cto.com, GLOBAL_DBNAME in listener. ora provides the service name, And SID_NAME in listener. ora provides the registered Instance name. When static registration is adopted, listener. the content in ora is as follows: SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = D:/oracle/product/10.2.0/db_1) (PROGRAM = extproc )) (SID_DESC = (GLOBAL_DBNAME = orcl) (ORACLE_HOME = D:/oracle/product/10.2.0/db_1) (SID_NAME = orcl) (SID_DESC = (GLOBAL_DBNAME = orcl1) (ORACLE_HOME = D:/oracle/product/10.2.0/db_1) (SID_NAME = orcl) This file indicates that the database is single instance and the Instance name is orcl. It provides two external services: orcl and orcl1 static listeners: ww When the listener. ora instance is started, register the corresponding service according to the listener. ora configuration. Global_dbname corresponds to the external service name of oracle, that is, service_names in the initialization parameter, and sid_name corresponds to the name of the oralce instance, that is, the instance_name 1.1.4 in the initialization parameter queries whether a service is static registration or dynamic registration. You can use the command lsnrctl status to check whether a service is static registration or dynamic registration. When the instance status is UNKNOWN, it indicates that this service is set for static registration. The listener is used to indicate that it does not know any information about the instance. It checks whether the instance exists only when the customer sends a connection request. Dynamically registered databases are indicated by status READY or status BLOCKED (for a backup database) in the status information. No matter when the database is closed, the dynamically registered database will be logged out from the listener dynamically, and the related information will disappear from the status list. In this way, the listener always knows its status whether the database is running or closed. This information will be used to connect to the request's back-to-back (fallback) and load balancing.