Question
-
Topic
-
Automating SQLServer2000 DB maintenance in single user mode
LockedWe have a job that does the ‘standard DB maintenance’ ie “EXECUTE master.dbo.xp_sqlmaint N’-PlanID E4AB00A1-28E3-4A08-947F-61E6DD75D4B9 -To “Owen Evans” -Rpt “d:\data\MSSQL\LOG\DB Maintenance Plan12.txt” -WriteHistory -CkDBRepair ‘” from within normal Enterprise Manager.
However, I’m getting a message saying I need to do this in single user mode.
Not a problem to do manually! However, I want to modify the Maintenance Job to automate.
for example:
Step1…stop Sqlsrvr
Step2…start Sqlsrvr -m
Step3…start the maintenance job <??? Step4...stop Sqlsrvr Step5...start Sqlsrvr Any examples or advice greatly appreciated.