Help on Cron Job
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Help on Cron Job

  1. #1
    Join Date
    Jan 2000
    Posts
    27

    Red face

    Hi DBA's
    I wrote a bckup script using rman.
    I set ORACLE_HOME, ORACLE_SID, LD_LIBRARY_PATH variables and then wrote my backup code.
    when I execute that script from unix prompt it works fine.
    When I submit that in cron job I got an error.

    RMAN 00571 : File Not Found
    LEM-00031 : File not found: arguments[lempgmh] [lemerr]
    LEM-00033 : File not found: arguments[lempgfm] [Could not open Message file]
    LEM-00031 : File not found: arguments[lempgmh] [lsmerr]
    LEM-00033 : File not found: arguments[lempgfm] [Could not open Message file]

    I know that script is executed thr' cronjob.

    I appriciate if someone could figure out the problem

    Thanks
    Sunny

  2. #2
    Join Date
    Jul 2000
    Location
    Oxford, OH
    Posts
    117
    Could you post the line(s) from your crontab file and the script you are running? It could be that it's not picking up your directory path.

    Joe
    _________________________
    Joe Ramsey
    Senior Database Administrator
    dbaDirect, Inc.
    (877)687-3227

  3. #3
    Join Date
    Sep 2000
    Posts
    47
    cron executes using a minimal shell. It's always best to explicitly execute your user (in this case, oracle) login file (.login for c-shell, .profile for bourne or korn) early in the script to be sure all of your environment is correct.

  4. #4
    Join Date
    Sep 2000
    Posts
    47
    oops. In my previous post I said "execute your login file" when I should have said "source your login file". Big difference.

  5. #5
    Join Date
    Aug 2000
    Location
    -
    Posts
    7
    Assume that your user is "oracle", then you should supply "su - oracle" at your crontab. It will set the oracle environment.

  6. #6
    Join Date
    Nov 2000
    Posts
    245
    as MACSWELL said, you r use SUB schell in cronjob which means there are only 5-6 environment var set (try to display your env var in the cronjob you will be very surprise the result). you have to reset your variable by running .profile (KSH) or create a script then execute it.

  7. #7
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    342

    Talking

    I always start a crontab script with

    . /etc/profile
    . ~/.profile

    Gert

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