- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: startup/shutdown scripts
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
Discussions
Discussions
Forums
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
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
тАО09-11-2001 05:12 PM
тАО09-11-2001 05:12 PM
Please assist me..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2001 07:17 PM
тАО09-11-2001 07:17 PM
Re: startup/shutdown scripts
What you need to know is normally illustrated in the Oracle Installation Guide. There is a script that Oracle have written called dbstart dbshut. You will need to create and modify a script which should be located in your /sbin/init.d called dbora, to call these scripts. This helps when you shutdown the Unix box. It cleanly shutdowns the databases you have running.
There are also a couple of other scripts that you can use to intergrate with these to copy the control files and redo logs onto script.
I don't know if this is what you are actually looking for. but i hope i have pointed you in the right direction.
My dbora script looks like this.
#!/bin/sh
# Set ORA_HOME to be equivalent to the ORACLE_HOME from which
# you wish to execute dbstart and dbshut
#
# Set ORA_OWNER to the user id of the owner of the Oracle
# database in the ORA_HOME
ORA_HOME=/u01/app/oracle/product/8.1.7
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login will not
# prompt the user for any values
echo "Oracle Startup in progress"
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login will not
# prompt the user for any values
echo "Oracle Shutdown in progress"
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
;;
esac
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2001 07:50 PM
тАО09-11-2001 07:50 PM
Re: startup/shutdown scripts
Get the startup and shutdown scripts from your DBA. You can use any file in /sbin/init.d/ as a template. Copy it to the name that you want. Basically this script takes one argument. There would be four types of the argument. start_msg, stop_msg, start, stop. There are case statements that call different routines based on the argument passed. It is very self-explanatory if you look at any of the scripts in /sbin/init.d Once this is done, create links from either /sbin/rc3.d or /sbin/rc4.d depending on the default run level you have in your /etc/inittab. (mostly rc3.d).
For ex., you call your scripts as oracle,oracle_lsnr first test them
#/sbin/init.d/oracle start
#/sbin/init.d/oracle stop
#/sbin/init.d/oracle_lsnr start
#/sbin/init.d/oracle_lsnr stop
Once these scripts are working, now create links
#ln -s /sbin/init.d/oracle /sbin/rc3.d/S925oracle
#ln -s /sbin/init.d/oracle /sbin/rc3.d/K925oracle
#ln -s /sbin/init.d/oracle_lsnr /sbin/rc3.d/S926oracle_lsnr
#ln -s /sbin/init.d/oracle_lsnr /sbin/rc3.d/K926oracle_lsnr
The above number decide when the scripts are to be run in that run level.
You can also control these scripts by calling the "flag scripts" from /etc/rc.config.d directory. Here you can set a flag like ORACLE=0 or 1 and you can verify this flag in your /sbin/init.d/ script.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2001 05:00 AM
тАО09-12-2001 05:00 AM
Re: startup/shutdown scripts
the only way to be certain you copy the "real" files, is
to ask the Oracle instance before shutting it down:
su - oracle
svrmgrl
connect internal
startup exclusive
spool files.lst
select name from v$controlfile;
select member from v$logfile;
select name from v$datafile;
spool off
shutdown immediate
exit
echo $ORACLE_HOME/dbs/init$ORACLE_SID.ora > list
grep '/' files.lst | tr -d ' ' >> list
cp $(cat list) /backup
dbstart
This will make a full offline backup of you instance.
But really, it needs more to set up a proper procedure
to backup and restore a productive Oracle DB server!
Be careful. Kevin Loneys book "DBA Handbook" might
be a good starting point for you.
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2001 06:53 AM
тАО10-09-2001 06:53 AM
SolutionThe dbshut and dbstart files can be modified in ORACLE_HOME/bin for your instances and yur start/stop script placed in /sbin/init.d folder. For the script callup program in /etc/rc.config.d. With the startup link in /sbin/rc3.d (S###orac???) and stop link file in sbin/rc1.d (K###orac???)with the proper sequence numbers. Always check the etc/rc.log file for any errors. See attached file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2001 07:03 AM
тАО10-09-2001 07:03 AM
Re: startup/shutdown scripts
This script is for daily Flexcube/Oracle control file and Redo log backups. Pls see the attached file. It shuts down the databases, creates a folder with the day's date. The program also copies your files to a created directory for the day and sends mail to the DBA's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2001 07:36 AM
тАО10-09-2001 07:36 AM
Re: startup/shutdown scripts
You can now award your scores so that we know how we have helped you.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2001 08:30 AM
тАО10-09-2001 08:30 AM
Re: startup/shutdown scripts
since s/he does not respond, I guess s/he is
not really interested :-(
BUT, this is a pretty good candidate for a FAQ,
is it not?
Kind regards,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2001 04:34 AM
тАО10-16-2001 04:34 AM
Re: startup/shutdown scripts
Dont forget to assign the points who helped you....
Rajkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2001 06:35 AM
тАО11-12-2001 06:35 AM
Re: startup/shutdown scripts
Noble Advice indeed.
From your profile:
This member has assigned points to 45 of 98 responses to his/her questions.
:-)