- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron and UTL problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 03:40 AM
тАО04-04-2003 03:40 AM
Cron and UTL problem
I have a very huge problem I try to explain correctly:
I have a shell that calls a pl-sql program, after a pro-cobol program and after another pl-sql program. This shell works correctly and do every thing that I want. The problem is when I put into the cron, the first pl-sql programs works ok, the procobol too and the last pl-sql exists for the exception SYS.UTL_FILE.INVALID_OPERATION. This pl-sql opens one file for reading and four for writing, and when is trying to open the third file exists for the mentioned exception.
I like to be clear about this shell works correctly when I execute in a normal unix sesion and its when I put in the cron when fails.
Do you know if there is any tipe of limit obout files when a pl-sql program runs in the cron, its the only idea that I have.
Thanks
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 03:52 AM
тАО04-04-2003 03:52 AM
Re: Cron and UTL problem
When you run scripts from cron, you don't have the full user profile executed so you don't have all your normal environmental variables set. Probably the last pl-sql program needs something in one of your variables that gets set in the .profile, such as the PATH, or maybe another variable that sets a path for the third file to be opened?
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 03:53 AM
тАО04-04-2003 03:53 AM
Re: Cron and UTL problem
I have no idea if this is related or not, but the usual limitation with cron that trips people up is cron's minimal environment setup. There's no PATH to speak of, probably very few of you DB environment variables, etc. The thing to do with cron is always use full path names for commands and make sure that whatever environment variables you need are being set in the script. I'm wondering if maybe you're missing one of your DB env vars
when the second sql program runs.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 04:03 AM
тАО04-04-2003 04:03 AM
Re: Cron and UTL problem
the last pl-sql is perhaps depending on an environment variable not set when executed from cron. Do you execute it as the same user from cron? Try comparing the two environments by inserting these two lines in your script:
env | sort >/tmp/cron.env
exit
and execute it from cron.
Then, as the user where it works:
# env | sort >/tmp/user.env
And look for the difference:
# diff /tmp/user.env /tmp/cron.env
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 04:06 AM
тАО04-04-2003 04:06 AM
Re: Cron and UTL problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 04:10 AM
тАО04-04-2003 04:10 AM
Re: Cron and UTL problem
difficult to understand your problem. Can you please post your code from the problem script and cron?
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 04:34 AM
тАО04-04-2003 04:34 AM
Re: Cron and UTL problem
All failures in cron (versus an interactive login) are due to missing components in the working environment and lack of a controlling terminal. Add to the test for env a test for ulimit (ulimit -a). This assumes you are using the standard POSIX shell for your scripting. You'll have a LOT of problems trying to make csh (or other non-standard shell) work in a cron environment. Note that *ALL* cron shell scripts must have the courtesy loader directive (ie, #!/usr/bin/sh) as line numer 1. Actually, all shell scripts should have this line but cron is crucially dependent on being told which shell to use.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 05:08 AM
тАО04-04-2003 05:08 AM
Re: Cron and UTL problem
I haven't acces to the cron and i can't see how they put my shell in the cron, all are problems for every thing.
The ulimit -a doesn't work but ulimit alone yes, it's 4194303 (in a normal session) and in the cron the ulimit -a works and its output is time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048
A lot of thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 05:49 AM
тАО04-04-2003 05:49 AM
Re: Cron and UTL problem
as already stated, you should insert
#!/usr/bin/sh
at the beginning of all your scripts.
I think that the root shell, /sbin/sh, does not support the functionality of some of your variables, e.g. NLS_LANG.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2003 10:55 AM
тАО04-04-2003 10:55 AM
Re: Cron and UTL problem
Bill Hassell, sysadmin