Oracle RAC Listener Configuration (listener. ora tnsnames. ora)

Source: Internet
Author: User
Tags dedicated server

The configuration of the Oracle RAC listener is slightly different from that of a single instance, but its principles and implementation methods are basically the same. In Oracle, the TNS process is used to provide service registration for one or more Oracle instances on the specified network address and respond to connection requests from clients for the service. Once the connection request arrives, a server process is derived to establish a connection between the server and the client (VPC dedicated server) or forward the service request (Shared Server mode ). If the listener knows that more than one instance provides the requested service, it may locate the request to a low-load instance to provide the service based on the client and server configurations. Therefore, properly and correctly configuring listeners and tnsnames are prerequisites for implementing load balancing and Failover in Oracle RAC. This article describes the Listener Configuration Based on SuSE Linux 10 + Oracle 10g RAC.

 

For more information about Oracle network configuration, see:
Configure the Oracle client to connect to the database
Configure dynamic service registration for non-default ports
Configure sqlnet. ora to restrict IP Access to Oracle
Configure and manage Oracle listener logs
Set the Oracle listener password (listener)

Configure RAC load balancing and Failover

I. Monitoring information on nodes

1. Two nodes and host configuration information (bo2dbp, bo2dbs) Oracle @ bo2dbp: /u01/Oracle/DB/Network/admin> CAT/etc/hosts127.0.0.1 localhost.2gotrade.com localhost # public192.168.7.51 pull bo2dbp192.168.7.52 pull bo2dbs # private10.10.51 bo2dbp-priv.2gotrade.com bo2dbp-priv10.10.7.52 bo2dbs-priv.2gotrade.com bo2dbs-priv # virtual192.168.7.61 bo2dbp-vip.2gotrade.com bo2dbp-vip192.168.7.62 bo2dbs-vip.2gotra De.com bo2dbs-vip2, listener on node bo2dbp. oraoracle @ bo2dbp:/u01/Oracle/DB/Network/admin> More listener. ora # listener. ora. bo2dbp network configuration file:/u01/Oracle/DB/Network/admin/listener. ora. bo2dbp # generated by Oracle configuration tools. listener_bo2dbp = (description_list = (description = (address = (Protocol = TCP) (host = bo2dbp-vip.2gotrade.com) (Port = 1521) (IP = first) (address = (protoco L = TCP) (host = 192.168.7.51) (Port = 1521) (IP = first) sid_list_listener_bo2dbp = (sid_list = (sid_desc = (sid_name = plsextproc) (ORACLE_HOME =/u01/Oracle/DB) (program = EXTPROC) 3. tnsnames on node bo2dbp. oraoracle @ bo2dbp:/u01/Oracle/DB/Network/admin> More tnsnames. ora # For connection strings gobo1a, gobo1b, gobo1 can be omitted here # these strings are usually used for client connection to database gobo1b = (description = (address = (Protocol = TCP) (host = 192.168.7.62) (P ORT = 1521) (CONNECT_DATA = (Server = dedicated) (SERVICE_NAME = gobo1) (instance_name = gobo1b) gobo1a = (description = (address = (Protocol = TCP) (host = 192.168.7.61) (Port = 1521) (CONNECT_DATA = (Server = dedicated) (SERVICE_NAME = gobo1) (instance_name = gobo1a ))) gobo1 = (description = (address = (Protocol = TCP) (host = 192.168.7.61) (Port = 1521) (address = (Protocol = TCP) (host = 192. 168.7.62) (Port = 1521) (load_balance = yes) (CONNECT_DATA = (Server = dedicated) (SERVICE_NAME = gobo1 ))) # below are several important definitions used to set local_listener and remote_listener parameters: listener_bo2db = (address_list = (address = (Protocol = TCP) (host = 192.168.7.61) (Port = 1521 )) (address = (Protocol = TCP) (host = 192.168.7.62) (Port = 1521) listener_bo2dbp = (address_list = (address = (Protocol = TCP) (host = 192.168.7. 61) (Port = 1521) listener_bo2dbs = (address_list = (address = (Protocol = TCP) (host = 192.168.7.62) (Port = 1521) # Author: robinson Cheng # blog: http://blog.csdn.net/robinson_0612 4, node bo2dbp listener information # Can be seen that only the instance gobo1a registered to the listener listener_bo2dbporacle @ bo2dbp: /u01/Oracle/DB/Network/admin> LSNRCTL status listener_bo2dbplsnrctl for Linux: Version 10.2.0.3.0-production on 25-sep-2012 17: 12: 04 copyright (C) 1991,200 6, Oracle. all rights reserved. connecting to (description = (address = (Protocol = TCP) (host = bo2dbp-vip.2gotrade.com) (Port = 1521) (IP = first ))) status of the listener ------------------------.............. listener parameter file/u01/Oracle/DB/Network/admin/listener. oralistener log file/u01/Oracle/DB/Network/log/listener_bo2dbp.loglistening endpoints summary... (description = (address = (Protocol = TCP) (Host = 192.168.7.61) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.51) (Port = 1521 ))) services summary... service "+ ASM" has 1 instance (s ). instance "+ ASM1", status blocked, has 1 handler (s) for this service... service "+ asm_xpt" has 1 instance (s ). instance "+ ASM1", status blocked, has 1 handler (s) for this service... service "gobo1" has 1 instance (s ). instance "gobo1a", status ready, Has 1 handler (s) for this service... service "gobo1xdb" has 1 instance (s ). instance "gobo1a", status ready, has 1 handler (s) for this service... service "gobow.xpt" has 1 instance (s ). instance "gobo1a", status ready, 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 successfull Y5. listener on node bo2dbs. oraoracle @ bo2dbs:/u01/Oracle/DB/Network/admin> More listener. ora # listener. ora. bo2dbs network configuration file:/u01/Oracle/DB/Network/admin/listener. ora. bo2dbs # generated by Oracle configuration tools. listener_bo2dbs = (description_list = (description = (address = (Protocol = TCP) (host = bo2dbs-vip.2gotrade.com) (Port = 1521) (IP = first) (address = (Protocol = TCP) (host = 192.168.7.52) (Port = 1521) (IP = first) sid_list_listener_bo2dbs = (sid_list = (sid_desc = (sid_name = plsextproc) (ORACLE_HOME =/u01/Oracle/DB) (program = EXTPROC) # due to the tnsnames on the node bo2dbs. ora has the same content as node bo2dbp and does not list listener status on node 6 and node bo2dbs # You can also see that there is only one instance, that is, gobo1b registers with the listener listener_bo2dbsoracle @ bo2dbs: /u01/Oracle/DB/Network/admin> LSNRCTL status listener_bo2dbslsnrctl for Linux: Version 10.2.0.3.0-Pr Oduction on 25-sep-2012 17: 12: 31 copyright (c) 1991,200 6, Oracle. all rights reserved. connecting to (description = (address = (Protocol = TCP) (host = bo2dbs-vip.2gotrade.com) (Port = 1521) (IP = first ))) status of the listener ------------------------....................... listening endpoints summary... (description = (address = (Protocol = TCP) (host = 192.168.7.62) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.52) (Port = 1521) Services summary... service "+ ASM" has 1 instance (s ). instance "+ asm2", status blocked, has 1 handler (s) for this service... service "+ asm_xpt" has 1 instance (s ). instance "+ asm2", status blocked, has 1 handler (s) for this service... service "gobo1" has 1 instance (s ). instance "gobo1b", status ready, has 1 handler (s) for this service... service "gobo1xdb" has 1 instance (s ). I Nstance "gobo1b", status ready, has 1 handler (s) for this service... service "gobow.xpt" has 1 instance (s ). instance "gobo1b", status ready, 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 successfully # The above observations show that the current two instances are registered on the listeners of their respective hosts.

2. Set the remote_listener Parameter

1. Execute the following command SQL> show parameter instance_namename type value ----------- configure instance_name string gobo1a --> set a remote listener for node bo2dbp --> this means you can set the instance gobo1a the provided service can be registered to the listener_bo2dbs listener. SQL> alter system set remote_listener = 'listener _ bo2dbs 'SID = 'gobo1a '; system altered. --> execute register to register SQL> alter system register; System altered. # Check the node bo2dbs listener status again. The instance gobo1a has been registered to the bo2dbs node Oracle @ bo2dbs:/u01/Oracle/DB/Network/admin> LSNRCTL status listener_bo2dbslsnrctl for Linux: version 10.2.0.3.0-production on 25-sep-2012 17: 23: 03 copyright (c) 1991,200 6, Oracle. all rights reserved. connecting to (description = (address = (Protocol = TCP) (host = bo2dbs-vip.2gotrade.com) (Port = 1521) (IP = first ))) status of the listener ------------------------.............. listener parameter file/u01/Oracle/DB/Network/admin/listener. oralistener log file/u01/Oracle/DB/Network/log/listener_bo2dbs.loglistening endpoints summary... (description = (address = (Protocol = TCP) (host = 192.168.7.62) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.52) (Port = 1521) Services summary... service "+ ASM" has 1 instance (s ). instance "+ asm2", status blocked, has 1 handler (s) for this service... service "+ asm_xpt" has 1 instance (s ). instance "+ asm2", status blocked, has 1 handler (s) for this service... service "gobo1" has 2 instance (s ). instance "gobo1a", status ready, has 1 handler (s) for this service... instance "gobo1b", status ready, has 1 handler (s) for this service... service "gobo1xdb" has 2 instance (s ). instance "gobo1a", status ready, has 1 handler (s) for this service... instance "gobo1b", status ready, has 1 handler (s) for this service... service "gobow.xpt" has 2 instance (s ). instance "gobo1a", status ready, has 1 handler (s) for this service... instance "gobo1b", status ready, 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 successfully2. Set local_listener and remote_listenersql> select instance_name from V $ instance on the node bo2dbs; INSTANCE_NAME----------------GOBO1BSQL> show parameter listenername type value parameter ------------- expose local_listener listener string --> the remote_listener on the node bo2dbp is directed only to the node bo2dbpsql> alter system set remote_listener = 'listener _ bo2dbp 'sid = 'gobo1b '; system altered. SQL> alter system register; System altered. --> On the bo2dbp node, you can see that the instance gobo1b is also registered to the first node. Oracle @ bo2dbp:/u01/Oracle/DB/Network/admin> LSNRCTL status listener_bo2dbplsnrctl for Linux: version 10.2.0.3.0-production on 25-sep-2012 17: 32: 19 copyright (c) 1991,200 6, Oracle. all rights reserved. connecting to (description = (address = (Protocol = TCP) (host = bo2dbp-vip.2gotrade.com) (Port = 1521) (IP = first ))) status of the listener ------------------------............ listener parameter file/u01/Oracle/DB/Network/admin/listener. oralistener log file/u01/Oracle/DB/Network/log/listener_bo2dbp.loglistening endpoints summary... (description = (address = (Protocol = TCP) (host = 192.168.7.61) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.51) (Port = 1521) Services summary... service "+ ASM" has 1 instance (s ). instance "+ ASM1", status blocked, has 1 handler (s) for this service... service "+ asm_xpt" has 1 instance (s ). instance "+ ASM1", status blocked, has 1 handler (s) for this service... service "gobo1" has 2 instance (s ). instance "gobo1a", status ready, has 1 handler (s) for this service... instance "gobo1b", status ready, has 1 handler (s) for this service... service "gobo1xdb" has 2 instance (s ). instance "gobo1a", status ready, has 1 handler (s) for this service... instance "gobo1b", status ready, has 1 handler (s) for this service... service "gobow.xpt" has 2 instance (s ). instance "gobo1a", status ready, has 1 handler (s) for this service... instance "gobo1b", status ready, 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 successfully

Iii. Summary (default port 1521)
1. When the default listener is used, the listener name is listener _ $ {node}
2. If remote_listener is not set, the local instance is only registered in the local listener. When the remote_listener is set correctly, the local instance can be remotely registered.
3. By default, the pmon process automatically registers information such as instance_name and service_names to the started default listener.
4. You can use alter system register for fast registration.

Important:

Do not set the global_dbname parameter in the sid_list_listener_name section of the listener. ora.
A statically configured Global Database Name disables connect-time failover.

 

Iv. More references

For more information about user-managed backup and recovery, see

Oracle cold backup

Oracle Hot Backup

Concept of Oracle backup recovery

Oracle instance recovery

Oracle recovery based on user management (describes media recovery and processing in detail)

System tablespace management and Backup Recovery

Sysaux tablespace management and recovery

Oracle backup control file recovery (unsing backup controlfile)

 

For information on RMAN backup recovery and management, see

RMAN overview and architecture

RMAN configuration, Monitoring and Management

Detailed description of RMAN backup

RMAN restoration and recovery

Create and use RMAN catalog

Create RMAN storage script based on catalog

Catalog-based RMAN backup and recovery

RMAN backup path confusion (when using plus archivelog)

 

For the Oracle architecture, see

Oracle tablespace and data files

Oracle Password File

Oracle parameter file

Oracle online redo log file)

Oracle Control File)

Oracle archiving logs

Oracle rollback and undo)

Oracle database instance startup and Shutdown Process

Automated Management of Oracle 10g SGA

Oracle instances and Oracle databases (Oracle Architecture)

 

Related Article

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.