Creating and Scheduling Jobs
To create a job, right-click the Jobs node in the Server Explorer and
select New. This will open the Job dialog box which is composed of the
following elements:
-
Job Name: the name you prefer to give to this
job. Teratrax Database Manager defaults this field to “Job1”.
-
Server: the server name where the job will be
created. This field contains the name of the current server in the Server
Explorer pane.
-
SQL Script: the SQL code you want to run when
this job is triggered. It’s always a good practice to select your database
context first thing in the code so subsequent statements don’t end up
executed against another database.
-
Schedule: determines when you want the job to
run. The following options can be selected:
-
When SQL Server Agent starts: job will be
triggered when SQL Server Agent starts or re-starts.
-
When server becomes idle: job will not be
triggered as long as SQL Server is busy.
-
Daily: job will be triggered every day at
the time specified in the “Run this job at” field.
-
Weekly (M T W Th F S Su): job will be
triggered once a week on the specified day at the time specified in the
“Run this job at” field.
-
Monthly (occurs on day -- of every month):
job will run once a month on the specified day at the time specified in
the “Run this job at” field.
-
Run this job at: the HH (hour on a 24-hour
clock) and MM (minute) fields in this box determine the time the job
should run. “Run this job at” is ignored for schedule options 1 and 2.
Once you have entered all necessary information for your job, click Ok to
create and schedule the job. After the job has been created, you can
manually trigger the job to run by right-clicking the job and selecting
Start Job.
Select the jobs node in the Server Explorer pane to view job information
listed in the Items pane. The columns in the list include “Last Run Status”,
“Last Run”, and “Next Run”. These columns can help you determine if your job
and schedule are working properly.
Creating Backup Job
Follow the following steps to create a scheduled backup job:
- Right-click the database name and select
"Backup".
- Enter a file name in the Backup File edit box.
- Click the "Schedule" button to open the Job
window.
- Set the time for the schedule.
- Click OK to create the schedule and go back to
the Backup Database window.
- At this point, the job has been created. Click
cancel to leave the Backup Database window or "Ok" to run a regular
backup.
After completion of these steps, you should see the job details in the
Items pane when you select "Jobs"
in the Server Explorer pane on the left hand side.
|