1748156 Members
4237 Online
108758 Solutions
New Discussion юеВ

Re: Dbshut and dbstart

 
SOLVED
Go to solution
Ninad_1
Honored Contributor

Re: Dbshut and dbstart

Hi,
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
rariasn
Honored Contributor

Re: Dbshut and dbstart

Sample shutdown:

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 <connect / as sysdba
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
Frank de Vries
Respected Contributor

Re: Dbshut and dbstart

Yes, that happens.
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:)
Look before you leap
Senthil Kumar .A_1
Honored Contributor

Re: Dbshut and dbstart

Hi Prathiba,

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
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Senthil Kumar .A_1
Honored Contributor

Re: Dbshut and dbstart

Also,

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
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Qcheck
Super Advisor

Re: Dbshut and dbstart

Hi Senthil,

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.
Qcheck
Super Advisor

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
rariasn
Honored Contributor

Re: Dbshut and dbstart

# This file is used by ORACLE utilities. It is created by root.sh
# 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,
Ninad_1
Honored Contributor

Re: Dbshut and dbstart

Pratibha,

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
Frank de Vries
Respected Contributor

Re: Dbshut and dbstart

I go with what Ninad Date is saying.
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 :)


Look before you leap