Re: Oracle 8i database doesn't shutdown automatically

From: Pascal Gineste <pgineste_at_gfi.fr>
Date: 20 Jan 2003 00:59:12 -0800
Message-ID: <e77e76b5.0301200059.4d7c121a_at_posting.google.com>


rs_arwar_at_hotmail.com (Rauf Sarwar) wrote in message news:<92eeeff0.0301151755.622e6e32_at_posting.google.com>...
> pgineste_at_gfi.fr (Pascal Gineste) wrote in message news:<e77e76b5.0301150642.2cbf74c@posting.google.com>...
> > I have 8i (8.1.7) database that starts automatically when
> > OracleServices<SID> is started from the control panel/Services.
> >
> > I can stop the database using .cmd file that contains such
> > line:
> >
> > stop.bat
> > oradim.exe -shutdown -sid <SID> -usrpwd <MDP> -SHUTTYPE "INST"
> > -SHUTMODE "N"
> >
> > oradim.exe -shutdown -sid <SID> -usrpwd <MDP> -SHUTTYPE "SRVC"
> > -SHUTMODE "N"
> >
> > With this batch, the database is closed correctly, and this operation
> > is traced in <Sid>Alrt.log
> >
> > However, when performing all this two lines in one step in my
> > stop.bat command file:
> >
> > oradim.exe -shutdown -sid <SID> -usrpwd <MDP> -SHUTTYPE "SRVC,INST"
> > -SHUTMODE "N"
> >
> > the service is directly stopped without closing the database properly
> > (no shutdown is performed; even an abort one): no log is traced in
> > <Sid>alrt.log and the database restarts in recovery mode.
> >
> > So, when i stop the service OracleServices<Sid> manually in the
> > control panel/services; it performs the same tasks: kill the services
> > without shutdowning the database properly.
> >
> > I have checked the registry settings in
> > HKLM\Software\Oracle\Home<N>
> > and i have got :
> > ORA_<SID>_SHUTDOWN = "TRUE"
> > ORA_<SID>_SHUTDOWNTYPE = "i"
> > ORA_<SID>_SHUTDOWN_TIMEOUT = "60"
> >
> > Rem: 60 is enough because it took 2 seconds to kill the service
> > (without shutdowning the instance ....).
> >
> > I tried to delete the service; delete the entries related to
> > this <Sid> from the registry and recreate the service with:
> >
> > C:\ORANT81\bin\oradim -new -sid <SID> -startmode manual
> > C:\ORANT81\bin\oradim -edit -sid <SID> -usrpwd oracle -SHUTTYPE SRVC
> > -SHUTMODE i
> > C:\ORANT81\bin\oradim -edit -sid <SID> -startmode auto
> >
> > -> it recreates the same entries in the registry.
> >
> > However, the problem is still there ?????
> > Can you help me ?
> > I would like this database to shutdown automatically when machine is
> > shutting down.
> >
> > PS: SQLNET.AUTHENTICATION_SERVICES = (NONE) or (NTS)
> > -> the behavior is similar.
> >
> > Thank you in advance,
> > P. Gineste
>
>
> First of all you are using -SHUTMODE "N"... this makes the database
> wait until all sessions are disconnected before shutting down. Use
> -SHUTMODE "I".
>
> Secondly, I personally don't like to use oradim tool other then to
> create and delete a SID service. I have found Oradim to behave
> strangely sometimes when used to shutdown or startup the database. If
> you want to shutdown the database cleanly, I would suggest you modify
> your batch file e.g.
>
> stop.bat
> _at_echo off
> REM Shutdown database
> set oracle_sid=<SID>
> set sqlfile=C:\whatever\sqlfile.sql
> echo connect sys/xxxx as sysdba > %sqlfile%
> echo shutdown immediate >> %sqlfile%
> echo exit >> %sqlfile%
> svrmgrl _at_%sqlfile%
> del /q %sqlfile%
>
> REM Stop service
> net stop OracleService<SID>

Thanks,
However, under windows 2000; how is it possible to plan this task (stop.bat) when the machine is shutting down ???

I looked at "Scheduled tasks", it seems it is not possible Received on Mon Jan 20 2003 - 09:59:12 CET

Original text of this message