Configure the Tnsname of the Oracle 11g RAC Client

Source: Internet
Author: User

1. Modify the hosts record of the Client Server
192.168.1.240 Rac01194251.241 Rac02192.168.1.242 Rac01-vip192.168.1.243 Rac02-vip108.88.3.240 Rac01-priv108.88.3.241 Rac02-priv
2. Create a New Tnsname record editing client: tnsnames. ora file, which is added as follows:
RACDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = rac02-vip) (PORT = 1521) (ADDRESS = (PROTOCOL = TCP) (HOST = rac01-vip) (PORT = 1521) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb) (FAILOVER_MODE = (TYPE = session) (METHOD = basic) (RETRIES = 180) (DELAY = 5 ))))
Iii. Test RAC Failover 1. RAC status [Oracle @ rac01 ~] $ Crs_stat-tName Type Target State Host ------------------------------------------------------------ ora .... SM1.asm application ONLINE rac01 ora .... 01. lsnr application ONLINE rac01 ora. rac01.gsd application ONLINE rac01 ora. rac01.ons application ONLINE rac01 ora. rac01.vip application ONLINE rac01 ora .... SM2.asm application ONLINE rac02 ora .... 02. lsnr applic Ation ONLINE rac02 ora. rac02.gsd application ONLINE rac02 ora. rac02.ons application ONLINE rac02 ora. rac02.vip application ONLINE rac02 ora. racdb. db application ONLINE rac01 ora .... b1.inst application ONLINE rac01 ora .... b2.inst application ONLINE rac02 [oracle @ rac01 ~] $
2. Client connection test
[Oracle @ rac01 ~] $ Sqlplus/nolog
SQL * Plus: Release 11.1.0.6.0-Production on Mon Jul 16 21:59:20 2012
Copyright (c) 1982,200 7, Oracle. All rights reserved.
SQL> conn system/oracle@racdbConnected. SQL> select instance_name from v $ instance;
INSTANCE_NAME -------------------------------- racdb1
SQL>

3. Disable node racdb1 instances
[Oracle @ rac01 ~] $ Sqlplus '/as sysdba'; SQL * Plus: Release 11.1.0.6.0-Production on Mon Jul 16 22:00:17 2012
Copyright (c) 1982,200 7, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0-ProductionWith the Partitioning, Real Application Clusters, OLAP, Data Miningand Real Application Testing options
SQL> shutdown abortORACLE instance shut down. SQL>
4. Perform a makeup test on the original client session,
SQL> conn system/oracle@racdbConnected. SQL> select instance_name from v $ instance;
INSTANCE_NAME -------------------------------- racdb1
SQL>/select instance_name from v $ instance * ERROR at line 1: ORA-25408: can not safely replay call

SQL>/
INSTANCE_NAME -------------------------------- racdb2
SQL>
Conclusion: In the RAC environment, if the current session connection node instance fails during the same session, it can be quickly switched to another section for operation, which is completely transparent to the client.

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.