Connecting To Oracle Database From Unix(script)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chanakyadba
    New Member
    • May 2007
    • 2

    Connecting To Oracle Database From Unix(script)

    Hi all , i need the shell script which would connect to the oracle database xyz...
  • smashzone
    New Member
    • May 2007
    • 9

    #2
    -
    Originally posted by chanakyadba
    Hi all , i need the shell script which would connect to the -oracle database xyz...
    Pleas ellaborate on your question? Why would you need a script to connect to a database? Which Oracle database version are you using? Why can't you run sqlplus from the command line?

    Please be clear on what you need, it helps us to be able to answer your question quicker if we do have answers.

    Regards,
    smashzone

    Comment

    • chanakyadba
      New Member
      • May 2007
      • 2

      #3
      with sqlplus we can connect , but i need the total syntax from shell prompt and after connecting to sql what steps to be followed to connect to oracle 9i database

      Originally posted by smashzone
      -

      Pleas ellaborate on your question? Why would you need a script to connect to a database? Which Oracle database version are you using? Why can't you run sqlplus from the command line?

      Please be clear on what you need, it helps us to be able to answer your question quicker if we do have answers.

      Regards,
      smashzone

      Comment

      • smashzone
        New Member
        • May 2007
        • 9

        #4
        Definition of a script: a script is an automated sequence of related commands
        Therefore, you dont need a script to connect to a database

        Step 1
        Login to your server (ssh <ip adress>) using program called putty as the oracle user and provide the relevant password

        example:
        login as: oracle
        Sent username "oracle"
        oracle@192.168. 103.60's password:
        Last login: Wed May 16 09:10:16 2007 from 192.168.103.184
        [oracle@slayer ~]$


        Step 2
        Run the following command:
        sqlplus system/password

        Step 3
        Use sqlplus as you would use it when your connecting using a windows machine.

        HINT: Make sure that your logged on as an oracle user, otherwise you'll get an error like this:

        [root@slayer ~]# sqlplus
        -bash: sqlplus: command not found


        Hope this helps, post again if u encounter any problems

        Regards,
        smashzone

        Comment

        • ora2000
          New Member
          • Aug 2007
          • 2

          #5
          Hi

          I would like to create a unix script to connect to an ORACLE database using a oracle package. Also this script should provide functionality to call an oracle procedure that contains a parameter value that is passed to it. The parameter value passed to the procedure should be "editable" i.e user should be able to change it.

          Please could you assist, shout if anything is unclear and i will try and re-phase

          Comment

          • aeiou8
            New Member
            • Oct 2007
            • 1

            #6
            Hi,

            I am also in need of some help pertaining to connecting to Oracle from a script. The logic I am trying to accomplish is:

            1. log into Oracle.
            2. execute a simple select query from the V$SESSION table.
            3. have the output piped into a file.

            I was planning to have this script set up in crontab to run every 30 mins. Any help will be appreciated. Thanks.

            Comment

            • coaxfiber
              New Member
              • Mar 2007
              • 60

              #7
              Originally posted by aeiou8
              Hi,

              I am also in need of some help pertaining to connecting to Oracle from a script. The logic I am trying to accomplish is:

              1. log into Oracle.
              2. execute a simple select query from the V$SESSION table.
              3. have the output piped into a file.

              I was planning to have this script set up in crontab to run every 30 mins. Any help will be appreciated. Thanks.

              use "spool" in your sql file and call it to your script.

              Comment

              Working...