Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle db_shut
Arcadio Ortega Reinoso wrote:
>
> Hello!:
>
> Maybe somebody could help us with this: We have installed
> Oracle 6.0.37.1 on a SparcStation 1000 running Solaris 2.3. It's
> for academic purposes and over 300 students of 3 different courses
> use it.
>
> The machine is to be rebooted automatically by a cron job
> every midnight...
> ____________________________________________________________________
> # crontab -l
> #ident "@(#)root 1.11 93/04/08 SMI" /* SVr4.0 1.1.3.1 */
> #
> # The root crontab should be used to perform accounting data collection.
> #
> ...
> 0 0 * * * /sbin/shutdown -y -g30 -i6
> #
> ____________________________________________________________________
> ...and Oracle should also shutdown when the script /sbin/rc0
> says...
> ____________________________________________________________________
> % pwd
> /sbin
> % more rc0
> #!/sbin/sh
> ...
> if [ -d /etc/rc0.d ]
> then
> for f in /etc/rc0.d/K*
> {
> if [ -s ${f} ]
> then
> case ${f} in
> *.sh) . ${f} ;; # source it
> *) /sbin/sh ${f} stop ;; # sub shell
> esac
> fi
> }
> ...
> ____________________________________________________________________
> ...because we made a K-file to do a dbshut...
> ____________________________________________________________________
> % pwd
> /etc/rc0.d |
> % ls v
> K00ANNOUNCE K47asppp K69autofs K05dbshut <----- there
> K20lp K50utmpd K66nfs.server K70cron
> K42audit K55syslog K68rpc K75nfs.client
> %
> % cat K05dbshut
> su - oracle -c /opt2/oracle/bin/dbshut
> %
> ____________________________________________________________________
> ... and the corresponding S-file to wake Oracle up...
> ____________________________________________________________________
> % pwd
> /etc/rc2.d
> % ls
> K20lp S20sysetup S71sysid.sys S92volmgt
> K60nfs.server S21perf S72autoinstall S95orasrv <---- there
> K65nfs.client S30sysid.net S72inetsvc S96dbstart <----
> K92volmgt S47asppp S73autofs S99audit
> ...
> %
> % cat S95*
> su - oracle -c /opt2/oracle/bin/orasrv
> % cat S96*
> su - oracle -c /opt2/oracle/bin/dbstart
> %
> ____________________________________________________________________
> ...but sometimes, the following day we find an incomplete
> reboot. When we log into the machine, we find...
>
> 1) "dbshut" process running
> 2) ***and!*** "dbstart" process !!!
>
> The machine works. Oracle doesn't, of course. Users can log
> into the system and work as long as they don't touch Oracle. When
> we notice the problem and kill the "dbshut" (which may have
> accumulated several elapsed time hours), the machine hangs up.
> Completely. Only <Stop>A works then.
>
> Does anybody knows why? What's the meaning of the line
>
> > ...
> > *.sh) . ${f} ;; # source it
> > ...
> ... in /sbin/rc0? (specially the dot ".")? Should the other line...
>
> > ...
> > *) /sbin/sh ${f} stop ;; # sub shell
> >
>
> ... (which starts /etc/rc0.d/K05dbshut) block the /sbin/rc0 script
> until K05dbshut finishes? If so, why then we find "dbstart" processes when
> there are still "dbshut" processes running?
>
> If not, (that was our first suspicion), then is it possible for
> the reboot procedure to reach state 0 _before_ dbshut terminates?? Then
> would it make any sense to rename K05dbshut to K05dbshut.sh?? We tried it
> and the system then doesn't even stays alive. Only <Stop>A works.
>
> Also, the beginnning of our /opt2/oracle/bin scripts gets us
> confused. What does mean ":"??
> ____________________________________________________________________
> % pwd
> /opt2/oracle/bin
> % ls db*
> dbfsize dbshut dbstart
> dbhome
> % head -3 dbs*
> ==> dbshut <==
> :
> #
> # $Header: dbshut.sh.pp 7.6 93/07/29 16:32:31 plobo Osd<unix> $ dbshut.sh.pp Copyr (c) 1991 Oracle
>
> ==> dbstart <==
> :
> #
> # $Header: dbstart.sh.pp 7.5 93/07/29 16:59:56 plobo Osd<unix> $ dbstart.sh.pp Copyr (c) 1991 Oracle
> %
> ____________________________________________________________________
>
> Thank you very much for reading up to this point, and thanks
> in advance for any help.
I couldn't reach you directly because you e-mail is not correct.
The line
>>> for f in /etc/rc0.d/K*
sets the variable ${f} to value of each K name in the directory in turn.
The lines
>>> case ${f} in >>> *.sh) . ${f} ;; #
Compare the value of variable f to anything ending with ".sh" and if it does end with ".sh" then it executes it using a "source" command, which essentially treats the content of the file referenced by ${f} as if they had been typed in at the spot. This also means that UNIX environment variables set at this time are not lost when the script ends.
The line
>>> *) /sbin/sh ${f} stop ;; #
means that if the value of f is anything else, the file referenced by ${f} is executed in a subshell (and variables are not preserved.).
Whatever your problem is these lines are probably not it.
Why is the dbshut still running? Why doesn't the shutdown, reboot of the system clear this process? Do you actually shutdown the system after all?
What is in your /etc/oratab file? (dbshut will not normally affect a database if it does not appear in or has N as the third field in /etc/oratab)
Good luck. Share your e-mail address if you need more help.
Marek Received on Tue Dec 03 1996 - 00:00:00 CST
![]() |
![]() |