9 Replies Latest reply: Apr 23, 2014 3:44 PM by teits RSS

    RAC connect string information

    kazyskiyn0w

      Hi All,

       

      In RAC environment I have 3 SCAN Listeners:

      LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent

      LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3))))                # line added by Agent

      LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2))))                # line added by Agent

      LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent

      ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent

      ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON                # line added by Agent

      ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON                # line added by Agent

      ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent

       

      During the database configuration using dbca I needed to create a local Listener (LISTENER1) and set port 1531.

       

      End user (AppServer) is asking me to send the connect string , which is a typical information of single instance Database, not RAC.

      What information should I send to end user of allication Server to connect to RAC 2 node database?

       

      Thanks,

      Kz

        • 1. Re: RAC connect string information
          teits

          hello,

          execute on node 2

          $lsnrctl status


          from here i can tell you exactly the information you need. the idea is to connect to VIP IP that is up and default on RAC 2 node.

           

          HTH

          • 2. Re: RAC connect string information
            Vandana B -Oracle

            Hi,

             

            In the below example dbname is test (and you can see that a default service test is registered, this service name would be used in connect string)

             

            Service "test" has 1 instance(s).

              Instance "test2", status READY, has 1 handler(s) for this service...

             

            Connect string example

             

            <username>/<password>@<scan name>:<port on which scan is running>/<service name>

             

            The part after @ is the connect string  (above is EZCONNECT format)

             

            Or you can also use the following (TNS format)

             

            @(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=<scan name>)(PORT=<port>))(CONNECT_DATA=(SERVICE_NAME=<service>)))

             

            Regards,

            Vandana - Oracle

            • 3. Re: RAC connect string information
              kazyskiyn0w

              lsnrctl status on node 2:

              lsnrctl status

               

               

              LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production on 23-APR-2014 07:26:06

               

               

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

               

               

              Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

              STATUS of the LISTENER

              ------------------------

              Alias                     LISTENER

              Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production

              Start Date                15-APR-2014 13:42:42

              Uptime                    2 days 17 hr. 43 min. 23 sec

              Trace Level               off

              Security                  ON: Local OS Authentication

              SNMP                      ON

              Listener Parameter File   /u01/oracle/grid11g/product/network/admin/listener.ora

              Listener Log File         /u01/oracle/grid11g/diag/srv02/listener/alert/log.xml

              Listening Endpoints Summary...

                (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

                (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.101)(PORT=1521)))

                (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.105)(PORT=1521)))

              Services Summary...

              Service "+ASM" has 1 instance(s).

                Instance "+ASM", status READY, has 1 handler(s) for this service...

              Service "PRODRAC1" has 1 instance(s).

                Instance "PRODRAC12", status READY, has 1 handler(s) for this service...

              Service "PRODRAC1XDB" has 1 instance(s).

                Instance "PRODRAC12", status READY, has 1 handler(s) for this service...

              The command completed successfully

               

              Question is: What is the SCAN information? status above seems to be about the listener I installed when executing dbca, not SCAN information. Is it correct?

              Based on information of node2 lsnrctl status, what information should I send to end user?

               

              Thanks for the replies.

              • 4. Re: RAC connect string information
                Vandana B -Oracle

                Hi,

                 

                SCAN information can be found from the following command

                 

                srvctl config scan

                 

                Regards,

                Vandana - Oracle

                • 5. Re: RAC connect string information
                  kazyskiyn0w

                  I mean, SCAN was suppose to perform load balance between 2 nodes. So, what is the information about the SCAN in the result of lsnrctl status above?

                   

                  Thanks

                  • 6. Re: RAC connect string information
                    Vandana B -Oracle

                    Hi,

                     

                    You can check that information using the following

                     

                    ps -ef | grep tns  (this will show which scan listener is running on the server, based on the same execute the following

                     

                    lsnrctl status LISTENER_SCAN<n>

                     

                    where n in the above case is the cardinal value of the scan listener running on the server

                     

                    Regards,

                    Vandana - Oracle

                    • 7. Re: RAC connect string information
                      user569403

                      B

                       

                      Hi kazyskiyn0w

                       

                      Hope below helps

                       

                      When you have scan setup on your RAC environment..  its recommeneded  to connect to  the scan regard less of user or application connection.

                       

                      Note: Make sure to set the environment  as necessary

                       

                      Step 1

                      Find the name of the scan by using the command

                      $ srvctl config scan

                       

                      Step 2

                      find the port the scan is listening on using command below

                      $ srvctl config scan_listener

                       

                      Step 3

                      Find the service name by

                      Log into one of your RAC nodes and verify the tnsnames.ora entry for your

                      service as shown below. If you have a valid service created it will

                      exist an entry in your $ORACLE_HOME/network/admin/tnsnames.ora file

                       

                      Step 4

                      Now connect to your RAC database using either  A or B method  below:

                      A.

                      EZCONNECT format  <username>/<password>@<scan-name>:<port on which scan is running>/<service name>

                      eg

                      scott/tiger@rac-scan:1521/orcl.oracle.com

                      So here here your Application will use below to connect

                      @<scan name>:<port on which scan is running>/<service name>

                      @rac-scan:1521/orcl.oracle.com

                       

                      B. If your application is using jdbc to connect send below format to them

                      jdbc connection format

                      jdbc:oracle:thin@<scan-name>:port/service-name

                      eg

                      jdbc:oracle:thin@rac-scan:1521/orcl.oracle.com

                      Have a great day

                      • 8. Re: RAC connect string information
                        kazyskiyn0w

                        Thanks

                        user569403

                        , it worked perfectly, also thanks Vandana and tetis for your kind replies, helped me a lot.

                        • 9. Re: RAC connect string information
                          teits

                          you are welcome.

                          FYI: if you want clients to connect to a particular node. you should use VIP IP address or SCAN address with singleton service.

                          you can get vip address by :

                           

                          $crsctl status res ora.node2.vip -p