Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2004
    Location
    Oklahoma City OK -
    Posts
    122

    Unanswered: how to submit a sql script to run in background on unix

    I need to submit a sql script to run in background on unix , then end my telnet session without aborting the execution of the long running sql script.

    I am spooling the results to a text file.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Talking


    You need a put the sql script inside a ksh shell wrapper:
    Code:
    #!/bin/ksh
    # MyKSHscript.ksh
    . /path/to/orclenv/oraenv
    sqlplus / @MySQLscript.sql 
    exit
    Then you execute as:
    Code:
    nohup MyKSHscript.ksh >/tmp/MyLog.txt &


    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Jul 2003
    Posts
    2,296
    or run it through cron
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  4. #4
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Talking


    -- OR -- You can also use the at (or batch) command.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  5. #5
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Or run it as an oracle or dbms_job script (if no sql/plus commands in script)
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •