Configuring Client to use SCAN 11.2.0

Server Side

Check the settings of Clusterware/Network/Database on Server Side .

Nodes information:

$ olsnodes -i  -s -n
node1        1       node1-vip    Active
node2        2       node2-vip    Active

Checking IP configured to VIP:

$ srvctl config vip -n node1
VIP exists.:node1
VIP exists.: /node1-vip/192.168.217.52/255.255.255.0/eth0

$ srvctl config vip -n node2
VIP exists.:node2
VIP exists.: /node2-vip/192.168.217.53/255.255.255.0/eth0

Checking SCAN configuration:

$ srvctl config scan
SCAN name: node-scan.oracle.com, Network: 1/192.168.217.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /node-scan.oracle.com/192.168.217.61
SCAN VIP name: scan2, IP: /node-scan.oracle.com/192.168.217.62

Checking configuration on Database:

SQL> select INST_ID, NAME, VALUE
       from gv$parameter
       where name like '%_listener%';

INST_ID NAME                 VALUE
------- -------------------- ----------------------------------------------------------------------
      1 local_listener       (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip)(PORT=1521))))
      1 remote_listener      node-scan.oracle.com:1521

      2 local_listener       (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=node2-vip)(PORT=1521))))
      2 remote_listener      node-scan.oracle.com:1521

Checking on all nodes if Service (ORCL) is registered on Both LISTENERS (SCAN/LOCAL)

Node1

Checking SCAN ( Observer that the connection will be redirected to the VIP hostname registered in the Listener SCAN (i.e node1-vip or node2-vip)


$ lsnrctl service listener_scan1

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-MAY-2011 17:43:08

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
Services Summary...
Service "orcl" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip)(PORT=1521)))
  Instance "orcl2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node2-vip)(PORT=1521)))
The command completed successfully

Checking Service on LOCAL Listener

$ lsnrctl service

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-MAY-2011 17:50:25

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
Services Summary...
...
Service "orcl" has 1 instance(s).
  Instance "orcl2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
...
The command completed successfully

Node2

Checking if Service (ORCL) is registered SCAN ( Observer that the connection will be redirected to the VIP hostname registered in the Listener SCAN (i.e node1-vip or node2-vip)


$ lsnrctl service listener_scan2

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-MAY-2011 17:54:13

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
Services Summary...
Service "orcl" has 2 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:2 refused:0 state:ready
         REMOTE SERVER
         (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip)(PORT=1521)))
  Instance "orcl2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:2 refused:0 state:ready
         REMOTE SERVER
         (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node2-vip)(PORT=1521)))
The command completed successfully

Checking Service on LOCAL Listener

$ lsnrctl service

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-MAY-2011 17:56:23

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
Services Summary...
...
Service "orcl" has 1 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
...
The command completed successfully

Everthing is ok.

Client Side

Check the settings of Network/Oracle on Client Side:

Check if SCAN is resolved by DNS.

C:\oracle>nslookup node-scan
Server:  node-dns.oracle.com
Address:  192.168.217.6

Name:    node-scan.oracle.com
Addresses:  192.168.217.62
                 192.168.217.61

Testing the reachability of hosts (SCAN, VIP):
Do not test reachability of hosts using IP (e.g ping ) , the hostname MUST be resolved. Oracle will use hostname configured on LOCAL_LISTENER parameter to establish connection.

If you do not have a DNS configured you MUST set in HOST file from all client: All hostname of vip and hostname of scan.

C:\oracle>ping node-scan

Pinging node-scan.oracle.com [192.168.217.62] with 32 bytes of data:

Reply from 192.168.217.62: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.217.62:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

C:\oracle>ping node1-vip

Pinging node1-vip.oracle.com [192.168.217.52] with 32 bytes of data:

Reply from 192.168.217.52: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.217.52:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

C:\oracle>ping node2-vip

Pinging node2-vip.oracle.com [192.168.217.53] with 32 bytes of data:

Reply from 192.168.217.53: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.217.53:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

Checking Ports is opened:

C:\oracle> telnet node-scan 1521
C:\oracle> telnet node1-vip  1521
C:\oracle> telnet node2-vip  1521

# To exit the Telnet after connection press [enter] multiple times.

e.g Port Closed
C:\oracle>telnet node-scan 1521
Connecting To node...Could not open connection to the host, on port 1521: Connect failed
Contact your sysadmin to check network problem (firewall,etc...) .

Check configuration on SQLNET.ora.
Configure TNSNAMES and EZCONNECT on DIRECTORY_PATH.

%ORACLE_HOME%/network/admin/sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

Now test connect on DATABASE using Easy Connect, starting with VIP:

C:\oracle>sqlplus system/oracle@node1-vip:1521/ORCL

SQL*Plus: Release 11.2.0.1.0 Production on Ter Mai 3 16:40:50 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Conectado a:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options

SQL>exit

C:\oracle>sqlplus system/oracle@node2-vip:1521/ORCL

SQL*Plus: Release 11.2.0.1.0 Production on Ter Mai 3 16:40:50 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Conectado a:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options

SQL>exit

C:\oracle>sqlplus system/oracle@node-scan:1521/ORCL

SQL*Plus: Release 11.2.0.1.0 Production on Ter Mai 3 16:40:50 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Conectado a:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options

SQL>exit

Configure the Service Name on TNSNAMES.ora:

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node-scan.oracle.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL)
    )
  )
C:\oracle>sqlplus system/oracle@ORCL

SQL*Plus: Release 11.2.0.1.0 Production on Ter Mai 3 16:46:51 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Conectado a:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options

SQL >
Advertisements

6 Comments on “Configuring Client to use SCAN 11.2.0”

  1. […] How to Troubleshoot Connectivity Issue with 11gR2 SCAN Name [ID 975457.1] Also you can see this : Configuring Client to use SCAN 11.2.0 Hope this helps, Reply With […]

    Like

  2. […] Hi, Use this guide to check problems in your configuration: Configuring Client to use SCAN 11.2.0 Configuring Client to use SCAN 11.2.0 I recommend you read this: SCAN-11.2.0 – What You Need to Know SCAN-11.2.0 – What You […]

    Like

  3. Rohit N says:

    Hi Levi,

    This is by far the most cogent article I’ve read on this subject i.e. configuring a Client to connect to RAC using SCAN. Concepts have been cleared. Please keep such hits coming.

    I appreciate you sharing from your sea of knowledge.

    Thanks,
    Rohit N.

    Like

    • Levi Pereira says:

      Ty for comment.

      Like

      • Ashok Kumar.G says:

        Hi Levi,

        I am able to connect via Easy Connect without setting “NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)” in %ORACLE_HOME%/network/admin/sqlnet.ora

        But my sqlnet.ora file in GRID_HOME has this parameter setting.

        Are you sure you have to set the parameter in %ORACLE_HOME%/network/admin/sqlnet.ora ??

        Thanks,
        Ashok Kumar.G

        Like

      • Levi Pereira says:

        If you was able to connect using EZCONNECT method, then you defined sqlnet.ora (EZCONNECT) on that OH, because it’s a requirement to EZCONNECT Method to work.

        Easy Connect naming is automatically configured at installation. Before using it, you may want to ensure that EZCONNECT is specified by the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file. This parameter specifies the order of naming methods Oracle Net can use to resolve connect identifiers to connect descriptors.
        http://docs.oracle.com/cd/E11882_01/network.112/e10836/naming.htm#NETAG1125

        Prior to using the easy connect naming method, make sure that EZCONNECT is specified by the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file.
        http://docs.oracle.com/cd/E11882_01/win.112/e23174/featConnecting.htm#sthref155

        Regards,
        Levi Pereira

        Like


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s