Non-default listeners and port configurations for placing an instance in the Oracle 11g RAC Environment

Source: Internet
Author: User

If you use dbca to create a single-instance database in the Oracle 11g RAC environment, Oracle automatically registers it to the default port 1521 and listener. In most cases, we use non-default listeners and non-default listening ports. In the Oracle 11g RAC environment, the cluster Listener Configuration is taken over by the grid user. In this case, how should I configure non-default listeners and ports for a single instance? This article provides a solution and uses static and dynamic registration methods.

For configurations of non-default listeners and ports under a single instance, refer to the following article. In fact, you can still configure non-default listeners and ports for the instance in the RAC environment by referring to the following articles,
The RAC environment is somewhat different from the previous single instance Environment, so these small differences are recorded.
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 the Oracle client to connect to the database

 

1. dbca listener after creating a single instance Database

-- Environment [grid @ linux1 ~] $ CAT/etc/issueenterprise Linux Enterprise Linux Server Release 5.5 (Carthage) kernel \ r on an \ m [grid @ linux1 ~] $ Crsctl query CRS activeversionoracle clusterware active version on the cluster is [11.2.0.1.0] -- the instance cnbo is created using dbca In the RAC environment and is in the offline status [Oracle @ linux1 ~] $ Crsstat | grep cnboora. cnbo. DB database C offline (linux1) 0 instance shutdown -- the default listener is offline [Oracle @ linux1 ~] $ Crsstat | grep listener | grep offlineora. listener. lsnr listener l offline (linux1) 0 -- start the instance and listen to [Oracle @ linux1 ~] $ Srvctl start database-D cnbo [Oracle @ linux1 ~] $ Srvctl start listener-l LISTENERPRCC-1014: Listener was already running [Oracle @ linux1 ~] $ Export oracle_sid = cnbo [Oracle @ linux1 ~] $ Sqlplus/As sysdbasql> set linesize limit SQL> show parameter cluster_d ---> this instance is a single instance name type value within the RAC environment ------------------------------ ter_database Boolean falsecluster_database_instances integer 1 -- The following LSNRCTL status you can see that the instance is registered to the default port 1521, after dbca creates the instance cnbo, it does not configure a listener for it. The instance is indeed registered with the default listener. It should be said that this is automatically added by dbca. -- Note: starting from Oracle 11g RAC The configuration is taken over by the grid user. Therefore, you can find the corresponding listener. ora file in the $ ora_crs_home/Network/admin/directory [grid @ linux1 ~] $ LSNRCTL statuslsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 12:35:43 ............. listening endpoints summary... (description = (address = (Protocol = IPC) (Key = listener) (description = (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.31) (Port = 1521) Services summary... service "+ ASM" has 1 instance (s ). instance "+ ASM1", status ready, has 1 handler (s) for this service... service "cnbo.orasrv.com" has 1 instance (s ). ---> this service is the instance "cnbo", status ready, has 1 handler (s) for this service provided by a single instance cnbo... service "cnboxdb.orasrv.com" has 1 instance (s ). instance "cnbo", status ready, has 1 handler (s) for this service... the command completed successfully

2. Configure non-default listeners and Implement Dynamic Registration

-- Switch to the Oracle user, and clear the listener. ora and tnsnames. ora under it [Oracle @ linux1 ~] $ CAT/dev/null> $ ORACLE_HOME/Network/admin/listener. ora [Oracle @ linux1 ~] $ CAT/dev/null> $ ORACLE_HOME/Network/admin/tnsnames. ora -- use netca to configure listeners and tnsnames. ora [Oracle @ linux1 ~] $ Export display = 192.168.7.20.: 0.0 [Oracle @ linux1 ~] $ Netca -- Author: Robinson Cheng -- Blog: http://blog.csdn.net/robinson_0612 --> below is the result of using netca configuration, including listener. ora and tnsnames. ora [Oracle @ linux1 ~] $ More $ ORACLE_HOME/Network/admin/listener. ora # listener. ora network configuration file:/u01/APP/Oracle/db_1/Network/admin/listener. ora # generated by Oracle configuration tools. adr_base_listener_cnbo =/u01/APP/oraclelistener_cnbo = # -- listener name: listener_cnbo, Port: 1522 (description_list = (description = (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1522) [Oracle @ linux1 ~] $ More $ ORACLE_HOME/Network/admin/tnsnames. ora # tnsnames. ora network configuration file:/u01/APP/Oracle/db_1/Network/admin/tnsnames. ora # generated by Oracle configuration tools. cnbo = (description = (address_list = (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1522) (CONNECT_DATA = (SERVICE_NAME = cnbo.orasrv.com ))) -- The system prompts that the listener is not found and cannot be pinged because the listener we configured is not started. -- although the service is registered in the default listener, it cannot be pinged, that is, this cannot be achieved [ora CLE @ linux1 ~] $ Tnsping cnbotns Ping utility for Linux: Version 11.2.0.1.0-production on 16-aug-2013 14: 28: 47 copyright (c) 1997,200 9, Oracle. all rights reserved. used parameter files: used tnsnames adapter to resolve the aliasattempting to contact (description = (address_list = (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1522 ))) (CONNECT_DATA = (SERVICE_NAME = cnbo.orasrv.com) TNS-12541: TNS: No Li Stener -- Next we start a non-default listener [Oracle @ linux1 ~] $ LSNRCTL start listener_cnbolsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 14:29:14 .............. listening endpoints summary... (description = (address = (Protocol = TCP) (host = linux1.orasrv.com) (Port = 1522) the listener supports no services the command completed successfully [Oracle @ linux1 ~] $ LSNRCTL status listener_cnbolsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 14:30:20 ............. listening endpoints summary... (description = (address = (Protocol = TCP) (host = linux1.orasrv.com) (Port = 1522) the listener supports no services --> no services and instances are registered with the listener, N won't have an instance register the command completed successfully for a long time --> because this is non-default, and we haven't configured Dynamic Registration yet -- Next let's set Dynamic Registration -- view the parameter local_listener, this is already set, and the port is 1521, I P uses a virtual IP address. This is why after the instance is created, SQL> show parameter local_lisname type value when listener ------------------------------ local_listener string (description = (address_list = (ad dress = (Protocol = TCP) (host = linu x1-vip) (Port = 1521) -- sets Dynamic Registration and receives the error message SQL> alter system set local_listener = 'listener _ cnbo '; alter system set local_listener = 'liste Ner_cnbo '* error at line 1: ORA-02097: parameter cannot be modified because specified value is invalidORA-00119: Invalid specification for system parameter LOCAL_LISTENERORA-00132: syntax error or unresolved network name 'listener _ cnbo' -- two solutions are provided for the preceding error, -- first, set a new IP address and port according to the format of the preceding local_listener parameter value, or add this description to tnsnames. ora file -- the second solution is selected below [Oracle @ linux1 ~] $ Echo "> listener_cnbo => (address_list => (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1522)>) ">>$ ORACLE_HOME/Network/admin/tnsnames. ora -- set the parameter local_listenersql> alter system set local_listener = 'listener _ cnbo '; System altered again. -- The following shows that the instance and service have been automatically registered to the listener_cnbo listener [Oracle @ linux1 ~]. $ LSNRCTL status listener_cnbolsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 14:35:04 ................... listening endpoints summary... (description = (address = (Protocol = TCP) (host = linux1.orasrv.com) (Port = 1522) Services summary... service "cnbo.orasrv.com" has 1 instance (s ). instance "cnbo", status ready, has 1 handler (s) for this service... service "cnboxdb.orasrv.com" has 1 instanc E (s ). instance "cnbo", status ready, has 1 handler (s) for this service... the command completed successfully -- check that the original service cnbo.orasrv.com and the instance cnbo under the grid user no longer exist. [grid @ linux1 ~] $ LSNRCTL statuslsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 14:37:46 ..... listening endpoints summary... (description = (address = (Protocol = IPC) (Key = listener) (description = (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.31) (Port = 1521) Services summary... service "+ ASM" has 1 instance (s ). instance "+ ASM1", status ready, has 1 handler (s) for this service... the command completed successfully

3. Configure non-default listeners and implement static registration

-- For non-default listeners, we can also configure the static registration method for them -- first, we stop the listener and clear the listener. ora and tnsnames. ora under the Oracle user [Oracle @ linux1 ~] $ LSNRCTL stop listener_cnbo [Oracle @ linux1 ~] $ CAT/dev/null> $ ORACLE_HOME/Network/admin/listener. ora [Oracle @ linux1 ~] $ CAT/dev/null> $ ORACLE_HOME/Network/admin/tnsnames. ora SQL> alter system set local_listener = ''; -- the following uses netmgr to configure the listener and tnsnames [Oracle @ linux1 ~] $ Export display = 192.168.7.20.: 0.0 [Oracle @ linux1 ~] $ Netmgr -- The following is the configuration result. Now we use the new port number 1523 and the new listener name listener_new [Oracle @ linux1 ~]. $ More $ ORACLE_HOME/Network/admin/listener. ora # listener. ora network configuration file:/u01/APP/Oracle/db_1/Network/admin/listener. ora # generated by Oracle configuration tools. # netmgr is used to add a database service for it, that is, the sid_list_listener_new item, and netca cannot complete this task listener_new = (description = (address = (Protocol = TCP) (host = linux1.orasrv.com) (Port = 1523) adr_base_listener_new =/u01/APP/oraclesid_list_listener_new = (Sid_list = (sid_desc = (global_dbname = cnbo.orasrv.com) (ORACLE_HOME =/u01/APP/Oracle/db_1) (sid_name = cnbo) [Oracle @ linux1 ~] $ More $ ORACLE_HOME/Network/admin/tnsnames. ora # tnsnames. ora network configuration file:/u01/APP/Oracle/db_1/Network/admin/tnsnames. ora # generated by Oracle configuration tools. cnbo = (description = (address_list = (address = (Protocol = TCP) (host = linux1.orasrv.com) (Port = 1523) (CONNECT_DATA = (SERVICE_NAME = cnbo.orasrv.com ))) -- start a new listener [Oracle @ linux1 ~] $ LSNRCTL start listener_newlsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 16:02:14 ................ listening endpoints summary... (description = (address = (Protocol = TCP) (host = linux1.orasrv.com) (Port = 1523) Services summary... service "cnbo.orasrv.com" has 1 instance (s ). instance "cnbo", status unknown, has 1 handler (s) for this service... -- note that the status is unknown, indicating static registration of the command completed Successfully -- check the default listening status of the grid user. At this time, the instance cnbo is still registered [grid @ linux1 ~] $ LSNRCTL statuslsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 15:55:33 .......... listening endpoints summary... (description = (address = (Protocol = IPC) (Key = listener) (description = (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.31) (Port = 1521) Services summary... service "+ ASM" has 1 instance (s ). instance "+ ASM1", status R Eady, has 1 handler (s) for this service... service "cnbo.orasrv.com" has 1 instance (s ). instance "cnbo", status ready, has 1 handler (s) for this service... service "cnboxdb.orasrv.com" has 1 instance (s ). instance "cnbo", status ready, has 1 handler (s) for this service... the command completed successfully -- check the local_listener parameter SQL> show parameter db_namename type value ------------------------------- ----- Commandid db_name string cnbosql> show parameter local_lis --> the parameter has not been set with name type value specified -------------------------------- local_listener string -- from the above situation, although the local_listener parameter is not set, at this time, the instance is still registered to the listener. At this time, we can connect to the database through tnsnames. That is to say, the connection initiated by the client is still connected through the listener_new listener, instead of the default listener-in non-RAC Environments Oracle 10g, 11G does not need to be set local_listener, nor will it be registered to the default listener-but the cnbo service provided by the default listener under the grid user is really awkward, add the listener information to tnsnames. ora [Oracle @ linux1 ~] $ Echo "> listener_new => (address_list => (address = (Protocol = TCP) (host = linux1.orasrv.com) (Port = 1523)>) ">>$ ORACLE_HOME/Network/admin/tnsnames. ora --> set local_listenersql> alter system set local_listener = 'listener _ new'; -- The cnbo instance is no longer displayed in the following default listening status [grid @ linux1 ~] $ LSNRCTL statuslsnrctl for Linux: Version 11.2.0.1.0-production on 16-aug-2013 16:06:38 ......... listening endpoints summary... (description = (address = (Protocol = IPC) (Key = listener) (description = (address = (Protocol = TCP) (host = 192.168.7.21) (Port = 1521) (description = (address = (Protocol = TCP) (host = 192.168.7.31) (Port = 1521) Services summary... service "+ ASM" has 1 instance (s ). instance "+ ASM1", status ready, has 1 handler (s) for this service... the command completed successfully

4. Postscript
A. in the Oracle 11g RAC environment, using dbca to create a single instance database will automatically configure the instance to the default listener and default port.
B. In the Oracle 11g RAC environment, the cluster listening configuration must be completed by the grid user, which is different from the Oracle 10g RAC. For more information about the 10g RAC Listener Configuration, see the tail link.
C. Pay attention to the differences between netca and netmgr When configuring listeners. From the test above, we can see that netca cannot add database services for listeners, that is, sid_list _ <listener_cnbo>, while netmgr can. Netmgr is recommended.
D. For dynamic service registration, you must configure the local_listener parameter. either use a description string, such as description, or simplify it to the tnsnames. ora file.
E. For non-default listeners and static port registration for Oracle 11g RAC instances, if local_listener is not set, the listener is registered, but it also registers the default listener.
F. For the case described above, this phenomenon has never occurred for a single instance of 10 GB and 11 GB in a non-RAC environment. oralce should require Dynamic Registration as much as possible.

 

More references

For more information about Oracle RAC, see
Use crs_setperm to modify the resource owner and permissions of RAC.
Use crs_profile to manage RAC resource configuration files
RAC database startup and Shutdown
Oracle RAC services
Services in Oracle Database 10g
Migrate datbase from single instance to Oracle RAC
Connect Oracle RAC to a specified instance
Oracle RAC load balancing test (combined with server and client)
Oracle RAC server connection Load Balance)
Load Balance)
Non-Default port listening configuration in Oracle RAC (listener. ora tnsnames. ora)
Oracle RAC Listener Configuration (listener. ora tnsnames. ora)
Configure RAC load balancing and Failover
CRS-1006, CRS-0215 fault case
Installing Oracle 10g RAC Based on Linux (RHEL 5.5)
Use runcluvfy to verify the Oracle RAC installation environment

For more information about the basics and concepts of Oracle network configuration, see:
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 the Oracle client to connect to the database

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
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
Use RMAN for recovery from different machine backups (WIN platform)
Use RMAN to migrate a file system database to ASM
Linux RMAN backup shell script
Use RMAN to migrate the database to a different machine

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.