Configure a single oracle instance and RAC listener

Source: Internet
Author: User
11grac listener reference: www.luocs.comarchives281.htmlwww.oracledatabase12g.comarchives11gr2-rac-add-listener-static-register.html 1. What is registration is to register the database as a service to the listener. The client does not need to know the Database Name and Instance name.

11g rac listener reference: http://www.luocs.com/archives/281.html http://www.oracledatabase12g.com/archives/11gr2-rac-add-listener-static-register.html 1. What is registration is to register the database as a service to the listener. The client does not need to know the Database Name and Instance name.

11g rac listener reference:
Http://www.luocs.com/archives/281.html

Http://www.oracledatabase12g.com/archives/11gr2-rac-add-listener-static-register.html

1. What is registration?
Registration is to register the database as a service to the listener.
The client does not need to know the Database Name and Instance name. It only needs to know the service name provided by the database to external users and can apply to connect to the database. The service name may be the same or different from the instance name. When the database server is started, the database server registers the corresponding service with the listener (whenever a database is started, two messages are registered to the listener by default: the instance and service corresponding to the database server are equivalent to the following: there is a Listener (Listener) between the database server and the client. In the Listener, the service name corresponding to the database is recorded (one database may have multiple service names). When the client needs to connect to the database, only the service name is required, you can establish a connection between the client and the server.
2. How to query whether a service is registered with a static listener or a dynamic listener
You can run the lsnrctl status Command to check whether a service is registered statically or dynamically. 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. The status of the dynamic listener is READY.
3. Dynamic listening
Dynamically register the configuration listener. ora file that does not need to be displayed. When the instance is mounted, the PMON process dynamically registers the instance and service to listerer according to the instance_name and service_name parameters.
Different parameters are registered with the service name and Instance name in the listener in the following situations:
1. If instance_name is not set (10 Gb is equal to ORACLE_SID), db_name will be used to initialize the parameter value.
2. If the service_names value is null, the system Concatenates the db_unique_name and db_domain parameter values to register the listener.
3. if you select to set the service_names value, you can use the specified name (such as orcl.oracle.com) or abbreviated name (such as orcl ).
4. If you select the abbreviated name and set the db_domain parameter, the Service registered to the listener will be spliced by the service_name value and db_domain value.

Advantages of dynamic listening:
(1) No manual intervention is required. After lsnrctl start, the instance_name and service_name of the database are automatically registered. Then, tns can be connected regardless of SID and SERVICE_NAME.
(2) If SERVICE_NAME or SID is modified, you do not need to modify the listener. ora file.
(3) 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. The PMON process registers the dynamic listener dynamically or manually: alter system register;
4. Static listening
Static Registration refers to reading the listener. ora configuration file when the instance starts, and registering the instance and service to the listener.
Advantages:
Whenever a database is started, two messages are registered to the listener by default: instance and service. In the database is not open, you can remotely connect to the database and operate on the database-of course, you need to configure the password file.

How to configure a listener-single instance:
Default port dynamic listener

PROD = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = lx01) (PORT = 1521) TNS configuration -- (TNS names can be started at Will) PROD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = lx01) (PORT = 1521) (CONNECT_DATA = (SERVICE_NAME = prod )))
Dynamic listening for non-default ports
PROD = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = lx01) (PORT = 1529 )))) TNS configuration PROD = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = lx01) (PORT = 1529) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) by default, dynamic registration is only registered to the default LISTENER (the name is LISTENER, the port is 1521, and the protocol is TCP ), pmon only dynamically registers listeners with port 1521 or. Otherwise, pmon cannot dynamically register listener. If you need to register with a non-default listener, you need to configure the local_listener parameter! SYS @ prod> show parameter localNAME type value =----------- specify local_listener string PROD = server TNS name, or write TNS string --- log_archive_local_first boolean TRUEparallel_force_local boolean FALSE must be configured for non-default dynamic ports
Non-Default port Static listening ----- (multiple instances, red font appended)
Prod = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = lx01) (PORT = 1527 )))) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = prod) (ORACLE_HOME =/u01/app/oracle/product/11.2.0/db_1) (SID_NAME = prod ))) TNS configuration test = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = lx01) (PORT = 1527) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod )))
After 11g RAC, check the listening file for the following changes:
[Grid @ rac1 admin] $ more listener. oraLISTENER = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER )))) # line added by AgentLISTENER_SCAN1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER_SCAN1 )))) # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1 = ON # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON # line added by Agent [grid @ rac1 admin] $ more Endpoints_listener.ora LISTENER_RAC1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = rac1-vip) (PORT = 1521) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.6.21) (PORT = 1521) (IP = FIRST) # line added by Agent and above listener. the information in the ora configuration file is automatically added by the edas Agent During Grid Infrastructure installation (During the Grid Infrastructure installation, the (default) node VIP listener is always created referencing the public network ), 11.2 GI LIST By default, Listener Configuration is managed by the new endpoints_listener.ora configuration file 11.2.
How can I create a new listener (non-scan listener) in 11R2? The following is a quick method (in red)
[Grid @ rac1 admin] $ srvctl config scanSCAN name: rac-scan, Network: 1/192. 168.6.0/255.255.255.0/eth0SCAN VIP name: scan1, IP:/rac-scan/192.168.6.41 [grid @ rac1 admin] $ srvctl add listener-hAdds a listener configuration to the Oracle Clusterware. usage: srvctl add listener [-l
 
  
] [-S] [-p "[TCP:]
  
   
[,...] [/IPC:
   
    
] [/NMP:
    
     
] [/TCPS:
     
      
] [/SDP:
      
        ] "] [-O
       
         ] [-K
        
          ]-L
         
           Listener name (default name is LISTENER)-o
          
            ORACLE_HOME path (default value is CRS_HOME)-k
           
             VIP network number (default number is 1)-s Skip the checking of ports-p "[TCP:]
            
              [,...] [/IPC:
             
               ] [/NMP:
              
                ] [/TCPS:
               
                 ] [/SDP:
                
                  ] "Comma separated tcp ports or listener endpoints-h Print usage-k fill in the obtained network number,-p fill in the port number,-l fill in the listening name, -o Fill in the gi home path [grid @ rac1 admin] $ srvctl add listener-l rac-fyl-o $ ORACLE_HOME-p 1522-k 1 [grid @ rac1 admin] $ srvctl start listener-l rac-fylsrvctl start listener start the added listener and then listener. ora and endpoints_listener.ora will display a new record: [grid @ rac1 admin] $ more listener. oraRAC-FYL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC) (KEY = RAC-FYL )))) # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_RAC-FYL = ON # line added by Agent [grid @ rac1 admin] $ more endpoints_listener.oraRAC-FYL_RAC1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = rac1-vip) (PORT = 1522) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.6.21) (PORT = 1522) (IP = FIRST )))) # line added by Agent only needs to be added to listener. add static registration information, such as: SID_LIST_RAC-FYL = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = fyl) (ORACLE_HOME =/u01/app/oracle/product/11.2.0/db_1) (SID_NAME = fyl1 )))
                
               
              
             
            
           
          
         
        
       
      
     
    
   
  
 
[Grid @ rac1 admin] $ srvctl stop listener-l rac-fyl [grid @ rac1 admin] $ srvctl start listener-l rac-fyl client TNS configure the following RAC-VIP = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.6.32) (PORT = 1521) ---- rac2-vip (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.6.22) (PORT = 1521) ---- rac1-vip (LOAD_BALANCE = ON) (FAILOVER = ON) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = fyl )))
11g rac can use LISTENER_SCAN1
[Grid @ rac1 admin] $ lsnrctl status LISTENER_SCAN1LSNRCTL for Linux: Version 11.2.0.1.0-Production on 15-SEP-2014 22: 19: 10 Copyright (c) 1991,200 9, Oracle. all rights reserved. connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER_SCAN1) STATUS of the LISTENER ------------------------ Alias LISTENER_SCAN1Version TNSLSNR for Linux: Version 11.2.0.1.0-ProductionStart Date 15-SEP-2014 18: 48: 44 Uptime 0 days 3 hr. 30 min. 26 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File/u01/app/11.2.0/grid/network/admin/listener. oraListener Log File/u01/app/11.2.0/grid/log/diag/tnslsnr/rac1/listener_scan1/alert/log. xmlListening Endpoints Summary... (DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = LISTENER_SCAN1) (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.6.41) (PORT = 1526) ---- rac-scan IPServices Summary... service "fyl" has 1 instance (s ). instance "fyl1", status READY, has 1 handler (s) for this service... instance "fyl2", status READY, has 1 handler (s) for this service... service "fylXDB" has 1 instance (s ). instance "fyl1", status READY, has 1 handler (s) for this service... instance "fyl2", status READY, has 1 handler (s) for this service... the command completed successfully this is using ORACLE's remote_listener parameter SQL> show parameter listNAME TYPE VALUE parameter ----------- using listener_networks stringlocal_listener string (DESCRIPTION = (ADDRESS_LIST = (AD DRESS = (PROTOCOL = TCP) (HOST = rac1-vip) (PORT = 1521) remote_listener string rac-scan: 1526

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.