In this Document Goal Solution Verify SCAN Setup Steps More Information References
JDBC - Version: 11.1.0.7 to 11.2.0.2.0 - Release: 11.1 to 11.2 Information in this document applies to any platform.
With the introduction of 11g r2 RDBMS RAC, clusters can be created using SCAN (Single Client Access Name) as described in this white paper below:
http://www.oracle.com/technetwork/database/clustering/overview/scan-129069.pdf
In this how to, we use a SCAN JDBC URL to verify that we can load balance connections to the RAC nodes using a SCAN address.
Verify SCAN Setup
- Log into one of you RAC nodes and verify the tnsnames.ora entry for your service as shown below. If you have a valid service created, there will exist an entry in your $ORACLE_HOME/network/admin/tnsnames.ora file.
pas_srv = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = apctcsol1)(PORT = 1521)) (LOAD_BALANCE = YES) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pas_srv) ) )
- Test using SQL*Plus as shown below to verify you can connect.
[oradb1@auw2k3 admin]$ sqlplus scott/tiger@pas_srv
SQL*Plus: Release 11.2.0.2.0 Production on Tue Feb 1 09:23:03 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options
SQL>
- Run some SQL as follows to check the instance you are connected to.
SQL> col "Instance" format a25 SQL> col "Hostname" format a25 SQL> col "Service" format a25 SQL> select sys_context('userenv', 'instance_name') as "Instance", 2 sys_context('userenv', 'server_host') as "Hostname", 3 sys_context('userenv', 'service_name') as "Service" 4 from dual;
Instance Hostname Service ------------------------- ------------------------- ------------------------- A12 auw2k4 pas_srv
SQL>
- Repeat #2 and #3 to verify you are load balancing nodes from SQL*Plus.
SQL> col "Instance" format a25 SQL> col "Hostname" format a25 SQL> col "Service" format a25 SQL> SQL> select sys_context('userenv', 'instance_name') as "Instance", 2 sys_context('userenv', 'server_host') as "Hostname", 3 sys_context('userenv', 'service_name') as "Service" 4 from dual;
Instance Hostname Service ------------------------- ------------------------- ------------------------- A11 auw2k3 pas_srv
- Determine the SCAN host/port by connecting to any of the RAC instances in the cluster as shown below.
SQL> show parameter remote_listener
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ remote_listener string apctcsol1:1521 SQL>
- Check the SCAN listener is running as shown by the 2 commands below.
[oradb1@auw2k3 admin]$ srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
[oradb1@auw2k3 admin]$ srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is running on node auw2k3
[oradb1@auw2k3 ~]$ srvctl config scan SCAN name: apctcsol1, Network: 1/10.187.80.0/255.255.254.0/eth1 SCAN VIP name: scan1, IP: /apctcsol1.au.oracle.com/10.187.80.129
|