Operating System - HP-UX
1747980 Members
4487 Online
108756 Solutions
New Discussion юеВ

Re: Run The Database Automatically

 
Mousa55
Super Advisor

Run The Database Automatically

Hi All,

how i can up the database automatic after reboot or restart the server
i mean after restart the server i don't want refer to DBA to run the database, only i need a script or something to make a server to run the database automatically
only i need the DBA when i want to shutdown the database.
how i can do it that?

thanks and best regards
9 REPLIES 9
Yogeeraj_1
Honored Contributor

Re: Run The Database Automatically

hi,

that should not be too difficult.

See post at the following thread:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1218941

if you need any further assistance, please do let us know.

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

Re: Run The Database Automatically

Hi All,

but this script it is working or no?
and my OS 11.11 and 9i database

# 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
Dennis Handly
Acclaimed Contributor

Re: Run The Database Automatically

>but this script it is working or no?
./dbora[17]: i#: not found.
+ [ ! = ORA_DB ]

This isn't working. Where is this "i#"?
Mousa55
Super Advisor

Re: Run The Database Automatically

Hi All,

How to make my server to start/shutdown the database automatically.

thanks
Michael Mike Reaser
Valued Contributor

Re: Run The Database Automatically

Refer to the documentation for the database package(s) you're using. If the database(s) can be started at system boot time, then their manuals should state the way to set up the /sbin/init.d/[whatever] script and where to link it under the /sbin/rc[0-4].d hierarchy.
There's no place like 127.0.0.1

HP-Server-Literate since 1979
Yogeeraj_1
Honored Contributor

Re: Run The Database Automatically

> How to make my server to start/shutdown the database automatically.

You may wish to follow guidelines found at this url:
http://docs.hp.com/en/934/startup.pdf


hope this help!

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

Re: Run The Database Automatically

Hi All,

thanks for all, but Is there any script ready?
and then change it to match my system.

thanks again
Dennis Handly
Acclaimed Contributor

Re: Run The Database Automatically

>but is there any script ready?

There is a rc(1m) template in /sbin/init.d/template.
OldSchool
Honored Contributor

Re: Run The Database Automatically

*somebody* starts it and stops it today. You, the dba or ???

find out what they have to run to start it. Find out what they have to run to stop it.

then use a "rc template" file to do the actual work...