1 Reply Latest reply on Apr 12, 2012 5:44 AM by viconstg

    Need Help In using SQLPLUS inside the shell Script

    muralirachakonda
      Hi All,

      I am working on Linux for the first time.

      Trying to connect to database using sqlplus

      #!/bin/bash
      sqlplus -s username/password@dbname << SQLScript
      select sysdate from dual;
      exit
      SQLScript

      It is not working.

      Please help
        • 1. Re: Need Help In using SQLPLUS inside the shell Script
          viconstg
          Check the login you use to call this script. Do you tried to call sqlplus under this login from command line? Is it working? If so, try to include in your script the commands:

          export ORACLE_HOME=<ORACLE_HOME_LOCATION_ON_YOUR_HOST>
          export ORACLE_SID=<YOUR_ORACLE_SID>

          Also, check the PATH variable. Perhaps, would be better to call sqlplus as $ORACLE_HOME/bin/sqlplus

          If it will not help, describe in details how namely "it is not working" :)