5 Replies Latest reply: Aug 9, 2012 9:14 PM by 954336 RSS

    When we create  one service as preferred on both nodes in  two node RAC

    954336
      How to configure listener,tnsnames.ora & listener file When we create one service as preferred on both nodes in two node RAC ... ( I don't need load balancing here but i just want to create service as preferred on both nodes)

      please some one help me in this ..
        • 1. Re: When we create  one service as preferred on both nodes in  two node RAC
          Sebastian Solbach -Dba Community-Oracle
          Hi,

          the setup for the client are independent of the setup of the service.

          You always include all nodes (pre 11.2) or only use SCAN (11.2) to connect to the database. The listener (SCAN in 11.2 and the listener in 11.1) will do the routing.

          See this whitepaper on www.oracle.com/goto/rac
          http://www.oracle.com/technetwork/products/clustering/overview/awm11gr2-130711.pdf

          There is also a 11.1 version available.

          No need to setup special things in listener.ora file. Only tnsnames.ora.

          Regards
          Sebastian
          • 2. Re: When we create  one service as preferred on both nodes in  two node RAC
            onedbguru
            Please provide the version...

            creating a service will add that service to all preferred or required nodes. how you access it will depend on the version. Pre-11gR2, you would add multiple address entries in the tnsnames.ora file. See pre-11gR2 docs for examples. As of 11gR2 there is SCAN (single client access name). There can be multiple SCAN listeners (dependent on proper configuration - http://www.lmgtfy.com/?q=oracle+scan+pdf) that will automatically connect you to a node in the cluster that has the required service name. And via jdbc: jdbc:oracle:thin@clusterSCAN:1521/myservicename. The cool thing about this is that you can control exactly which nodes in the cluster are running which service.

            Example:
            node 1 services sales,support
            node 2 services sales,shipping
            node 3 services shipping,reporting,loading

            or any combination you wish. 11gR2 is really a great step forward in your ability to really manage your workload.
            • 3. Re: When we create  one service as preferred on both nodes in  two node RAC
              954336
              Thanks alot Sebastain for your reply..

              I am using 10.2.0.4 version and below tns entry is from my client side tns entry ..


              M4AMPRD_TEST=
              (DESCRIPTION=
              (ADDRESS= (PROTOCOL=TCP) (HOST=153.88.184.228) (PORT=1521))
              (ADDRESS= (PROTOCOL=TCP) (HOST=153.88.184.229) (PORT=1521))
              (FAILOVER=ON)
              (CONNECT_DATA=(SERVICE_NAME=M4AMPRD_TEST)
              (FAILOVER_MODE=
              (TYPE=SELECT)
              (METHOD=BASIC)
              (RETRIES=20)
              (DELAY=5)
              ))
              )


              service creation: srvctl add service -d M4AMPRD -s M4AMPRD_TEST -r M4AMPRD1,M4AMPRD2

              But when i connect to database usign above service from client some times its working fine and some times its failing please see below log with timings how it is behaving ..


              SQL> set time on
              18:39:46 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
              Connected.
              18:39:48 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
              ERROR:
              ORA-12545: Connect failed because target host or object does not exist


              Warning: You are no longer connected to ORACLE.
              18:39:52 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
              Connected.
              18:39:53 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
              Connected.
              18:39:55 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
              Connected.
              18:39:57 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
              ERROR:
              ORA-12545: Connect failed because target host or object does not exist


              Warning: You are no longer connected to ORACLE.
              18:39:59 SQL> CONN m4owner/iamm4amdev!@M4AMPRD_TEST
              Connected.

              Thanks for your help in advance

              Anil Vejendla..
              • 4. Re: When we create  one service as preferred on both nodes in  two node RAC
                Sebastian Solbach -Dba Community-Oracle
                Hi,

                if you come out on the "wrong" listener, the listener will send a redirect packet to the client to tell the client to which correct listener to connect to.
                This redirect package normally includes the virtual hostname.

                I assume your client is not cabable of resolving the virtual hostname.

                Just enter the virtual hostname (with the IP addresses) in /etc/hosts and your error should be gone.

                Regards
                Sebastian
                • 5. Re: When we create  one service as preferred on both nodes in  two node RAC
                  954336
                  Thanks Sebastian,

                  It worked successfully and now the issue is Client connections are getting failed over where as application connections are not getting fail over ..

                  Can you help me in this ..

                  when i try client side connection application server box during fail over they are migrating successfully to second node but not APPLICATION CONNcetions .

                  Thanks in Advance ..

                  Anil Vejendla