13 Replies Latest reply: Nov 28, 2012 5:46 PM by Alf_URI RSS

    Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC

    492296
      Hi All,

      I have succesfully installed 2 nodes RAC but unfortunately I'm receiving ORA-12545 Connect failed bacause target host or object does not exists in using SCAN.

      Here's my configuration.

      Global Database Name:oradb.bluecluster.com
      SID Name:oradb

      My connection properties using SqlDeveloper

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

      Oracle Version:

      SQL> select * from v$version;

      BANNER
      Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
      PL/SQL Release 11.2.0.1.0 - Production
      CORE 11.2.0.1.0 Production
      TNS for Linux: Version 11.2.0.1.0 - Production
      NLSRTL Version 11.2.0.1.0 - Productio

      In DNS

      #Public
      192.168.30.201 rac1.bluecluster.com rac1
      192.168.30.202 rac2.bluecluster.com rac2

      #Virtual
      192.168.30.203 rac1-vip.bluecluster.com rac1-vip
      192.168.30.204 rac2-vip.bluecluster.com rac2-vip

      #Scan
      192.168.30.205 rac-scan.bluecluster.com rac-scan
      192.168.30.206 rac-scan.bluecluster.com rac-scan
      192.168.30.207 rac-scan.bluecluster.com rac-scan

      In RAC1:
      local_listener =(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip.bluecluster.com)(PORT=1521))))
      remote_listener =rac-scan.bluecluster.com:1521

      In RAC2:
      local_listener =(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip.bluecluster.com)(PORT=1521))))
      remote_listener =rac-scan.bluecluster.com:1521

      [oracle@rac1 ~]$ srvctl config scan

      SCAN name: rac-scan.bluecluster.com, Network: 1/192.168.30.0/255.255.255.0/eth6
      SCAN VIP name: scan1, IP: /192.168.30.207/192.168.30.207
      SCAN VIP name: scan2, IP: /rac-scan.bluecluster.com/192.168.30.205
      SCAN VIP name: scan3, IP: /192.168.30.206/192.168.30.206

      [oracle@rac1 ~]$ srvctl status scan

      SCAN VIP scan1 is enabled
      SCAN VIP scan1 is running on node rac2
      SCAN VIP scan2 is enabled
      SCAN VIP scan2 is running on node rac1
      SCAN VIP scan3 is enabled
      SCAN VIP scan3 is running on node rac1

      [oracle@rac1 ~]$ srvctl config scan_listener;

      SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
      SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
      SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

      [oracle@rac1 ~]$ srvctl status scan_listener;

      SCAN Listener LISTENER_SCAN1 is enabled
      SCAN listener LISTENER_SCAN1 is running on node rac2
      SCAN Listener LISTENER_SCAN2 is enabled
      SCAN listener LISTENER_SCAN2 is running on node rac1
      SCAN Listener LISTENER_SCAN3 is enabled
      SCAN listener LISTENER_SCAN3 is running on node rac1

      Really appreciate if you can share your experiences in a successful SCAN connection.

      Regards,
      Benjie
        • 1. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
          rajeysh
          ORA-12545: Connect failed because target host or object does not exist
              Cause: The address specified is not valid, or the program being connected to does not exist.
               
          
              Action: Ensure the ADDRESS parameters have been entered correctly; the most likely incorrect parameter is the node name. 
          Ensure that the executable for the server exists (perhaps "oracle" is missing.) If the protocol is TCP/IP, 
          edit the TNSNAMES.ORA file to change the host name to a numeric IP address and try again.
          * making sure that your listener is running (lsnrcrl stat)
          * testing connectivity with ping, and then tnsping.
          * verifying connectivity via the DNS (e.g. /etc/hosts)
          * make sure to check your tnsnames.ora parms.
          * also make sure passwordfile exists

          Also important in resolving ORA-12545 if using VIP's is to "start by verifying connectivity via the DNS (e.g. /etc/hosts), and make sure to check your tnsnames.ora parms."
          • 2. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
            492296
            Thanks for youre reply.

            All the points you said were all taken into considerations, All are working fine. But still i'm unable to connect via SCAN. I can connect Using the ip addresses of the 2 nodes and VIP's, but not for SCAN. Any other clues?

            Regards,
            Benjie

            Edited by: user489293 on Jul 5, 2010 2:12 AM
            • 3. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
              492296
              Still no luck to connect via SCAN. Im able to connect using EZConnect using the configuration below.

              jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=ON)(LOAD_BALANCE=ON)
              (ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip.bluecluster.com)(PORT=1521))
              (ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip.bluecluster.com)(PORT=1521))
              (CONNECT_DATA =
              (SERVER = DEDICATED)
              (SERVICE_NAME = oradb.bluecluster.com)
              ))

              jdbc:oracle:thin:@rac1.bluecluster.com:1521/oradb.bluecluster.com

              jdbc:oracle:thin:@rac1-vip.bluecluster.com:1521/oradb.bluecluster.com

              jdbc:oracle:thin:@rac2.bluecluster.com:1521/oradb.bluecluster.com

              jdbc:oracle:thin:@rac2-vip.bluecluster.com:1521/oradb.bluecluster.com


              Hope someone out there can share your connection using SCAN.

              Regards,
              Benjie
              • 4. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                user10567541
                I've had the same problem.
                I could connect fine using the 10g method, with all hosts defined in the TNS name, but could not connect using the SCAN name.

                The only way I could get it to work with SCAN was by resetting the local_listener parameter to use the scan address:
                LOCAL_LISTENER=scanname.yourdomain.com:1521

                This seems a little odd to me, especially considering that when creating the database through dbca, it automatically sets local_listener to a node specific value like: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1-vip)(PORT=1522))))

                But I've learned not to question oracle... just do what I have to to make it work.
                • 5. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                  186931
                  I had the same issue.

                  What I did to make scan work was:

                  I added vip address to client's host file and I was able to connect using scan.

                  I am still researching on why it requires VIP address in client's hosts file.

                  Thank You.
                  • 6. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                    Sebastian Solbach -Dba Community-Oracle
                    Hi,
                    the reason is pretty simple:

                    SCAN Listener works like a remote listener and will forward any connection request to the local listener which runs on the local VIP.
                    This forwarding is done with the virutal hostname.
                    Hence for the client to be able to connect the client has to have the ability to resolve the virutal hostname.
                    If it cannot, you get an error.

                    PS: You can see that if you enable sqlnet client tracing. You would be able to see the forwarding request to connect to the local listener on the virtual hostname.

                    Hope that clarifies it

                    Regards
                    Sebastian
                    • 7. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                      user57969
                      We had the same issue. And we've solved it.

                      The reason is that the SCAN listener is only a front to the local listeners on each node. Once the SCAN interface determines what node to send you to it will basically change the connect string to the connect string of the local listener. The value of the local listener host for some reasons get from "local_listener" database initialisation parameter. By default you can have VIP adresses without domain name. If your DNS does not resolve nodes shortnames (which is quite common) SCAN does not know where is the node hosts and raise "ORA-12545: Connect failed because target host or object does not exist".

                      The way we have used on our installations is updating local listener parameters like following


                      alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ltdb22-vip*.gridpp.rl.ac.uk*)(PORT=1521))))' sid='rlt2' scope=both;

                      alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ltdb21-vip*.gridpp.rl.ac.uk*)(PORT=1521))))' sid='rlt1' scope=both;

                      Hope it will helps.

                      Eter Pani
                      http://lcgwww.gridpp.rl.ac.uk/dbblog/
                      • 8. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                        user9044291
                        Amazing. That helped me a lot. Simple and logical answer.

                        Thanks

                        :)
                        • 9. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                          733071
                          Great answer. Solved my problem by adding the vip entries to the client /etc/hosts file.

                          Thanks,
                          Omer
                          • 10. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                            darkdan
                            I've set parameter "remote_listener" for all databases I need, then all SCAN listeners immediately begins support connect to that databases.

                            alter system set remote_listener='scan-domain-name.example.com:1521' scope=both sid='*';

                            That's all.

                            Regards,
                            Dan

                            Edited by: darkdan on Aug 2, 2011 8:13 PM
                            • 11. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                              838693
                              Thanks a bunch, this worked like a champ!
                              • 12. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                                Alf_URI
                                Hi All:
                                Don't chancge anything before you do some basic scan checks to make sure the client is able to communicate/resolve using scan: Depending on how you set your RAC environment it might vary a bit but it should be basically about the same concept: DNS without GNS or DNS with GNS: in either case the idea behind the scan is to make things easier **but nothing** is easier if we don't understand how things work, much worse is when Oracle don't seem to be able to explain in detail how all these products and technologies work nor there is any good documentation and If you ask for support it will get to the point where they will tell you **is between you and your network engineers*** we only support the database piece. But guest what you sold me the db piece with all these other feature (RAC, SCAN, GNS, etc) around it!

                                Anyways to make the long story short and after several installs, SRs, and abusing my network/security/storage engineers, I finally (kinda) coming to figuring things out:

                                On my case I've set 11gR2 RAC SCAN using DNS, DHCP, and the fancies of all mothers of Oracle or the RAC "GNS" :

                                IN any case you need to make sure:
                                You're clients are able to:

                                1) check that you can resolve SCAN through the DNS server on my case and using TNS/sqlplus:
                                $nslookup uscan
                                Server: 172.16.1.13
                                Address: 172.16.1.13#53

                                Non-authoritative answer:
                                Name: uscan.urac.urimagination.com
                                Address: 172.16.1.97
                                Name: uscan.urac.urimagination.com
                                Address: 172.16.1.99
                                Name: uscan.urac.urimagination.com
                                Address: 172.16.1.95

                                also ping should work:
                                ping -c5 uscan
                                PING uscan.urac.urimagination.com (172.16.1.95) 56(84) bytes of data.
                                64 bytes from 172.16.1.95: icmp_seq=1 ttl=64 time=1.07 ms
                                64 bytes from 172.16.1.95: icmp_seq=2 ttl=64 time=0.239 ms
                                64 bytes from 172.16.1.95: icmp_seq=3 ttl=64 time=0.287 ms
                                64 bytes from 172.16.1.95: icmp_seq=4 ttl=64 time=0.233 ms
                                64 bytes from 172.16.1.95: icmp_seq=5 ttl=64 time=0.226 ms

                                if you can't resolve scan then you might need to add the DNS server IP to the client(s) resolv.conf file: on my case:

                                once the above check out:
                                you can connect as follow:
                                On client:
                                11/24/2012 12:22:51 oracle:rhel6em12c:uremdb:/home/oracle >
                                $ sqlplus system/*****@uscan:1521/uopsts.urimagination.com

                                SQL*Plus: Release 11.2.0.3.0 Production on Sat Nov 24 12:22:58 2012

                                Copyright (c) 1982, 2011, Oracle. All rights reserved.

                                Connected to:
                                Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
                                With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
                                Data Mining and Real Application Testing options

                                Elapsed: 00:00:00.01
                                12:23:00 SYSTEM:uopsts2:11.2.0.3:uracops2 >set linesize 199
                                12:23:12 SYSTEM:uopsts2:11.2.0.3:uracops2 >column host_name format a25
                                12:23:12 SYSTEM:uopsts2:11.2.0.3:uracops2 >select instance_name, host_name, version, startup_time, status, instance_role
                                12:23:23 2 from v$instance;

                                INSTANCE_NAME HOST_NAME VERSION STARTUP_T STATUS INSTANCE_ROLE
                                ---------------- ------------------------- ----------------- --------- ------------ ------------------
                                uopsts2 uracops2 11.2.0.3.0 24-NOV-12 OPEN PRIMARY_INSTANCE

                                Elapsed: 00:00:00.00
                                12:24:18 SYSTEM:uopsts2:11.2.0.3:uracops2 >show parameters _listener

                                NAME TYPE VALUE
                                ------------------------------------ ----------- ------------------------------
                                local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
                                DRESS=(PROTOCOL=TCP)(HOST=172.
                                16.1.98)(PORT=1521))))
                                remote_listener string uscan.urac.urimagination.com:1
                                521
                                12:50:37 SYSTEM:uopsts2:11.2.0.3:uracops2 > exit


                                11/24/2012 12:24:46 oracle:rhel6em12c:uremdb:/home/oracle >
                                sqlplus system/****@uscan:1521/uopsts.urimagination.com

                                SQL*Plus: Release 11.2.0.3.0 Production on Sat Nov 24 12:25:26 2012

                                Copyright (c) 1982, 2011, Oracle. All rights reserved.


                                Connected to:
                                Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
                                With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
                                Data Mining and Real Application Testing options

                                Elapsed: 00:00:00.01
                                12:25:27 SYSTEM:uopsts1:11.2.0.3:uracops1 >set lines 199
                                12:25:37 SYSTEM:uopsts1:11.2.0.3:uracops1 >col host_name for a25
                                12:25:44 SYSTEM:uopsts1:11.2.0.3:uracops1 >select instance_name, host_name, version, startup_time, status, instance_role
                                12:25:45 2 from v$instance;

                                INSTANCE_NAME HOST_NAME VERSION STARTUP_T STATUS INSTANCE_ROLE
                                ---------------- ------------------------- ----------------- --------- ------------ ------------------
                                uopsts1 uracops1 11.2.0.3.0 24-NOV-12 OPEN PRIMARY_INSTANCE

                                Elapsed: 00:00:00.00
                                12:25:46 SYSTEM:uopsts1:11.2.0.3:uracops1 >show parameters _listener

                                NAME TYPE VALUE
                                ------------------------------------ ----------- ------------------------------
                                local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
                                DRESS=(PROTOCOL=TCP)(HOST=172.
                                16.1.96)(PORT=1521))))
                                remote_listener string uscan.urac.urimagination.com:1
                                521
                                12:49:38 SYSTEM:uopsts1:11.2.0.3:uracops1 >

                                Now my next challenge is make my SQL-Deverloper work from my MAC using jdbc thin connections string using the scan: it work only when I connect directly to each instance but using scan on my case will be uscan:

                                jdbc:oracle:thin:system/****@//uscan:1521/uopsts.urimagination.com

                                So let's do checks:
                                1) firs added the resolving DNS server IP to the /etc/resolv.conf file on my mac:
                                Alfs-MacBook-Pro:~ admin$ cat /etc/resolv.conf
                                #
                                # Mac OS X Notice
                                #
                                # This file is not used by the host name and address resolution
                                # or the DNS query routing mechanisms used by most processes on
                                # this Mac OS X system.
                                #
                                # This file is automatically generated.
                                #
                                search urimagination.com urac.urimagination.com
                                nameserver 172.16.1.13
                                nameserver 24.29.99.35
                                nameserver 24.29.99.36
                                nameserver 172.16.1.101
                                Alfs-MacBook-Pro:~ admin$

                                2) then I was able to nslookup the scan on my case: uscan
                                Alfs-MacBook-Pro:~ admin$ nslookup uscan
                                Server:          172.16.1.13
                                Address:     172.16.1.13#53

                                Non-authoritative answer:
                                Name:     uscan.urac.urimagination.com
                                Address: 172.16.1.95
                                Name:     uscan.urac.urimagination.com
                                Address: 172.16.1.97
                                Name:     uscan.urac.urimagination.com
                                Address: 172.16.1.99

                                Alfs-MacBook-Pro:~ admin$

                                But still there is communication contact using scan according SQL Developer:
                                ..
                                jdbc:oracle:thin:@uscan:1521/uopsts.urimagination.com
                                Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
                                ...
                                so went to my Mac /etc/hosts file and tried to cheat by adding:

                                Alfs-MacBook-Pro:~ admin$ cat /etc/hosts
                                ##
                                # Host Database
                                ##
                                # localhost is used to configure the loopback interface
                                # when the system is booting. Do not change this entry.
                                ##
                                127.0.0.1     localhost
                                255.255.255.255     broadcasthost
                                10.33.51.218 bai-10g-grdctrl
                                xxx.. bai-10g-grdctrl.baisidirect.com
                                xxx...     opsujira.urimation.com           opsujira
                                xxx     rhel6.urimagination.local     rhel6
                                xxxx     rhel6em12c.urimagination.local rhel6em12c
                                xxxx     win08sr1.urimagination.com     win08sr1
                                172.16.1.40 uracops1.urimagination.com     uracops1 >>> this works using jdbc
                                172.16.1.41 uracops2.urimagination.com uracops2 >>>> this work using jdbc
                                172.16.1.14      uscan.urac.urimagination.com     uscan >>>> I added the GNS VIP thi but not this

                                Alfs-MacBook-Pro:~ admin$

                                so check is scan responses to my ping

                                Alfs-MacBook-Pro:~ admin$ ping -c3 uscan
                                PING uscan.urac.urimagination.com (172.16.1.14): 56 data bytes
                                64 bytes from 172.16.1.14: icmp_seq=0 ttl=64 time=2.608 ms
                                64 bytes from 172.16.1.14: icmp_seq=1 ttl=64 time=3.627 ms
                                64 bytes from 172.16.1.14: icmp_seq=2 ttl=64 time=3.855 ms

                                --- uscan.urac.urimagination.com ping statistics ---
                                3 packets transmitted, 3 packets received, 0.0% packet loss
                                round-trip min/avg/max/stddev = 2.608/3.363/3.855/0.542 ms
                                Alfs-MacBook-Pro:~ admin$
                                nor will it work trying on any of the vip generated by DHCP server:


                                So all should be find now, I added the GNS VIP thinking that I got a way with it, but not. It still doesn't understands that connection string as I'm using it:
                                Again connection directly to each instance connection ok as in:
                                jdbc:oracle:thin:@uracops2.urimagination.com:1521:uopsts2

                                No change or modification to any /etc/hosts nor /etc/resolv.conf files at all so at this point I not able to figure out what I'm missing...
                                I will keep digging in... until next...

                                Cheers
                                Alf
                                • 13. Re: Ora-12545 error in using SCAN  of  Oracle 11g Release 2 RAC
                                  Alf_URI
                                  Hi all
                                  Here is a follow up for the jdbc connection using scan issue, it has been resolved:

                                  I was able to figure the jdbc connection issue with help from my network team: So using sqldeveloper 3.1.07 on Mac:

                                  This involves two parts: Let's call this all "connection using scan using jdbc thin driver"
                                  Part One:
                                  Make sure you can resolve the scan on your client machine on my case I'm using my Mac:
                                  1) Make sure you add/have the DNS server IP that is being used to resolve the scan vips/listeners on:
                                  System Preferences ==> Network ===> Advance ===> DNS:
                                  On the right side DNS Servers: DNS server IP that is being used to resolve the scan vips/listeners
                                  On the left side search Domains: add the subdomain that was assigned for the rac environment for instance on my is ugrid.urimagination.com
                                  Then Ok ==> Apply ===> Close:

                                  Now on a terminal/shell window make sure you're able to resolve using the scan name, in my case I'm using: uscan.ugrid.urimagination.com
                                  Alfs-MacBook-Pro:~ admin$ nslookup uscan
                                  Server:          172.16.1.13
                                  Address:     172.16.1.13#53

                                  Non-authoritative answer:
                                  Name:     uscan.ugrid.urimagination.com
                                  Address: 172.16.1.89
                                  Name:     uscan.ugrid.urimagination.com
                                  Address: 172.16.1.82
                                  Name:     uscan.ugrid.urimagination.com
                                  Address: 172.16.1.91

                                  Alfs-MacBook-Pro:~ admin$


                                  Part Two:
                                  Now configure client/connection application on my I'm using sqldeveloper 3.1.07 on my Mac:
                                  On connection(s) window on my connection properties are as follow:
                                  Connection Name: uospsts_jdbc_uscan
                                  Username.......: system
                                  Password.......: ******
                                  Connection Tyep: Advance and Role: default
                                  Custom JDBC URL:
                                  jdbc:oracle:thin:@uscan:1521/uopsts.urimagination.com

                                  Then connected:
                                  Let's do a quick test to see where the uscan took us:

                                  select instance_name, host_name, version, startup_time, status, instance_role
                                  from v$instance
                                  So this time the uscan took us to instance 2 on nod2:
                                  "INSTANCE_NAME", "HOST_NAME",      "VERSION",      "STARTUP_TIME", "STATUS", "INSTANCE_ROLE"
                                  uopsts2          uracops2     11.2.0.3.0     28-NOV-12     OPEN     PRIMARY_INSTANCE

                                  Connect from another session:
                                  So this time the uscan took us to instance 1 on nod1:
                                  "INSTANCE_NAME", "HOST_NAME",      "VERSION",      "STARTUP_TIME", "STATUS", "INSTANCE_ROLE"
                                  uopsts1          uracops1     11.2.0.3.0     28-NOV-12     OPEN     PRIMARY_INSTANCE

                                  Ok folks hope this helps and until next time:

                                  Cheers
                                  Alf