ADSM-L

Re: ADSM Question - Scheduling the ADSM Connect SQL Agent

1998-03-12 10:11:16
Subject: Re: ADSM Question - Scheduling the ADSM Connect SQL Agent
From: Chris Zaremba <zaremba AT US.IBM DOT COM>
Date: Thu, 12 Mar 1998 10:11:16 -0500
It is possible to use the ADSM central scheduler to schedule the SQL agent.
Try the following:

1. Define a schedule on the ADSM server using the "command" option to run a cmd
file and associate
     the SQL agent node to that schedule.  For example:

    def sched sqldomain sql_backup_daily desc="Daily SQL Backup" action=command
objects="c:\sqlback.cmd" ...
    def assoc sgldomain sql_backup_daily  sqlagent_node

2. Assuming you have a separate node name for the SQL agent (different from the
backup client for that system) ,
    install a second instance of the central scheduler service to handle
scheduled events for that node.  For example:

    dsmcutil inst  /name:"ADSM SQL Agent Scheduler" /node:sqlagent_node
/password:sqlagent_pwd /autostart:yes
                             /clientdir:d:\win32app\ibm\adsm\baclient
/optfile:d:\win32app\ibm\adsm\agentsql\dsm.opt

     Don't forget to start the service.

3. Define the sqlback.cmd file with the necessary SQL agent commands to do the
online backup of the SQL DBs.
     For example:

        rem===================================================================
rem sqlback.cmd
rem
rem Sample command file containing commands to backup SQL server
rem databases to ADSM.
rem
rem This file is meant to be executed by the ADSM central scheduler in
rem response to a centrally defined schedule on the ADSM server.
rem
rem The key to executing a command file using the ADSM scheduler is
rem that complete paths must be given for all filenames and non-system
rem commands. This is because the scheduler service runs from the
rem Windows NT system directory and that's where it will look for
rem input and produce its output by default.
rem===================================================================
set sql_dir= d:\win32app\ibm\adsm\agentsql
 cd %sql_dir%
date <NUL >> %sql_dir%\sqlback.log
time <NUL >> %sql_dir%\sqlback.log
%sql_dir%\sqldsmc /sqlstart
%sql_dir%\sqldsmc /adsmoptfile:%sql_dir%\dsm.opt /adsmpwd:sqlagent_pwd
/backupfull:master >> %sql_dir%\sqlback.log
%sql_dir%\sqldsmc /adsmoptfile:%sql_dir%\dsm.opt /adsmpwd:sqlagent_pwd
/backupfull:model >> %sql_dir%\sqlback.log
%sql_dir%\sqldsmc /adsmoptfile:%sql_dir%\dsm.opt /adsmpwd:sqlagent_pwd
/backupfull:msdb >> %sql_dir%\sqlback.log
%sql_dir%\sqldsmc /adsmoptfile:%sql_dir%\dsm.opt /adsmpwd:sqlagent_pwd
/backupfull:pubs >> %sql_dir%\sqlback.log

The first line of this sample file defines the directory where the SQL agent is
installed. The second line changes the current directory to be the directory
the SQL agent is installed in. The next two lines add a time stamp to the file.
The next line will start the SQL server if not already started.  The next four
lines perform the actual database backups.
Note that since /sqluser and /sqlpwd are not specified the default SQL account
will be used. If you prefer to use /sqlsecure (NT Unified logon) the SQL server
must be configured for integrated or mixed security and the ADSM scheduler
service must logon using an account with enough SQL privileges to backup the
desired databases. The scheduler service account information can be specified
using the services applet in the control panel.


Chris Zaremba
ADSM Development
<Prev in Thread] Current Thread [Next in Thread>
  • Re: ADSM Question - Scheduling the ADSM Connect SQL Agent, Chris Zaremba <=