RAC Attack - Oracle Cluster Database at Home/RAC Attack 12c/Configure Oracle Client


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.



  1. Download Oracle's Basic (English-only) Instant Client and Oracle's Instant Client SQLPlus package from Oracle's website here:

    http://www.oracle.com/technetwork/topics/winx64soft-089540.html



    The two files you need are:

    • instantclient-basiclite-windows.x64-12.1.0.1.0.zip
    • instantclient-sqlplus-windows.x64-12.1.0.1.0.zip
  2. 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.)
  3. Open the Windows Network Settings (Control Panel -> Network and Internet -> Network and Sharing Center.

    Click on VirtualBox Host-Only Network


    RA-Windows_7-Network Settings

  4. Click on Properties

    RA-Windows_7-Network Status

  5. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.


    RA-Windows_7-Network Properties

  6. Select Use the following DNS server addresses: and enter the addresses of the two virtual machines:
    • Preferred DNS server: 192.178.78.51
    • Alternate DNS server: 192.178.78.52

    Click on Advanced...


    RA-Windows_7-Network IPV4 Properties

  7. 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.

    RA-Windows_7-Network IPV4 Advanced Properties

  8. 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>
    

    RA-Windows_7-Nslookup Scan

  9. 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 12.1.0.1.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 12.1.0.1.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>
    
  10. 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>
    
  11. 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)
        )
      )
    
  12. 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 12.1.0.1.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 12.1.0.1.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>
    


Last modified on 15 September 2013, at 09:15