Re: Remotely stopping an Oracle 10g instance on window 2000

  • From: Niall Litchfield <niall.litchfield@xxxxxxxxx>
  • To: kennaim@xxxxxxxxx
  • Date: Tue, 17 May 2005 10:18:17 +0100

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

--
//www.freelists.org/webpage/oracle-l

Other related posts: