- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Startup and Shutdown scripts - Please help !
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
Forums
Discussions
Discussions
Discussions
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
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
11-09-2000 03:01 AM
11-09-2000 03:01 AM
Startup and Shutdown scripts - Please help !
I would like my server to automatically bring up and shutdown my databases when the server boots up and shutdown respectively.(in the event that should there be a power failure in the middle of night and the server was rebooted, at least my databases are shutdown properly and was UP when I come into the office the next day)
How do I do that? Which files should I edit?
Currently we are running a cron job to schedule it to shutdown at and reboot at a specific time in the middle of the night.
Please help !
Regards,
Shirley
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:13 AM
11-09-2000 03:13 AM
Re: Startup and Shutdown scripts - Please help !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:18 AM
11-09-2000 03:18 AM
Re: Startup and Shutdown scripts - Please help !
To fully understand how the startup/shutdown mechanism works at boot time, see this white paper:
http://docs.hp.com/hpux/onlinedocs/os/boot.html
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:22 AM
11-09-2000 03:22 AM
Re: Startup and Shutdown scripts - Please help !
(
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/etc
export PATH ;;
esac
ORACLE_HOME=/oracle/oracle export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH export PATH
# instance specific startup section
ORACLE_SID=databasename export ORACLE_SID
svrmgrl <
startup
EOF
if [ $? -eq 0 ]; then
echo ""
echo "Database "${ORACLE_SID}" WARM started."
else
echo ""
echo "Database "${ORACLE_SID}" NOT started."
fi
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:23 AM
11-09-2000 03:23 AM
Re: Startup and Shutdown scripts - Please help !
(
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/etc
export PATH ;;
esac
ORACLE_HOME=/oracle/oracle export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH export PATH
# instance specific startup section
ORACLE_SID=databasename export ORACLE_SID
svrmgrl <
startup
EOF
if [ $? -eq 0 ]; then
echo ""
echo "Database "${ORACLE_SID}" WARM started."
else
echo ""
echo "Database "${ORACLE_SID}" NOT started."
fi
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:23 AM
11-09-2000 03:23 AM
Re: Startup and Shutdown scripts - Please help !
Here attached is the startup script we use.
It needs to be put in /sbin/init.d
You'll also need:
2 symbolic links to that file
the first one in /sbin/rc3.d called i.e. S999oracle
the second one in /sbin/rc2.d called i.e. K999oracle
a config file named /etc/rc.config.d/oracle containing the following (edit to your needs)
--- cut here ---
# @(#) $Revision: 1.0 $
# File: /etc/rc.config.d/oracle
#
# The variable ORA_START controls whether the ORACLE will be
# started on entering multiuser mode. By default it is not started.
# If you want it to be, set the value to 1.
# (31.05.95, Foerster/HP)
#
#
ORA_START=1
#
#
# ORA-administrator-user:
ORA_USER="oracle"
#
#
# Command to start up all databases :
ORA_START_COMMAND="/usr/local/bin/dbstartd"
#
# Command to shutdown all databases :
ORA_STOP_COMMAND="/usr/local/bin/dbshutd"
#
#
# Command to start LISTENER :
LSNR_START_COMMAND="/opt/oracle/734/bin/lsnrstart"
#
# Command to start AGENT :
AGENT_START_COMMAND="/usr/local/bin/dbsnmp_start"
#
# Command to stop LISTENER :
LSNR_STOP_COMMAND="/opt/oracle/734/bin/lsnrstop"
#
# Command to stop AGENT :
AGENT_STOP_COMMAND="/usr/local/bin/dbsnmp_stop"
#
#
#
# (end)
--- cut here
The mechanism is the following:
When entering multi-user (level 3 = default), scripts in /sbin/rc3.d starting with letter S (for start) are run.
As well as scripts in rc1.d rc2.d before that
When shutting down, coming from level 3, all scripts in rc2.d, rc1.d and rc0.d starting with letter K (for kill) are run
This would start/stop oracle.
Adjust all variables here above to suit your settings.
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:23 AM
11-09-2000 03:23 AM
Re: Startup and Shutdown scripts - Please help !
Here's a thread that will get you started:
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x8afc6c96588ad4118fef0090279cd0f9,00.html
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:24 AM
11-09-2000 03:24 AM
Re: Startup and Shutdown scripts - Please help !
(
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/etc
export PATH ;;
esac
ORACLE_HOME=/oracle/oracle export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH export PATH
# instance specific startup section
ORACLE_SID=databasename export ORACLE_SID
svrmgrl <
startup
EOF
if [ $? -eq 0 ]; then
echo ""
echo "Database "${ORACLE_SID}" WARM started."
else
echo ""
echo "Database "${ORACLE_SID}" NOT started."
fi
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:25 AM
11-09-2000 03:25 AM
Re: Startup and Shutdown scripts - Please help !
Not sure the file attached properly
Here is it
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 03:26 AM
11-09-2000 03:26 AM
Re: Startup and Shutdown scripts - Please help !
(
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/etc
export PATH ;;
esac
ORACLE_HOME=/oracle/oracle export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH export PATH
# instance specific startup section
ORACLE_SID=databasename export ORACLE_SID
svrmgrl <
startup
EOF
if [ $? -eq 0 ]; then
echo ""
echo "Database "${ORACLE_SID}" WARM started."
else
echo ""
echo "Database "${ORACLE_SID}" NOT started."
fi
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 04:33 AM
11-09-2000 04:33 AM
Re: Startup and Shutdown scripts - Please help !
In your question you mention "in the event of a power failure".
This brings up two points:-
1. Are your servers not running off a UPS?
2. If the server shuts down due to a power failure the chance of a Database corruption is high and automaticlly bringing up a database without control has potential problems.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 05:11 AM
11-09-2000 05:11 AM
Re: Startup and Shutdown scripts - Please help !
For a complete explanation of the scripts and how to customize your system, check out the startup/shutdown white paper:
/usr/share/doc/start_up.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 10:03 AM
11-09-2000 10:03 AM
Re: Startup and Shutdown scripts - Please help !
1) follow instruction of document 98418.1 from oracle
2) edit the dbstart file again. replace the awk line /PLVSQL (Release|Version) with
/JServer (Release|Version)
Just following the step one would not solve the problem if it is not enterprise version.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2000 11:48 AM
11-09-2000 11:48 AM
Re: Startup and Shutdown scripts - Please help !
Also you can descide in which init level the database should come up. If you want the database to come up at 4 level, then you have to link the the database startup script in /sbin/init.d/dbstart to /sbin/rc4.d, by executing
"ln -s /sbin/init.d/dbstart /sbin/rc4.d/S9500dbshut". Also you have to edit /etc/inittab and change the value after init to 4. When system comes up, init will execute scripts in /sbin/rc2.d then rc3.d and rc4.d.
This way you can configure your software to start specfically after some app has started.
Hope it helps.
Cheers