7 Replies Latest reply on Dec 6, 2010 3:48 PM by 821202

    "Error: ORA-12560:  TNS: protocol adapter error"

    821202
      Hello everyone my name is Dilshad, someone please help me this is urgent. I have Windows XP, I tried the loop adapter method that didn't work, then I tried the IP address method for dns server and original that didn't work, I even reinstalled oracle10g on it but I keep getting this error message: "Error: ORA-12560: TNS: protocol adapter error" Why is this happening? I have done most things to correct but still invalid. Someone please email me: dilshad40@hotmail.com
        • 1. Re: "Error: ORA-12560:  TNS: protocol adapter error"
          EdStevens
          user4052131 wrote:
          Hello everyone my name is Dilshad, someone please help me this is urgent.
          Then you should open an SR with Oracle. But given that you seem to be trying to set up either just a client machine or a machine not used for a customer-facing, revenu-producing production database (as evidenced by the fact you are doing this on XP) I doubt if even they would consider it "urgent".

          I have Windows XP, I tried the loop adapter method that didn't work, then I tried the IP address method for dns server and original that didn't work, I even reinstalled oracle10g on it but I keep getting this error message: "Error: ORA-12560: TNS: protocol adapter error" Why is this happening? I have done most things to correct but still invalid.
          I'm sorry, but I wasn't looking over your shoulder when you did this, so I have no idea what you did or where you got the reported error.

          Are you trying to connect to a database that is on this same XP machine you are using for a client?

          If yes, then you don't need to worry about your hosts file, the DNS, loopback adapters, etc. just yet. You don't even need to have a listener running. You only need to have the environment variables ORACLE_HOME and ORACLE_SID set, and the Windows service that supports your ORACLE_SID to be running.

          So, at a command prompt enter these commands:
          set
          sqlplus / as sysdba
          Copy the entire session, and paste it back to your next posting.
          Someone please email me: dilshad40@hotmail.com
          Post to the forum, read from the forum.
          • 2. Re: "Error: ORA-12560:  TNS: protocol adapter error"
            821202
            Hello Steve thanks for responding, I am using all of the materials in the system for my class. Meaning including server and client the main mission is to do all things with Sql writing commands reading etc but I get that error. I did what you said on command prompt and this is what I get:

            Microsoft Windows XP [Version 5.1.2600]
            (C) Copyright 1985-2001 Microsoft Corp.

            C:\Documents and Settings\User>set sqlplus / as sysdba
            Environment variable sqlplus / as not defined

            C:\Documents and Settings\User>set
            ALLUSERSPROFILE=C:\Documents and Settings\All Users
            APPDATA=C:\Documents and Settings\User\Application Data
            CLIENTNAME=Console
            CommonProgramFiles=C:\Program Files\Common Files
            COMPUTERNAME=T42
            ComSpec=C:\WINDOWS\system32\cmd.exe
            FP_NO_HOST_CHECK=NO
            HOMEDRIVE=C:
            HOMEPATH=\Documents and Settings\User
            IBMSHARE=C:\IBMSHARE
            LOGONSERVER=\\T42
            NUMBER_OF_PROCESSORS=1
            OS=Windows_NT
            Path=C:\oracle\product\10.2.0\db_2\bin;C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WI
            NDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technolo
            gies\ATI Control Panel;C:\WINDOWS\Downloaded Program Files;C:\IBMTOOLS\Python22;
            C:\Program Files\PC-Doctor for Windows\services
            PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.pyo;.pyc;.py;.pyw
            PERL5LIB=C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib\MSWin32-x86;C:\oracle\prod
            uct\10.2.0\db_2\perl\5.8.3\lib;C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib\MSWi
            n32-x86;C:\oracle\product\10.2.0\db_2\perl\site\5.8.3;C:\oracle\product\10.2.0\d
            b_2\perl\site\5.8.3\lib;C:\oracle\product\10.2.0\db_2\sysman\admin\scripts;
            PROCESSOR_ARCHITECTURE=x86
            PROCESSOR_IDENTIFIER=x86 Family 6 Model 9 Stepping 5, GenuineIntel
            PROCESSOR_LEVEL=6
            PROCESSOR_REVISION=0905
            ProgramFiles=C:\Program Files
            PROMPT=$P$G
            PYTHONCASEOK=1
            PYTHONPATH=C:\IBMTOOLS\utils\support;C:\IBMTOOLS\utils\logger
            RRU=C:\Program Files\IBM\IBM Rapid Restore Ultra\
            SESSIONNAME=Console
            SystemDrive=C:
            SystemRoot=C:\WINDOWS
            TCL_LIBRARY=C:\IBMTOOLS\Python22\tcl\tcl8.4
            TEMP=C:\DOCUME~1\User\LOCALS~1\Temp
            TK_LIBRARY=C:\IBMTOOLS\Python22\tcl\tk8.4
            TMP=C:\DOCUME~1\User\LOCALS~1\Temp
            USERDOMAIN=T42
            USERNAME=User
            USERPROFILE=C:\Documents and Settings\User
            windir=C:\WINDOWS

            C:\Documents and Settings\User>sqlplus / as sysdba

            SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 5 10:28:14 2010

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

            ERROR:
            ORA-12560: TNS:protocol adapter error


            Enter user-name: ^V
            • 3. Re: "Error: ORA-12560:  TNS: protocol adapter error"
              EdStevens
              user4052131 wrote:
              Hello Steve thanks for responding, I am using all of the materials in the system for my class. Meaning including server and client the main mission is to do all things with Sql writing commands reading etc but I get that error. I did what you said on command prompt and this is what I get:

              Microsoft Windows XP [Version 5.1.2600]
              (C) Copyright 1985-2001 Microsoft Corp.

              C:\Documents and Settings\User>set sqlplus / as sysdba
              Environment variable sqlplus / as not defined
              I gave you two separate commands. You combined them into one .....

              >
              C:\Documents and Settings\User>set
              ALLUSERSPROFILE=C:\Documents and Settings\All Users
              APPDATA=C:\Documents and Settings\User\Application Data
              CLIENTNAME=Console
              CommonProgramFiles=C:\Program Files\Common Files
              COMPUTERNAME=T42
              ComSpec=C:\WINDOWS\system32\cmd.exe
              FP_NO_HOST_CHECK=NO
              HOMEDRIVE=C:
              HOMEPATH=\Documents and Settings\User
              IBMSHARE=C:\IBMSHARE
              LOGONSERVER=\\T42
              NUMBER_OF_PROCESSORS=1
              OS=Windows_NT
              Path=C:\oracle\product\10.2.0\db_2\bin;C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WI
              NDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technolo
              gies\ATI Control Panel;C:\WINDOWS\Downloaded Program Files;C:\IBMTOOLS\Python22;
              C:\Program Files\PC-Doctor for Windows\services
              PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.pyo;.pyc;.py;.pyw
              PERL5LIB=C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib\MSWin32-x86;C:\oracle\prod
              uct\10.2.0\db_2\perl\5.8.3\lib;C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib\MSWi
              n32-x86;C:\oracle\product\10.2.0\db_2\perl\site\5.8.3;C:\oracle\product\10.2.0\d
              b_2\perl\site\5.8.3\lib;C:\oracle\product\10.2.0\db_2\sysman\admin\scripts;
              PROCESSOR_ARCHITECTURE=x86
              PROCESSOR_IDENTIFIER=x86 Family 6 Model 9 Stepping 5, GenuineIntel
              PROCESSOR_LEVEL=6
              PROCESSOR_REVISION=0905
              ProgramFiles=C:\Program Files
              PROMPT=$P$G
              PYTHONCASEOK=1
              PYTHONPATH=C:\IBMTOOLS\utils\support;C:\IBMTOOLS\utils\logger
              RRU=C:\Program Files\IBM\IBM Rapid Restore Ultra\
              SESSIONNAME=Console
              SystemDrive=C:
              SystemRoot=C:\WINDOWS
              TCL_LIBRARY=C:\IBMTOOLS\Python22\tcl\tcl8.4
              TEMP=C:\DOCUME~1\User\LOCALS~1\Temp
              TK_LIBRARY=C:\IBMTOOLS\Python22\tcl\tk8.4
              TMP=C:\DOCUME~1\User\LOCALS~1\Temp
              USERDOMAIN=T42
              USERNAME=User
              USERPROFILE=C:\Documents and Settings\User
              windir=C:\WINDOWS
              You have not set ORACLE_HOME.
              You have not set ORACLE_SID
              C:\Documents and Settings\User>sqlplus / as sysdba

              SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 5 10:28:14 2010

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

              ERROR:
              ORA-12560: TNS:protocol adapter error
              That is the expected error when ORACLE_SID is not set.
              >
              Enter user-name: ^V
              A couple of important points.

              First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, with the default name of LISTENER, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners or to name the listener as if it belongs to a particular database. That would be like the telephone company building a separate switchboard for each customer.

              Additional notes on the listener: One listener is capable of listening on multiple ports. But please notice that it is the listener using these ports, not the database instance. You can't bind a specific listener port to a specific db instance. Similarly, one listener is capable of listnening on multiple IP addresses (in the case of a server with multiple NICs) But just like the port, you can't bind a specific ip address to a specific db instance.

              Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.

              Assume you have the following in your tnsnames.ora:
              larry =
                (DESCRIPTION =
                  (ADDRESS_LIST =
                    (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
                  )
                  (CONNECT_DATA =
                    (SERVICE_NAME = curley)
                  )
                )
              Now, when you issue a connect, say like this:
              $> sqlplus scott/tiger@larry
              tns will look in your tnsnames.ora for an entry called 'larry'. Finding it, tns sends a request through the normal network stack to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).

              Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.

              Next, the standard networking process delivers the message to port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, the listener will spawn a server process to act as the intermediary between your client and the database instance. Communication to the server process will be on a randomly selected available port. At that point the listener is out of the process and continues to user port 1521 to await other connection requests.



              What can go wrong?

              First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.

              Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"

              Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"

              Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"

              Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"

              Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"

              Third: If the client is on the same machine as the db instance, it is possible to connect without referencing tnsnames and without going through the listener.

              Now, when you issue a connect, say like this:
              $> sqlplus scott/tiger
              tns will attempt to establish an IPC connection to the db instance. How does it know the name of the instance? It uses the current value of the enviornment variable ORACLE_SID. So...
              $> export ORACLE_SID=fred
              $> sqlplus scott/tiger
              It will attempt to connect to the instance known as "fred". If there is no such instance, it will, of course, fail. Also, if there is no value set for ORACLE_SID, the connect will fail.

              check executing instances to get the SID
              [oracle@vmlnx01 ~]$ ps -ef|grep pmon|grep -v grep
              oracle    4236     1  0 10:30 ?        00:00:00 ora_pmon_vlnxora1
              set ORACLE_SID appropriately, and connect
              [oracle@vmlnx01 ~]$ export ORACLE_SID='vlnxora1
              [oracle@vmlnx01 ~]$ sqlplus scott/tiger
              
              SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:37 2010
              
              Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
              
              
              Connected to:
              Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
              With the Partitioning, OLAP, Data Mining and Real Application Testing options
              Now set ORACLE_SID to a bogus value, and try to connect
              SQL> exit
              [oracle@vmlnx01 ~]$ export ORACLE_SID=FUBAR
              [oracle@vmlnx01 ~]$ sqlplus scott/tiger
              
              SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:57 2010
              
              Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
              
              ERROR:
              ORA-01034: ORACLE not available
              ORA-27101: shared memory realm does not exist
              Linux Error: 2: No such file or directory
              
              
              Enter user-name: 
              Now set ORACLE_SID to null, and try to connect
              [oracle@vmlnx01 ~]$ export ORACLE_SID=
              [oracle@vmlnx01 ~]$ sqlplus /scott/tiger
              
              SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:43:24 2010
              
              Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
              
              ERROR:
              ORA-12162: TNS:net service name is incorrectly specified
              Ok, that is how we get from the client connection request to the listener. What about the listener's part of all this?

              The listener is very simple. It's job is to listen for connection requests and make the connection (server process) between the client and the database instance. Once that connection is made, the listener is out of the picture. If you were to kill the listener, all existing connections would continue. The listener is configured with the listener.ora file, but if that file doesn't exist, the listener is quite capable of starting up with all default values. One common mistake with the listner configuration is to specify "HOST=localhost" or "HOST=127.0.01". This is a NONROUTABLE ip address. LOCALHOST and ip address 127.0.0.1 always mean "this machine on which I am sitting". So, all computers are known as "localhost" or "127.0.0.1". If you specify this address, the listener will only be capable of receiving requests from the machine on which it is running. If you specified that address in your tnsnames file - on a remote client machine - the request would be routed to the machine on which the requesting client resides. Probably not what you want.
              • 4. Re: "Error: ORA-12560:  TNS: protocol adapter error"
                821202
                Thanks Steve, but I think I have been cheated, I got a laptop from someone and just now when I tried to turn it on it does turn on but it gives me error on each application when I try connecting, so now I am using my other laptop Windows Vista and installed Oracle10g and now I get a invalid user name and password but I am 100% sure the username and password is right.
                • 5. Re: "Error: ORA-12560:  TNS: protocol adapter error"
                  EdStevens
                  user4052131 wrote:
                  Thanks Steve, but I think I have been cheated, I got a laptop from someone and just now when I tried to turn it on it does turn on but it gives me error on each application when I try connecting, so now I am using my other laptop Windows Vista and installed Oracle10g and now I get a invalid user name and password but I am 100% sure the username and password is right.
                  I can't see what you do or what you get.
                  Oracle 10g is not certified on Vista. no oracle product is certified on any HOME version of any windows OS.
                  You are a moving target.
                  I'm afraid I'm out of ideas.
                  • 6. Re: "Error: ORA-12560:  TNS: protocol adapter error"
                    821202
                    Hi Steve, actually just yesterday night I reinstalled Windows Vista and installed oracle10g, now I am able to access user scott, but there is still problem. There is limited access for user "scott", so now I dont get any error but I want to get access to the system like administrator so I can run, execute, read do every command but how do I do that for sql plus?

                    Edited by: user4052131 on Dec 6, 2010 7:45 AM
                    • 7. Re: "Error: ORA-12560:  TNS: protocol adapter error"
                      821202
                      And please tell me that I can install QTP automation Tool for Vista? Most people are telling me it is impossible there is no way, if that's true then I will have to reinstall oracle on that new laptop which a guy did fraud with me that laptop barely works. Is it true that QTP tool usually works on XP rather then Vista? I dont want to do all this from beginning again frustrated....let me know

                      Dilshad.