Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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
daud azimi
Occasional Advisor

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

su - oracle(user) -c /.../dbshut ist not working ? i dont know what the Problems is, and manualy su - oracle and ./../dbhsut ist working ,.. so i came to idea to .....

But where can i set the ORACLE_TRACE ?
and how to debug the root.cron ?? or the dbshut script ?



Yogeeraj_1
Honored Contributor

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

hi,

you can set this in the .profile of the oracle user in your case.

hope this helps

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
daud azimi
Occasional Advisor

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

i set ORACLE_TRACE in .profile of oracle user
but after runing the dbshut script says:
ksh: LD_LIBRARY_PATH: parameter not set
daud azimi
Occasional Advisor

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

I have now some stupied questions :

where and how to check the correct Environemnt is set ?
I think the environemnt is not correct set by doing su - oracle(user)
Yogeeraj_1
Honored Contributor

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

hi,

three places to check!

1. the script itself
2. the /etc/profile
3. the .profile in the user home

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Steven E. Protter
Exalted Contributor

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

dbshut has a bug.

Change where it says shutdown to shutdown immediate.

Environment:
/etc/profile
/home directory/.profile

Anything sourced from in there.

The oracle start/stop scripts provided also set environment.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
daud azimi
Occasional Advisor

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

I think the orginal dbhsut script is modified:
....
case $VERSION in
"6") sqldba command=shutdown ;;
"internal") $SQLDBA <connect internal
shutdown immediate
EOF
;;
*) $SQLDBA <connect / as sysdba
shutdown immediate
EOF
............



Yogeeraj_1
Honored Contributor

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

hi,

dbshut makes use of the ORATAB. Did you verify this?

it should contain something like:
mydb:/u01/app/oracle/product/8.1.7:Y


regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

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

hi again,

attached a copy of the dbshut script that you may wish to verify with that of yours.

I would not recommend using dbstart and dbshut though. This is because you cannot control it completely. I never use dbstart/dbshut.

starting and stopping a database typically involves MORE than just the database.

I use an "orastart" script to do whatever I need to have done -- eg:

"start listener,
start db,
start processes that need to be running when db is up"

with dbstart you get

start db


and that is all....

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
James R. Ferguson
Acclaimed Contributor

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

Hi Daud:

You asked how to check how your environment is/was setup.

A simple way is to add 'env' to your script.

If you run the script via 'cron' or 'at', without redirection of the 'env' call, a mail message will be generated detailing the various envioronmental settings. Otherwise you can redirect the output of 'env' to a file of your choice.

Regards!

...JRF...
daud azimi
Occasional Advisor

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

hi all
first thanks for the reply

Yogeeraj : can u tell me mor about orastart/orastop , where to find the script an may you can attack one script
thanks in advance;
Tim Sanko
Trusted Contributor

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

First source oraenv for the correct instance.

For 9i I write a small shutdown piece of sql and then run it to shut down 9i databases.

it runs from sqlplus. I start databases in a similar manner.

...
Tim
Jim Butler
Valued Contributor

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

Check the script dbshut - In it, the path to "oratab" is specified. Most of us use "/etc/oratab". Check to make sure the oratab specified in "dbshut" is the correct one.

Good luck.
Man The Bilge Pumps!
Yogeeraj_1
Honored Contributor

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

hi,

Your orastart script will be as such:

echo "/app/oracle/product/9.2/bin/lsnrctl start "| su - oracle
echo "/app/oracle/product/9.2/bin/sqlplus /nolog <
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)