Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Remotely stopping an Oracle 10g instance on window 2000
Ah ha
welcome to my rants :(
1, Why are you doing a cold backup? Any data that is worth backing up is worth protecting by archive log mode - very rare exceptions, and any db that is in archive log mode *should* be backed up hot - unless you like unnecessary downtime.
2, Windows admin is best done via vbscript and wmi, not via scripting commandline programs. Check out the scripting centre on the microsoft site for loads of examples.
In your case the code for stopping your service remotely would be (you'll see it can be extended to several services at once).
strComputer = "<servername>"
StopService "OracleServiceDW"
sub StopService(strServiceName)
strQuery = "Select * from Win32_Service where DisplayName like '" &
strServiceName & "' and status = 'Running'"
' get wbem object collection
Set objOraServices = GetObject("winmgmts:\\" &
strComputer).ExecQuery(strQuery)
' iterate through collection starting stopped services
For each objService in objOraServices
intStart = objService.StopService()
next
end sub
Grant has pointed you at the dependency problem you have right now. As you are talking about 10g I'll lay a pound to a penny that you are depending on the dbconsole service (OEM) and that in fact starting and stopping that will cloase and stop the database anyway. Alternatively you could actually use EM and see if that is capable of successfully scheduling starts and stops of the database (I wouldn't count on it though).
-- Niall Litchfield Oracle DBA http://www.niall.litchfield.dial.pipex.com -- http://www.freelists.org/webpage/oracle-lReceived on Tue May 17 2005 - 05:22:54 CDT
![]() |
![]() |