- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Dbshut and dbstart
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
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
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-22-2006 07:03 AM
тАО05-22-2006 07:03 AM
I am unixadmin and dba's gave the scripts to start the oracle when server reboots and stop the database gracefully when the server is going to reboot/shutdown.
Now the problem is it doesn't stop the database and hangs there...
What I did was, created the following files:
/sbin/init.d/dbshut
/sbin/init.d/dbstart
And linked as follows:
/sbin/rc0.d/K01dshut -> /sbin/init.d/dbshut
/sbin/rc3.d/S824dbstart -> /sbin/init.d/dbstart
And when rebooted the server, oracle didn't come up.
Any ideas, how to put startup and shutdown scripts in HPUX.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:16 AM
тАО05-22-2006 07:16 AM
Re: Dbshut and dbstart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:18 AM
тАО05-22-2006 07:18 AM
Re: Dbshut and dbstart
Thanks for the response but where should I include 'shutdown immediate'?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:19 AM
тАО05-22-2006 07:19 AM
Solutiondbshut ships with a bug.
It should say shutdown immediate but says shutdown.
shutdown waits for the users to terminate their sessions, which means pretty much forever.
change dbshut and you should be fine.
There are however not bugs that I know of in dbstart.
Put a set -x in the top of that script and/or redirect the output to a file and restart your server for further diagnostics.
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-22-2006 07:28 AM
тАО05-22-2006 07:28 AM
Re: Dbshut and dbstart
Still I didn't get.
Instaed of /sbin/init.d/dbshut are you saying to put /sbin/init.d/shutdown?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:29 AM
тАО05-22-2006 07:29 AM
Re: Dbshut and dbstart
directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:29 AM
тАО05-22-2006 07:29 AM
Re: Dbshut and dbstart
This would hang the shutdown because the database is waiting for all connections to be closed. If users are working, or do not logout, connections will never close and the shutdown will not complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:36 AM
тАО05-22-2006 07:36 AM
Re: Dbshut and dbstart
#!/usr/bin/sh
/usr/bin/su oracle -c '
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:48 AM
тАО05-22-2006 07:48 AM
Re: Dbshut and dbstart
You need to modify the dbshut script.
vi the file and look the for the line containing shutdown
change the line to shutdown immediate
HTH DCE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:55 AM
тАО05-22-2006 07:55 AM
Re: Dbshut and dbstart
su - oracle -c "/opt/oracle/product/9.2.0/bin/dbstart"
etc.
you can make one script that does the dbshut in response to the "stop" parameter and dbstart in response to the "start" parameter. then create the links as you have above, but to the new script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 09:14 AM
тАО05-22-2006 09:14 AM
Re: Dbshut and dbstart
It seems that you are calling the script which shuts down the database as per your note
"/usr/bin/su oracle -c '
Please check if this script, your dba gave to you, has the shutdown immediate command. Or post the script.
It seems that your database did not shutdown properly and hence it failed to start.
Also check the contents of /etc/oratab - usually this is referred by scripts to check if database is to be started automatically during startup
There should be a Y for the database SID you want to startup.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 06:55 PM
тАО05-22-2006 06:55 PM
Re: Dbshut and dbstart
echo "INFO_SGAURD_DESA: Parando Oracle CASS100"
su - oracle -c '
. /home/oracle/oradb/conf/profile_oradb
#Borramos el fichero orapwORADB
rm $ORACLE_HOME/dbs/orapwORADB
sqlplus /nolog <
shutdown immediate
exit;
EOF
'
"profile_oradb":
set +u
id|grep oracle > /dev/null
if [ $? -eq 0 ]
then
ORACLE_HOME=/opt/oracle
export ORACLE_HOME
ORACLE_SID=ORADB
export ORACLE_SID
export PS1='$LOGNAME@'`/usr/bin/hostname`[$ORACLE_SID]':$PWD$ '
else
ORACLE_HOME=/opt/oracle
export ORACLE_HOME
unset ORACLE_SID
TWO_TASK=ORADB
export TWO_TASK
export PS1='$LOGNAME@'`/usr/bin/hostname`[$TWO_TASK]':$PWD$ '
fi
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORA_NLS33
rgs,
ran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 07:56 PM
тАО05-22-2006 07:56 PM
Re: Dbshut and dbstart
That is because the Oracle software comes
default like this. (Thinking we live
in an ideal world were all users log out
as they should etc.. etc..)
You and I know that is never the case,
so the first thing I do when I deal with
an Oracle db on hpux.
I modify the dbshut and
change shutdown to shutdown immediate
and I modify the oraenv file and
delete the last lines with osh
And this has been so since the nineties.
Amazing hey.
Keep cooking:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 08:25 PM
тАО05-22-2006 08:25 PM
Re: Dbshut and dbstart
Form you following line...
/sbin/rc0.d/K01dshut -> /sbin/init.d/dbshut
/sbin/rc3.d/S824dbstart -> /sbin/init.d/dbstart
I noticed that the sequencer script dbstart is fine, but dbshut is pushed too low down. Make sure, you link it in /sbin/rc2.d instead /sbin/rc0.d
Basically it should be...
/sbin/rc2.d/K01dshut -> /sbin/init.d/dbshut
In your current case, your DB is being shutdown after all your network service goes down in rc2 - rc1 transition. During rc1 - rc0 transition there is no network service available when you are performing DB shutdown currently. This could be one reason for a hang though may not confirm. Also apart from network services ,there are numerous other services you had be missing at the time of rc1 - rc0 transition.
So try changing dbshut to "rc2.d" instead of "rc0.d" dir and test it.
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2006 08:31 PM
тАО05-22-2006 08:31 PM
Re: Dbshut and dbstart
instead of K01dshut, rename it as K176dshut.
Try these commands to rectify...
rm /sbin/rc0.d/K01dshut
ln -s /sbin/init.d/dbshut /sbin/rc2.d/K176dshut
ll /sbin/rc2.d/K176dshut
Now you should be seeing a file ...
/sbin/rc2.d/K176dshut -> /sbin/init.d/dbshut
Now go ahead and test it...
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2006 06:31 AM
тАО05-23-2006 06:31 AM
Re: Dbshut and dbstart
Thank you for all the help and thanks to everyone who is helping out.
Still it doesn't work.
"There should be a Y for the database SID you want to startup."
How can I enable the above in /etc/oratab file.
# $ORACLE_SID:$ORACLE_HOME:
Do I need to enable like the following:
$ORACLE_SID:$ORACLE_HOME:
Please let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2006 06:35 AM
тАО05-23-2006 06:35 AM
Re: Dbshut and dbstart
And one more thing:
What does the following does in /etc/oratab file:
*:/u01/app/oraias/product/Appserv:N #9.0.4.2 App server
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2006 07:13 PM
тАО05-23-2006 07:13 PM
Re: Dbshut and dbstart
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
rgs,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2006 08:02 PM
тАО05-23-2006 08:02 PM
Re: Dbshut and dbstart
As I said earlier - it depends on the script you are using to startup and shutdown the database - which in most cases refers to this file /etc/oratab to see if there are any databases to be started when system comes up.
First thing would be to check your script used for startup and shutdown. Does the startup script check /etc/oratab ? If yes then simply edit the file using vi editor and put a Y if there is a N for the database SID entry you wish to start the database at startup.
This is also assuming you are not running a MC Service Guard cluster [ In which case the database is started as part of a package startup ] Are you running in a cluster or standalone ?
ps -eaf | grep cmcl
Again I would like to say - please check the script you said your DBAs gave you - the actual script you call after the su oracle.
Another thing - try
su - oracle -c '
instead of
su oracle -c '
Also have you tried the suggestion of shutting down the database at run level 2 while shutting down the system by linking the shutdown script into /etc/rc2.d ??
Another thing - have you tried to run the shutdown script manually - ofcourse after throughly checking all the above suggestions regarding the script first.
Please let us know what all you have tried.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2006 02:19 AM
тАО05-24-2006 02:19 AM
Re: Dbshut and dbstart
Makes a lot of sense.
There is a dbshut script and dbstart under
$ORACLE_HOME/bin
These are to be used in our
/sbin/init.d/oracle
(You could have a seperate one for our listener)
/sbin/rc0.d/K01oracle_stop -> /sbin/init.d/oracle
/sbin/rc3.d/S824oracle_start /sbin/init.d/oracle
The /sbin/init.d/oracle script should look
see attached
and the that oracle script should call
dbshut under $ORACLE_HOME as the oracle
owner (and in that dbshut command you should
have 'shutdown immediate' for the correct version of your oracle)
Furhtermore
Oratab needs to be correct thus:
autoP1:/usr/oracle/product/9.2.07:Y
One note: If your db is hanging or blocked,
then the only way out is a shutdown abort,
then a startup and then run your
/sbin/init.d/oracle stop and start again
for a clean stop and start !!
Hope u get it sorted :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2006 02:21 AM
тАО05-24-2006 02:21 AM
Re: Dbshut and dbstart
/sbin/init.d/oracle
You can run this manually
as well with stop and start
or it will be run by the rc command.
good luck:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2006 06:08 AM
тАО05-24-2006 06:08 AM
Re: Dbshut and dbstart
Thank you very much for all your help. Finally it is working with "su - oracle" in the script.
I really appreciate each and everyone who helped me out on this.
Thanks again alot!