1751709 Members
4679 Online
108781 Solutions
New Discussion юеВ

Re: database startup

 
rakkesh_1970
Occasional Advisor

database startup

hi

we are using the oracle 10g database on hp ux 11.23 version

the following script we are trying to auto start and shutdown database and lsn on startup

# installation
ORACLE_HOME=/u01/app/oracle/OraHome_1
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
HOST='hostname'
#
# change the value of ORACLE to the login name of the
# oracle owner at your site
#
export ORACLE_HOME PATH
su - $ORACLE -c "$0 $1 ORA_DB"
##
if [ ! "$2" = "ORA_DB" ] ; then
ssh -l $HOST $ORACLE /sbin/init.d/oradba $1 ORA_DB
exit
fi
#
LOG=$ORACLE_HOME/startup1.log
touch $LOG
chmod a+r $LOG
#
case $1 in
'start')
echo "$0: starting up" >> $LOG
date >> $LOG
# Start Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "starting Oracle Net listener"
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &
fi
echo "starting Oracle databases"
$ORACLE_HOME/bin/dbstart >> $LOG 2>&1
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "stopping Oracle Net listener"
$ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1
fi
echo "stopping Oracle databases"
$ORACLE_HOME/bin/dbshut >> $LOG 2>&1
;;
*)
echo "usage: $0 {start|stop}".

exit
;;
esac
#
exit
RACLE_HOME=/u01/app/oracle/OraHome_1
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
HOST='hostname'
#
# change the value of ORACLE to the login name of the
# oracle owner at your site
#
export ORACLE_HOME PATH
su - $ORACLE -c "$0 $1 ORA_DB"
##
if [ ! "$2" = "ORA_DB" ] ; then
rsh $HOST -l $ORACLE /sbin/init.d/oradba $1 ORA_DB
exit
fi
#
LOG=$ORACLE_HOME/startup1.log
touch $LOG
chmod a+r $LOG
#
case $1 in
'start')
echo "$0: starting up" >> $LOG
date >> $LOG
# Start Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "starting Oracle Net listener"
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &
fi
echo "starting Oracle databases"
$ORACLE_HOME/bin/dbstart >> $LOG 2>&1
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "stopping Oracle Net listener"
$ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1

script directory
=/sbin/init.d
script output
bash-3.2# ./dbora start
+ ORACLE_HOME=/u01/app/oracle/OraHome_1
+ ORACLE=oracle
+ PATH=/usr/sbin:/bin:/usr/bin:/usr/dt/bin:/usr/bin/X11:/sbin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/ipf/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/sas/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/resmon/bin:/usr/contrib/kwdb/bin:/opt/graphics/common/bin:/opt/sfm/bin:/opt/hpsmh/bin:/opt/upgrade/bin:/opt/sec_mgmt/bastille/bin:/opt/drd/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/firefox:/opt/gnome/bin:/opt/ignite/bin:/opt/mozilla:/opt/perl_32/bin:/opt/perl_64/bin:/opt/sec_mgmt/spc/bin:/opt/ssh/bin:/opt/swa/bin:/opt/thunderbird:/opt/gwlm/bin:/usr/contrib/bin/X11:/opt/langtools/bin:/opt/caliper/bin:/opt/sentinel/bin:/usr/local/bin:/bin
+ + hostname
HOST=posserve.ciegroup.net
+ + uname
PLATFORM=HP-UX
+ export ORACLE_HOME PATH
+ i#
./dbora[17]: i#: not found.
+ [ ! = ORA_DB ]
+ echo

+ [ HP-UX = HP-UX ]
+ su - oracle -c ./dbora start ORA_DB
(c)Copyright 1983-2003 Hewlett-Packard Development Company, L.P.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-2000 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2003 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.


RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.


Hewlett-Packard Company
3000 Hanover Street
Palo Alto, CA 94304 U.S.A.

Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
+ exit

pls provide me the input to resolve the problem

thanks

rakesh




15 REPLIES 15
Steven E. Protter
Exalted Contributor

Re: database startup

Shalom,

Possibilities:
1) Pam is configured so the su - startup option does not work and the script is prompted for a password.
2) Script error.

In either event, set -x the script and modify its run so that output goes to a file. Then maybe you'll at least have some idea what went wrong.

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
Yogeeraj_1
Honored Contributor

Re: database startup

hi Rakesh,

At first sight, there seem to be an error in your script! see line:

> RACLE_HOME=/u01/app/oracle/OraHome_1


revert

kind 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: database startup

Hi again,

clarification:

you wrote:
RACLE_HOME=/u01/app/oracle/OraHome_1

instead of:
ORACLE_HOME=/u01/app/oracle/OraHome_1

also, when you are launching command:
./dbora start

it explicitly means that dbora script is in the current directory.

Also, is this HP-UX or Linux?


revert

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

Re: database startup

Hi,
Please put the full absolute path of "dbora" and then try.
su - oracle -c /fullpath/dbora start ORA_DB

Thanks

Aashique
rakkesh_1970
Occasional Advisor

Re: database startup

hi all/yoograj,

thanks foy u respons

in script it is
ORACLE_HOME=/u01/app/oracle_OraHome_1

the script directory is
/sbin/init.sd/
permission under root & oracle user
-rwxr-x--- 1 root dba 679 Apr 3 16:39 dbora

This script is ruuning on hp ux 11.23

/usr/bin/csh default shell for oracle
/user/ust/bin/sh default shell for root

thanks
rakesh




Yogeeraj_1
Honored Contributor

Re: database startup

hi Rakesh,

need to have a look at the dbora script. Did u make any changes?


revert

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

Re: database startup

hi yoograj,

no changes made till we posted this issue

thanks


rakesh
rakkesh_1970
Occasional Advisor

Re: database startup

hi yoograj,

i think problem with this script
ssh not able switch oracle

how i can resolve it

thaanks
rakesh
Yogeeraj_1
Honored Contributor

Re: database startup

hi again,

>ssh not able switch oracle

Where did you find ssh in the script?

Can you post your scripts for review?

revert.

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