Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628

    Unanswered: here's 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 Daemons

  2. #2
    Join Date
    Feb 2004
    Posts
    492
    Schedule a batch file?

  3. #3
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    can you set a batch file to do all of the above though?

  4. #4
    Join Date
    Feb 2004
    Posts
    492
    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.

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Could you use something like:
    Code:
    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

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Hey...when did you add your location?

    http://www.ifb.net/webit/inveruri.htm
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •