DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: automating SQL scripts

  1. #1
    Join Date
    Nov 2001
    Posts
    27
    hello everyone,

    I would like to run some SQL scripts through Crontab. I have already created a SQL script that will drop, create, and load tables and create views. I have no problem running this script from SQL*PLUS prompt.

    All I have to do is type :

    SQL> start PATHNAME/do_this.sql

    However I want my SQL script to do this for me, but I dont know how. I can solve this problem by using Expect, but I don't want to use Expect.

    I tried typing in at the top of the .sql script this:
    sqlplus username/passwd

    The script will logon to SQL*PLUS, but it wont do anything after that.

    Can anyone please help me ? THANKS


  2. #2
    Join Date
    Mar 2001
    Posts
    635
    Hi

    Try this

    sqlplus username/password @PATHNAME/do_this.sql

    Put the above line in a shell script and execute the shell script

    To set up a cron job use the following command

    crontab

    If you need more then this keep posting

    Again this should give you a start

    Regards
    Santosh

  3. #3
    Join Date
    Nov 2001
    Posts
    27
    It WORKS !! THANKS SO MUCH

Posting Permissions

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


Click Here to Expand Forum to Full Width