Prev: Node Fencing
Services, Failover and Load Balancing (e)
- Configure Oracle Client
- Service Failover
- Connection Failover
- Runtime Failover
- Client Load Balancing
- Server Load Balancing
Next: RAC SQL and PLSQL
In order to test failover it would be best to connect from a client outside the cluster, so we'll start by downloading and installing Oracle's Basic Instant Client (English-only) and the Instant Client SQLPlus package. Then we'll configure the DNS resolution and the local TNS naming to use the SCAN addresses.
||Some steps in this chapter are specific for Windows Hosts. You should be able to do the same if you have a Linux or Mac laptop.|
- Download Oracle's Basic (English-only) Instant Client and Oracle's Instant Client SQLPlus package from Oracle's website here:
You can omit the Instant Client instalation if you already have an Oracle 12c Client installed on your laptop.
The two files you need are:
- Each archive contains a folder named "instantclient_12_1". Extract this folder (from both archives) into C:\. (In Explorer you can drag-and-drop or you can choose "Extract All" from the File menu.)
- Open the Windows Network Settings (Control Panel -> Network and Internet -> Network and Sharing Center.
Click on VirtualBox Host-Only Network
- Click on Properties
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Select Use the following DNS server addresses: and enter the addresses of the two virtual machines:
- Preferred DNS server: 188.8.131.52
- Alternate DNS server: 184.108.40.206
Click on Advanced...
- Select the DNS tab. Select Append these DNS suffixes (in order):, click Add... and enter racattack in the Domain suffix field that appears. Click Add.
Check both Register the connection's addresses in DNS and Use this connection's DNS suffix in DNS registration.
Click OK and/or Close until you exit from the Network configuration.
- Open a Command prompt and check that the DNS resolution is working properly on your laptop:
C:\Users\luc> nslookup - 192.168.78.51 Default Server: collabn1.racattack Address: 192.168.78.51 > collabn-cluster-scan Server: collabn1.racattack Address: 192.168.78.51 Name: collabn-cluster-scan.racattack Addresses: 192.168.78.252 192.168.78.253 192.168.78.251 > ^C C:\Users\luc>
- Test your Instant Client installation by connecting to the database.
C:\instantclient_12_1> sqlplus system/racattack@//collabn-cluster-scan/RAC.racattack
SQL*Plus: Release 220.127.116.11.0 Production on Wed Aug 14 13:34:24 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 18.104.22.168.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- RAC1 SQL>
- Let's open and test our Pluggable Database PDB (it isn't opened by default).
SQL> connect sys/racattack@//collabn-cluster-scan/RAC.racattack as sysdba Connected. SQL> alter pluggable database PDB open; Pluggable database altered. SQL> connect system/racattack@//collabn-cluster-scan/PDB.racattack Connected. SQL> show con_name CON_NAME ------------------------------ PDB SQL>
- Create a TNSNAMES files and copy the RAC entry from either cluster database node. Also create a similar entry for the PDB service.
C:\instantclient_12_1> notepad C:\instantclient_12_1\tnsnames.ora RAC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = collabn-cluster-scan.racattack)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RAC.racattack) ) )
PDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = collabn-cluster-scan.racattack)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PDB.racattack) ) )
- Test your TNSNAMES by setting the TNS_ADMIN environment variable and running SQLPLUS.
C:\instantclient_12_1> set TNS_ADMIN=c:\instantclient_12_1 C:\instantclient_12_1> sqlplus system/racattack@RAC SQL*Plus: Release 22.214.171.124.0 Production on Wed Aug 14 14:21:24 2013 Copyright (c) 1982, 2013, Oracle. All rights reserved. Last Successful login time: Wed Aug 14 2013 14:20:59 +02:00 Connected to: Oracle Database 12c Enterprise Edition Release 126.96.36.199.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL> connect system/racattack@PDB Connected. SQL>