2 Replies Latest reply: Nov 22, 2011 2:21 AM by Paul M. RSS

    Error when running a bat file

      Can someone tell me what this error means; "ORA-12560: TNS:protocol adapter error"

      I had Oracle XE on my Windows XP Pro SP3, but I also install the EE of Oracle which I haven't setup yet. Originally when I run this .bat file by double clicking on it, "setup_distran_database.bat", everything worked fine. But now, I am getting tghe above error. Not sure if it was because I installed Oracle EE.
      This is the .bat file:
      *@ECHO off*
      *:: Ayo Ojikutu*
      *:: Using Murach's Oracle SQL and PL/SQL*
      *:: and Mike Murach & Associates, Inc. example*
      *:: Nov 11, 2011*
      *:: Uses SQL*Plus utility to run the SQL scripts that create*
      *:: and populate the tables in the AP, OM, and EX schemas.*
      *:: If necessary, edit the username/password*
      sqlplus system/passwordhere @setup_distran_database*
      *:: Display a message about the log file*
      ECHO For details, check the setup_distran_database.log file in the current directory.

      *:: Display 'press any key to continue' message*
        • 1. Re: Error when running a bat file
          Paul M.
          "ORA-12560: TNS:protocol adapter error"

          Not sure if it was because I installed Oracle EE.
          Most probably yes, Windows has the last installed product environment. Try setting XE environment before running sqlplus, something like
          set ORACLE_SID=XE
          set ORACLE_HOME=<XE Oracle Home>
          set PATH=<XE Oracle Home\bin>;%PATH%
          sqlplus .....
          • 2. Re: Error when running a bat file
            as you have more than one ORACLE_HOME you can also set the env variable TNS_ADMIN, this would be a dedicated location to store tnsnames, listener, sqlnet.