Monday, March 12, 2012

heres a challenge for you all.

Ok, here's the problem. I have CA's Unicenter ServiceIT Enterprise Edition 5.0 running on a production box that has NT4 (SP6) and SQL server 2000 running on it.

Just before we continue, this is about backing up the database that ServiceIT connects to.

I know that you can schedule EM to make backup's of a specific database over a certain time, but this is part of the problem. What i have since discovered is that ServiceIT will not run on a database backed up and restored by EM.

It will however run on the restored backup created through the dos command pdm_backup (comes with ServiceIT).

What i am trying to figure out is to try a find a way that i can run a dos prompt command to do the following tasks at a specific time of day:

Stop the Paradigm Server Daemons (service)
Run a DBCC CHECKDB on the database AHDTEST50.
If there are no errors, create a verbose backup using the dos command pdm_backup -v -fC:\backup\[todaysdate]
If there are errors run a script to correct them, then run a backup
Restart the Paradigm Server DaemonsSchedule a batch file?|||can you set a batch file to do all of the above though?|||Only generating filenames with today's date (yyyymmdd) is usually a pain in batch (regional settings stuff like that) so I have a tendency to use a parameter instead. Next, I don't know how to check for errors the verbose backup might give; is there a log-file, would it suffice to do a find on it? I should think there's a way to cover that, so, other than that: I'd give it a go.|||Could you use something like:CREATE PROCEDURE Backup_ServiceIT
AS

DECLARE @.cBackup VARCHAR(500)
SET @.cBackup = pdm_backup -v -fC:\backup\' + Convert(CHAR(8), GetDate(), 112)

EXECUTE @.rc = master.dbo.xp_cmdshell 'NET STOP <paradigm service name>'
if 0 = @.rc DBCC CHECKDB ('AHDTEST50')
if 0 = @.@.error EXECUTE @.rc = master.dbo.xp_cmdshell @.cBackup
if 0 <> @.rc EXECUTE @.rc = master.dbo.xp_cmdshell '<fix error batch file>'
EXECUTE @.rc = master.dbo.xp_cmdshell 'NET START <paradigm service name>'

RETURN
GO-PatP|||Hey...when did you add your location?

http://www.ifb.net/webit/inveruri.htm

No comments:

Post a Comment