- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cron 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
тАО02-01-2007 07:49 PM
тАО02-01-2007 07:49 PM
cron problem
CMD: /oracle/product/bin/sqlplus '/ as sysdba' @vvvv.sql
> oracle 26953 c ┬▒├Э 2┬┐├╣ 2 17:45:00 2007
< oracle 26953 c ┬▒├Э 2┬┐├╣ 2 17:45:00 2007 rc=1
! could not obtain latest contract from popen(3C)
and have mail about the error.
you have mail in /var/mail/oracle
From oracle@iaeisdb Fri Feb 2 17:46:00 2007
Date: Fri, 2 Feb 2007 17:46:00 +0900 (KST)
From: oracle@iaeisdb
Message-Id: <200702020846.l128k0ba026958@iaeisdb>
To: oracle@iaeisdb
Subject: Output from "cron" command
Content-Length: 256
Your "cron" job on iaeisdb
/oracle/product/bin/sqlplus '/ as sysdba' @vvvv.sql
produced the following output:
Error 6 initializing SQL*Plus
Message file sp1
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
how can I erase the error like that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2007 08:06 PM
тАО02-01-2007 08:06 PM
Re: cron problem
when you run a script from cron, a minimum environment is created. You have to specify things like $ORACLE_HOME etc, most of the things as in /etc/profile and ~/.profile.
Most people create a shell script with all these definitions in, which also includes the sqlplus statement.
You already recognised this when you added the full path for your sqlplus stsement.
Something like.
#!/usr/bin/sh
ORACLE_HOME=....
ORACLE_SID=...
PATH=...
sqlplus '/ as sysdba' @ww.sql
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2007 08:29 PM
тАО02-01-2007 08:29 PM
Re: cron problem
You can source the oracle profile as follows:
$( . /home/oracle/.profile >/dev/null 2>&1; /scripts.sh) >/dev/null 2>&1
or execute it as oracle
su - oracle -c "/script.sh"
Regard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2007 04:43 PM
тАО02-02-2007 04:43 PM
Re: cron problem
assuming that you have scheduled the job as the root user, your crontab should look like this:
#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
45 17 * * * echo "/path/to/your/script/script.sh; exit"|su - oracle 1>/path/to/your/logfiles/output-script.crn 2>/path/to/your/logfiles/error-script.crn
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
if otherwise, please define all the environment variables in the script itself.
e.g ORACLE_HOME, ORACLE_SID, PATH etc
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 01:01 PM
тАО02-04-2007 01:01 PM
Re: cron problem
and I have been running oracle user, the user have already set the parameter .
when it run the scripts.
[iaeisdb:/]> CMD: /oracle/script.sh
> oracle 25489 c ├В┬┐├Г┬╣ 2├В┬┐├Г┬╣ 5 10:50:00 2007
< oracle 25489 c ├В┬┐├Г┬╣ 2├В┬┐├Г┬╣ 5 10:50:00 2007 rc=1
! could not obtain latest contract from popen(3C): no such process.
such error are logged at /var/cron/log
.
when root user run the scrpits it runs well but have same log ! could not obtain latest contract from popen(3C): no such process.
when oracle do the script
it dose not run and have erros like
CMD: /oracle/script.sh
> oracle 25489 c ├В┬┐├Г┬╣ 2├В┬┐├Г┬╣ 5 10:50:00 2007
< oracle 25489 c ├В┬┐├Г┬╣ 2├В┬┐├Г┬╣ 5 10:50:00 2007 rc=1
! could not obtain latest contract from popen(3C): no such process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 06:29 PM
тАО02-04-2007 06:29 PM
Re: cron problem
such error message comes from cron, it basicly says that it can't get the contract for what ever process (sometimes long running job which gave output for sendmail and lost contact with mailing daemon)
crontab manpages / contract(4) could say you more i think
anyway, i newer saw this error on hpux, only on solaris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 07:07 PM
тАО02-04-2007 07:07 PM
Re: cron problem
i applied to bug patch relative the error.
when i run the script but the error was disappeared.
thank you all.
but I think doubtly that when i run the script with oracle but root it has still error
Error 6 initializing SQL*Plus
Message file sp1
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 07:55 PM
тАО02-04-2007 07:55 PM
Re: cron problem
you must have set same environments like ora user or owner of oracle software on your machine
oracle_sid, oracle-home, path to ora binaries etc...