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

Thread: Schedule job

  1. #1
    Join Date
    Oct 2000
    Posts
    42

    Question

    I have sql script I want to schedule to run every Monday morning to monitor tablespace usage and email me the output file with cron job. Can someone tell me how to start svrmgrl or sqlplus with connect system/manager and run this script? I will like to spool the result out and have it mail to me. This is AIX, 8.1.6. Thanks


    Oisaya

  2. #2
    Join Date
    Dec 2000
    Posts
    75
    In a shell script, you can do something like


    svrmgrl <<EOF
    connect internal

    bla.... bla...

    exit
    EOF



    goodhealth

  3. #3
    Join Date
    Nov 2000
    Posts
    205
    Does this help at all???

    svrmgrl <<EOFarch1
    connect internal
    alter system switch logfile;
    archive log stop;
    exit
    EOFarch1

    Or from within sqlplus you can use the ! to execute something from the unix host.

    Good luck,
    Nirasha

  4. #4
    Join Date
    Nov 2000
    Posts
    157
    hi

    could u please mail me that script (c_ravichandra@hotmail.com)

    Thanks
    ravi
    ravi

  5. #5
    Join Date
    Jan 2001
    Posts
    18
    Can you please mail me that script? My mail id is sundaralingam@yahoo.com.

    Thanks in advance.

    Sundar
    S. Sundar,
    Technical Specialist,
    Computer Software & Solutions,
    Muscat,
    Sultanate of Oman.

  6. #6
    Join Date
    Oct 2000
    Posts
    42
    Thanks everybody. The error I am getting with the suggested solution is after opening and connecting to svrmgrl, the following command like bla bla bla is not executing. If you shellout with ! to call any command another error is encounted. SVRMGRL is actually waiting for commands and none of the remaining shell commands is executed. I still need some input.

    Oisaya

  7. #7
    Join Date
    Oct 2000
    Posts
    123
    please e-mail me too at:
    alan_bo@hotmail.com

    Thanks

  8. #8
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    #!/bin/ksh
    exec > /tmp/log.$$
    sqlplus -s system/manager@dbname << EOF
    select count(*) from dba_objects
    /
    exit
    EOF
    mailx -s "db report" yourself < /tmp/log.$$
    Jeff Hunter

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