1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

connect to DB

Discussion in 'SQL PL/SQL' started by newpromo, Oct 1, 2009.

  1. newpromo

    newpromo Active Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    55
    I'm running shell script which contain sql command. My problem is that i noticed that the script run other commands except sql one. Here is a part of my script :


    ...

    sqlplus -silent user/pass

    select count(*) from DB;

    ...

    I think i should add something like /oracle/ora9i/bin/sqlplus -silent user/pass OR ?

    Also i think something is missing before sqlplus -silent ... like export ORACLE_SID


    Thanks in advance for help !
     
  2. newpromo

    newpromo Active Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    55
    maybe it can help to find a solution to my problem :

    uname -a

    Linux dbcluster01 2.4.21-40.ELsmp #1 SMP Thu Feb 2 22:22:39 EST 2006 i686 i686 i386 GNU/Linux
     
  3. Sikkandar.S.P

    Sikkandar.S.P Active Member

    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Chennai
    You would need to add Oracle Home directory to your $PATH variable.

    (or)

    Just export Oracle SID, Oracle HOME etc.., in your script to connect to the DB.

     
  4. newpromo

    newpromo Active Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    55
    YES , I add it and it's working now. Thank you
     
  5. Sikkandar.S.P

    Sikkandar.S.P Active Member

    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    Chennai


    Thanks for the Feedback!

    I believe you have posted your question Under Articles Category. In Future, Please post it under Queries and Discussions Section!

     
  6. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Moved to Queries section, thanks Sikkander.