8 Replies Latest reply: Sep 19, 2012 11:56 PM by Shivananda Rao RSS

    ORA-12560: TNS:protocol adapter error

    963228
      Dear,

      I am new to window platform in order to create standby database and now i am facing issue with sqlplus / as sysdba.

      C:\Windows\system32>sqlplus / as sysdba

      SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 20 11:55:23 2012

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

      ERROR:
      ORA-12560: TNS:protocol adapter error

      Enter user-name:

      TNSping is working, listner.ora, sqlplus.net, tnsname, password files are created on standby as well oracle_Sid, oracle_home and PATH are set properly, all seems fine.

      I found no oracle service running in window services but i'm not sure is it the problem and need to create oracle service in window services in order to connect as sysdba then i could startup database at nomount stage with pfile.

      Really appreciate your comment.

      Thanks in advance.
        • 1. Re: ORA-12560: TNS:protocol adapter error
          Shivananda Rao
          Welcome to OTN !!

          On windows, you need to create the Oracle Service for every new instance you create.

          Create the Oracle SID service using the below command
          oradim -new -sid <ORACLE_SID NAME> -startmode auto
          Also do copy the password file of the primary database to the standby server location (%ORACLE_HOME%/database) though this is not related with the issue what you are facing.

          PS: Please consider closing your question if you feel it has been answered by providing appropriate points. Please keep the forum clean !
          • 2. Re: ORA-12560: TNS:protocol adapter error
            Veeresh.S
            ref http://mdvreddy.blogspot.in/2011/12/how-to-solve-ora-12560-tnsprotocol.html
            • 3. Re: ORA-12560: TNS:protocol adapter error
              963228
              Hi,

              I followed your comment below with output. Do your further advise to below. thanks

              C:\Windows\System32>oradim -new -sid orclstby -startup auto
              DIM-00040: Invalid option for the -NEW command.

              C:\Windows\System32>oradim -new -sid orclstby -srvc srvc -syspwd Oracle123 -star
              tmode auto -srvcstart system -pfile D:\app\admin\product\11.2.0\dbhome_1\databas
              e\pwdorclstby.ora

              OPW-00005: File with same name exists - please delete or rename
              DIM-00008: A valid service name is OracleService appended with a SID.

              C:\Windows\System32>oradim -delete -sid orclstby
              DIM-00014: Cannot open the Windows NT Service Control Manager.
              O/S-Error: (OS 5) Access is denied.
              Error creating or opening key, OS Error = 1

              C:\Windows\System32>oradim -delete -sid orclstby -srvc orclstby
              DIM-00004: SID or service name was not specified.

              C:\Windows\System32>
              • 4. Re: ORA-12560: TNS:protocol adapter error
                Shivananda Rao
                C:\Windows\System32>oradim -new -sid orclstby -startup auto
                DIM-00040: Invalid option for the -NEW command.
                Syntax error. It should be "-startmode" and not "startup" Please refer the command given in my previous post.

                Eg:
                Microsoft Windows XP [Version 5.1.2600]
                (C) Copyright 1985-2001 Microsoft Corp.
                
                C:\Documents and Settings\Administrator>*oradim -new -sid stdby -startmode auto*
                Instance created.
                
                C:\Documents and Settings\Administrator>oradim -delete -sid stdby
                Instance deleted.
                
                C:\Documents and Settings\Administrator>
                • 5. Re: ORA-12560: TNS:protocol adapter error
                  963228
                  Sorry my typo error. instance is created but still not able to connect as sysdba yet.

                  C:\Windows\system32>oradim -new -sid orclstby -startmode auto
                  Instance created.

                  C:\Windows\system32>
                  C:\Windows\system32>sqlplus / as sysdba

                  SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 20 13:25:34 2012

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

                  ERROR:
                  ORA-12560: TNS:protocol adapter error


                  Enter user-name:
                  ERROR:
                  ORA-12560: TNS:protocol adapter error

                  C:\Windows\system32>tnsping orclstby

                  TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-SEP-2
                  012 13:25:51

                  Copyright (c) 1997, 2010, Oracle. All rights reserved.

                  Used parameter files:
                  D:\app\admin\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

                  Used TNSNAMES adapter to resolve the alias
                  Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
                  (HOST = dbdrs)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ORCLSTBY)))
                  OK (20 msec)

                  C:\Windows\system32>
                  • 6. Re: ORA-12560: TNS:protocol adapter error
                    Shivananda Rao
                    C:\Windows\system32>oradim -new -sid orclstby -startmode auto
                    Instance created.

                    C:\Windows\system32>
                    C:\Windows\system32>sqlplus / as sysdba

                    SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 20 13:25:34 2012

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

                    ERROR:
                    ORA-12560: TNS:protocol adapter error
                    Did you check if the service OracleServiceorclstby is started or not ? If not started, then please do start it. The service would be located at services.msc (RUN->services.msc)

                    From the command prompt:

                    Run the below command and post the outcome. Set the ORACLE_SID and ORACLE_HOME and then try to connect.
                    set ORACLE_SID=orclstby
                    set ORACLE_HOME=<your Oracle Home path>
                    sqlplus / as sysdba
                    • 7. Re: ORA-12560: TNS:protocol adapter error
                      963228
                      Mr. Shivananda,

                      Thanks for your good support.
                      Now my problem is fixed and able to mount instance in nomount mode.



                      I used to install DG11gR2 in Solaris10 but i don't create this oracle service (oradim) on solaris or it is created automatically. Any advise further pls.
                      • 8. Re: ORA-12560: TNS:protocol adapter error
                        Shivananda Rao
                        Mr. Shivananda,

                        Thanks for your good support.
                        Now my problem is fixed and able to mount instance in nomount mode.
                        I feel the solution provided was worthy, helpful or correct but do not see any points rewarded !!! ;)