Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any V9 DB maintenance experts out there?

Status
Not open for further replies.

ajtmcse

IS-IT--Management
Apr 15, 2001
116
US
I'm trying to put together a script that will run once a week at remote sites to keep the DB in shape, can anyone recommend the correct order to run the DB utilities?

Here's what I've written so far:

@echo off
del c:\arcdb*.previous
rename c:\arcdb*.prev *.older
rename c:\arcdb*.txt *.previous

REM The following 3 lines will set the %DATE% and %TIME% variables to the current date/time
for /f "tokens=6-11 delims=/:. " %%a in ('net time \\%computername%') do ((set month=%%a) & (set day=%%b) & (set year=%%c) & (set hh=%%d) & (set min=%%e) & (set AMorPM=%%f) )
set TIME=%hh%:%min%%AMorPM%
set DATE=%month%/%day%/%year%
ECHO **
ECHO **Arcserve DB Check began at %TIME% on %DATE%. >> c:\arcdbmaint.txt
ECHO **Arcserve DB Check began at %TIME% on %DATE%. >> c:\arcdbstatus_%COMPUTERNAME%.txt

ECHO **

cd C:\Program Files\CA\BrightStor ARCserve Backup
REM DB Engine needs to be running for these utils to work.
call cstart.bat

REM STDIN piped to c:\arcdbmaint.txt
REM STDERR piped to c:\arcdbstatus_%COMPUTERNAME%.txt

Echo Running DBCHECK on ASJOB database
dbcheck -a -L casdb;admin;secret asjob 1>> c:\arcdbmaint.txt 2>> c:\arcdbstatus_%COMPUTERNAME%.txt
Echo Running DBCHECK on ASMEDIA database
dbcheck -a -L casdb;admin;secret asmedia 1>> c:\arcdbmaint.txt 2>> c:\arcdbstatus_%COMPUTERNAME%.txt
Echo Running DBCHECK on ASOBJECT database
dbcheck -a -L casdb;admin;secret asobject 1>> c:\arcdbmaint.txt 2>> c:\arcdbstatus_%COMPUTERNAME%.txt
Echo Running DBCHECK on ASRHOST database
dbcheck -a -L casdb;admin;secret asrhost 1>> c:\arcdbmaint.txt 2>> c:\arcdbstatus_%COMPUTERNAME%.txt
Echo Running DBCHECK on ASTAPE database
dbcheck -a -L casdb;admin;secret astape 1>> c:\arcdbmaint.txt 2>> c:\arcdbstatus_%COMPUTERNAME%.txt
Echo Running DBCHECK on ASTPDRV database
dbcheck -a -L casdb;admin;secret astpdrv 1>> c:\arcdbmaint.txt 2>> c:\arcdbstatus_%COMPUTERNAME%.txt
Echo Running DBCHECK on ASTPSDAT database
dbcheck -a -L casdb;admin;secret astpsdat 1>> c:\arcdbmaint.txt 2>> c:\arcdbstatus_%COMPUTERNAME%.txt

REM The following 3 lines will set the %DATE% and %TIME% variables to the current date/time
for /f "tokens=6-11 delims=/:. " %%a in ('net time \\%computername%') do ((set month=%%a) & (set day=%%b) & (set year=%%c) & (set hh=%%d) & (set min=%%e) & (set AMorPM=%%f) )
set TIME=%hh%:%min%%AMorPM%
set DATE=%month%/%day%/%year%
ECHO **
ECHO **Arcserve DB Check finished at %TIME% on %DATE%. >> c:\arcdbmaint.txt
ECHO **Arcserve DB Check finished at %TIME% on %DATE%. >> c:\arcdbstatus_%COMPUTERNAME%.txt

ECHO **

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top