- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script not working in Cron
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
тАО06-25-2001 06:55 AM
тАО06-25-2001 06:55 AM
Re: Script not working in Cron
-------------cut here-------------
export ORACLE_SID=${1:-????}
ORAINFO=$(grep "^${ORACLE_SID}:" /etc/oratab 2>/dev/null)
if [[ -n ${ORAINFO} ]];
then ORAINFO=${ORAINFO%%\#*}
IFS=:
set ${ORAINFO}
unset IFS
export ORACLE_HOME=${2}
export PATH=${PATH}:${ORACLE_HOME}/bin
export SHLIB_PATH=${ORACLE_HOME}/lib
else print "No info in /etc/oratab for SID ${ORACLE_SID}"
ORACLE_SID=""
fi
------------cut here---------------------
Substitute whatever SID you want as the default in place of ????.
If you put this script into a directory that is already on your path then add the following line to your main script:-
. ora_env
or if the directory is not included in PATH then:-
. /
PATH must contain the directory name '$ORACLE_HOME/bin' not the name of the command such as '$ORACLE_HOME/bin/sqlplus'.
What I meant by a 'subscript' was using the '. ' command to execute a script within your current script not as a separate process (commonly known as 'dotting' the script).
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 07:04 AM
тАО06-25-2001 07:04 AM
Re: Script not working in Cron
Beverly,
at is your standard unix command to execute jobs at
a specific time
i.e.
at 22:30
/ora0/oracle/SQL/anal_schemas
this will create your job /var/spool/cron/atjobs/*.a
you can look at this file and will see what environement
variables are set.
By the way:
if this job works you can use the job xyz.a and start this
through cron. you will be sure then that all varaibales are set.
See also: man at
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 07:32 AM
тАО06-25-2001 07:32 AM
Re: Script not working in Cron
ORACLE_SID='repp'
ORACLE_BASE='/ora0/oracle/app/oracle/product'
ORACLE_HOME='/ora0/oracle/app/oracle/product/8.0.5'
export ORACLE_HOME ORACLE_SID ORACLE_BASE
PSWD=`cat /ora0/oracle/passwd/system`
sqlplus system/$PSWD@repp @$HOME/SQL/anal_schemas.sql
To Rainer: Thanks. I don't have the permissions to run the at command, so I sent your reply to the sysadm asking her to run it.
Thanks a bunch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 07:39 AM
тАО06-25-2001 07:39 AM
Re: Script not working in Cron
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 07:49 AM
тАО06-25-2001 07:49 AM
Re: Script not working in Cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 07:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 08:11 AM
тАО06-25-2001 08:11 AM
Re: Script not working in Cron
ORACLE_PATH='/ora0/oracle/app/oracle/product/8.0.5/bin'
export PATH=$ORACLE_PATH
export SHLIB_PATH=$ORACLE_HOME/lib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 08:15 AM
тАО06-25-2001 08:15 AM
Re: Script not working in Cron
PATH=$PATH:$ORACLE_PATH
otherwise you will lose your normal PATH settings (/usr/bin etc)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 08:26 AM
тАО06-25-2001 08:26 AM
Re: Script not working in Cron
or
PATH=$PATH:$ORACLE_PATH
I'm sorry, but I am getting very confused.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2001 08:35 AM
тАО06-25-2001 08:35 AM
Re: Script not working in Cron
is preferable.
${PATH} is another way of writing $PATH.
PATH=$PATH:$ORACLE_PATH gives the same result because you have already set ORACLE_PATH to '/ora0/oracle/app/oracle/product/8.0.5/bin'
Regards,
John