- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Oracle Startup / Shutdown Script
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
05-19-2003 12:24 PM
05-19-2003 12:24 PM
Basically what I need is a script that I can run prior to a backup kicking off, to bring all the databses down, and then after the backup job is completed to bring them back up. This isn' the normal startup/shutdown script that runs on boot in rc.
ANy help would be appreciated.
Thanks,
Gus
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2003 01:46 PM
05-19-2003 01:46 PM
Re: Oracle Startup / Shutdown Script
Attached is a tar file.
It contains these three files...
rwxr-xr-x 0/3 1079 Dec 24 08:08 2002 /usr/contrib/bin/shut.oracle
rwxr-xr-x 0/3 159 Dec 24 08:08 2002 /usr/contrib/bin/shutsid.sh
rwxr-x--- 0/3 1246 Nov 6 08:39 2002 /sbin/init.d/oracle
These scripts are designed to read the /etc/oratab file and shut down any instances desginated as Y or active at machine startup.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2003 05:33 PM
05-19-2003 05:33 PM
Re: Oracle Startup / Shutdown Script
$ORACLE_HOME/bin/dbshut
it will shutdown instance base on information in /etc/oratab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2003 07:34 PM
05-19-2003 07:34 PM
Re: Oracle Startup / Shutdown Script
If you have all the working database defined in your /etc/oratab file the just call
the script $ORACLE_HOME/bin/dbshut to shutdown all the databases before the backup and then after the backup call
the script
$ORACLE_HOME/bin/dbstart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2003 07:43 PM
05-19-2003 07:43 PM
Re: Oracle Startup / Shutdown Script
we normally uses dbshut and dbstart scripts in bin directory inside $ORACLE_HOME
radhakrishnan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2003 11:16 PM
05-19-2003 11:16 PM
Re: Oracle Startup / Shutdown Script
Just want to add that it might be wise to edit the dbshut script to do a "shutdown immediate" instead of the "shutdown [normal]"
This prevents you from having user sessions blocking the shutdown of the database and thus making the backup invalid.
("Shutdown normal" awaits the end of transactions before shutting down the instance)
rgds
Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2003 11:50 PM
05-19-2003 11:50 PM
SolutionWe use startup and shutdown scripts found in the /etc/rc*.d directories to make things happen. Many times, these just run a script "dbstart" and "dbshut".
It is preferable to do it yourself though.
Normally, you would setup (as root) the startup/shutdown script in /etc/rc3.d and /etc/rc0.d. Mine are /etc/rc3.d/S100oracle" (startup)and "/etc/rc0.d/K100oracle" (kill).
These scripts are actually a symbolic link to the single script /etc/init.d/oracle. It contains only:
#!/bin/sh
# Start/stop processes required for oracle
case "$1" in
'start')
su - oracle8i -c orastart
su - ias902 -c webstop
;;
'stop')
su - ias902 -c webstop
su - oracle8i -c orastop
;;
esac
In my case, i have 2 Oracle accounts on my machine, one for the 9iAS and 1 for the database. I run simply a script "orastart" to start stuff for them and "orastop" to stop them. I write orastart and orastop. The nice thing about this is that if oracle8i needs to add/remove something from its startup/shutdown -- he doesn't need to get root to update the script, he just modifies orastart/stop.
The orastart script for Oracle8i is as follows:
#!/bin/csh
lsnrctl start
svrmgrl << EOF
connect internal
startup
exit
EOF
Put it in $ORACLE_HOME/bin for Oracle8i. It starts the listener, starts the database.
The shutdown script is similar, it looks like:
#!/bin/csh
lsnrctl stop
svrmgrl << EOF
connect internal
shutdown immediate
exit
EOF
If I needed to start more then one listener, I would have the appropriate commands in there to do so.
This shows how to automate the starting of virtually anything (not just Oracle stuff) on HP-UX....
Hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 11:33 AM
05-20-2003 11:33 AM
Re: Oracle Startup / Shutdown Script
Same thing has happend during system shutdown.
My scripts solve both problems.
I hope that the earlier answers by myself or other help, if so, please throw the other guys some points.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 03:00 PM
05-20-2003 03:00 PM
Re: Oracle Startup / Shutdown Script
Thanks,
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 10:44 PM
05-20-2003 10:44 PM
Re: Oracle Startup / Shutdown Script
I find that the commands that handle the listener require a terminal. There is probably a way around, but since the dtaa base is closed even with an open listener, I just do not bother.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2003 07:32 AM
05-21-2003 07:32 AM
Re: Oracle Startup / Shutdown Script
his shutdowns sometimes "hangs". Shutting down Oracle using the oracle supplied dbshut normally should never hang if You FIRST modify the scripts as noted in a previous thread, by changing to "shutdown immediate" from just "shutdown". Out of the box oracle supplied dbshut script only has "shutdown". A "shutdown" without the immediate or abort option gives the appearance of Oracle hanging, because it is waiting for everyone to logout. I do not recommend "shutdown abort" as an accepted method for taking oracle down. If you have to do an abort, It would be wise to find out what is hanging your Oracle instance. The "hang" might be caused by a long transaction being rolled back or Archive log space is full.
On my system I do not have the luxury to have regular downtimes for backups. All our backup are hotbackups. . We schedule the backups during non peak times. Recovery and full restoral has not been a problem. You should automate Oracle shutdown/startup for OS System reboots. Which is why dbshut/dbstart is associated with /sbin/init.d /etc/rc.d etc.. I also think normal backups should be done without shutting down oracle. If the shuting down of oracle "cleans" things up, time would be better served finding out why unwanted processes/thread/client sessions "things" are hanging around.
I will get off my soap box now.
Good Luck
Rory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2003 07:45 AM
05-21-2003 07:45 AM
Re: Oracle Startup / Shutdown Script
Thanks everyone for the replies. I'll be sure to assign points to all.
Gus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2003 12:57 AM
05-26-2003 12:57 AM
Re: Oracle Startup / Shutdown Script
To your question about runnig online backups; use Oracle Recovery Manager (RMAN).
It lets you do online backup (full or incremental) and all kinds of recovery scenarioes.
Do not know if you have to use some software to connect to Omniback. We use Legato and this requires an rather expensive module for connectiong the RMAN to the Legato software (but it works well)
rgds
Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2003 03:21 AM
05-26-2003 03:21 AM
Re: Oracle Startup / Shutdown Script
As Andreas said above, RMAN is the way to go!
BECAUSE
RMAN decreases the chance of you making a mistake.
do you regularly test your backups?
I was with a customer who wanted to know why their system was down for days -- yes, days. Why so long? Well, they had a problem, had to restore from backup. Never tested said backup. Discovered all of a sudden their script kicked off the copies BEFORE the alter tablespace begin backup. Whoops - System was fried. Support helped them scavenge what they could but basically, it was a rebuild of the entire big database. That would not happen with RMAN -- less for them to think about, less mistakes possible.
Consider the following also:
You have a single bad block in a 16gig datafile, you are using RMAN in 9i. What do you do? You do an in place recovery of just the bad block, you do not offline the datafile, you do not offline the tablespace, you do not do 16gig of IO to restore the file, you do not roll 16gig of data forward. You recover an individual 8k block.
What would have happened if you didn't use RMAN?
take tablespace offline, restore 16gig, roll it forward then bring it online.
Which gives you less downtime?
Which fully recovers the fastest?
Which would you prefer to do?
In the end -- if you know what you are doing fully, you TEST the backups on a recurring basis, you don't mind being down for a bad block -- the old fashioned way works but -- times are changing, there are more and more reasons to use it.
I would also recommend that you do your backup to disk first then send them to tape (of course if you can afford it!)
Good luck!
If you want more about RMAN, please let us know...
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2003 12:21 PM
05-27-2003 12:21 PM
Re: Oracle Startup / Shutdown Script
1. We put oracle in backup mode.
2. then broke the mirrors
3. took oracle out of backup
mode
4. fsck the the mirrors.
5. mount the mirrors in a
different sub directory.
6. backed them up.
Having said the above. RMAN is better. especially if you do not have mirroring.
Rory