Operating System - HP-UX
1752295 Members
5006 Online
108786 Solutions
New Discussion юеВ

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

 
daud azimi
Occasional Advisor

Oracle 9i HPUX 11. 64 bit Startup/shutdown

Hi
i have put a cron job to shutdown oracle :
su - oracle -c ". /app/oracle/product/9.2/bin/dbshut" >>/tmp/dblog/dbshutdown.
says the Error :
ksh: ORACLE_TRACE: parameter not set

When do " su - oracle " and then run the script manaulay ist works fine , but not as cron job


23 REPLIES 23
Peter Godron
Honored Contributor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

Daud,
I don't think you need to spec the full path for the dbshut command.
Have you changed dbshut? Seems you are setting ORACLE_TRACE somewhere unexpected!
Do all the relevant files exist(/etc/oratab)?
Frank de Vries
Respected Contributor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

dbshut makes use of oratab
see inside the dbshut script

ORATAB=/etc/oratab
case $ORACLE_TRACE in
# that ORACLE
cat $ORATAB | while read LINE
and oratab

Oratab should look like this:

# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
MAN:/picnew/oracle/product/9.2:N
P01:/picnew/oracle/product/9.2:Y
P03:/picnew/oracle/product/8.1.7:N
P04:/picnew/oracle/product/8.1.7:N

etc..

Hope this helps
Look before you leap
daud azimi
Occasional Advisor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

The dbshut and oratab files are ok

The ORACLE_TRACE is where defiend ??


dbshut:
.....
# This script is used to shutdown ORACLE from /etc/rc(.local).
# It should ONLY be executed as part of the system boot procedure.
#
#####################################

ORATAB=/etc/oratab

trap 'exit' 1 2 3
case $ORACLE_TRACE in
T) set -x ;;
esac

# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/etc
export PATH ;;
esac
# Save LD_LIBRARY_PATH
SAVE_LLP=$LD_LIBRARY_PATH

#
# Loop for every entry in oratab file and and try to shut down
# that ORACLE
#

cat $ORATAB | while read LINE
do
case $LINE in
-------------------------

. profile or oracle user :
# @(#)B.11.11_LR

# Default user .profile file (/usr/bin/sh initialization).

# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs

# Set up the search paths:
PATH=$PATH:.

# Set up the shell environment:
set -u
trap "echo 'logout'" 0

...skipping...

# @(#)B.11.11_LR

# Default user .profile file (/usr/bin/sh initialization).

# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs

# Set up the search paths:
PATH=$PATH:.

# Set up the shell environment:
set -u
trap "echo 'logout'" 0

# Set up the shell variables:
EDITOR=vi
export EDITOR
# Set up Oracle Specific Variables

export ORACLE_BASE=/app/oracle
export ORACLE_HOME=/app/oracle/product/9.2
export TNS_ADMIN=$ORACLE_HOME/network/admin
#export SHLIB_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib64
export NLS_LANG=american_america.WE8ISO8859P1

export PATH=$PATH:$ORACLE_HOME/bin

name=`hostname`
export ORAVER=9.2
export ORACLE_SID=
#export PS1="#$name],["'$ORAVER'"],["'$ORACLE_SID'"]:"'$PWD'"# "
export PS1=">$name["'$ORACLE_SID'"]:"'$PWD'"# "



Peter Godron
Honored Contributor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

daud,
for more details on the dbstart script have a look at metalink note 91815.1
Include the definition of ORACLE_TRACE in your startup script. May be a good idea to run your script with debug on anyway.
What is reported in the dbshutdown log file?
daud azimi
Occasional Advisor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

thanks all ,

I have solved Problem:

1. cron.alow for oracle user
2. made a simple script : dbdown

cd /app/oracle../bin
./dbshut
3. cron as oracle user :
. /home/oracle/dbdown >>/tmp/dblog/dbshutdown

cd /
and test this script as cron Job (oracle user)
It worked fine

Eric Antunes
Honored Contributor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

Hi daud,

Check this about the forum point system:

http://forums1.itrc.hp.com/service/forums/helptips.do?#22

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Peter Godron
Honored Contributor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

Daud,
that's cheating ;-) Running the script as oracle.
Great idea though!
Nguyen Anh Tien
Honored Contributor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

Hmm. It is hard to believe.
Pls check it again!
HP is simple
Frank de Vries
Respected Contributor

Re: Oracle 9i HPUX 11. 64 bit Startup/shutdown

Some forum members have a point.
What was the core issue in the end ?

We run various (manage 43 db's)
su - oracle -c "$var/dbshut" in the root cron. No probs.
Many Oracle tech sites refer to it.
(Of course you can run a script as
oracle cron when preferred , but to
make it to be the messiah is a bit rich
isn't it ?)

Same story for ORACLE_TRACE.

In fact you can define it if you wanted to
trace, but in most cases it is unset.

Just like one could use set -x in a shell
script, while the default is set +x,
(but not explicitly) whilst not many people know this.



Look before you leap