Learn more about Toad for SQL Server
at Dell Software

Find solutions and downloads at the
Toad for SQL Server Support Portal

Toad for SQL Server 6.6

You are here: Automate Tasks > Troubleshoot Scheduled Automation Scripts

Troubleshooting Scheduled Automation Scripts

Summary

If your Automation script doesn’t run when scheduled, use the following troubleshooting tips to identify and correct any problems. Learn how to troubleshoot script scheduling and execution issues.

In this topic you will learn:

Introduction

Toad allows you to schedule an Automation script. Scripts are scheduled and managed from the Job Manager. You can automatically send your script file name and other information to the Job Manager by clicking in the Automation toolbar .

When you schedule an Automation script in Toad, a Windows scheduled task is created. You can also manage an Automation script as a scheduled task from the Windows Task Scheduler.

Running Automation Scripts on a Server

If you run Toad for Data Analysts on a server and run scheduled Automation scripts, you must log-in and create connections once.

  1. Log-in under the account used to schedule the scripts.
  2. Launch Toad for Data Analysts.
  3. Start each connection (used in the scripts) one time.

General Troubleshooting Tips

Disable Prompts

The instance of Toad used to run a scheduled script must be able to launch unattended. Disable any prompts that display on initial launch of Toad and also require user interaction to close.

Troubleshoot Using Error Email

If your script runs, but there is an error during execution, you can instruct your script to send you an email notification. It is a good idea to configure this option for all your scripts.

  1. To instruct a script to send an email on error, open the script and click the Settings icon in the design window.
  2. Select the Send email when an error occurs option in the Activity Input tab.

Troubleshoot Scripts Using the Job Manager

To begin troubleshooting your script, open the Job Manager and review the script properties.

Open Job Manager

  1. Select Tools | Administer | Job Manager.
  2. In the Job Manager window, in the Windows Tasks tab, select the checkbox for the appropriate server/computer. Then locate your task in the Task List tab.
  3. Review the Last Result column.

View Task Properties

Ensure Task Runs When Logged Off

Ensure Task Runs on Weekends

If you scheduled a script to run daily, and you find that the script is not running on the weekends, try this workaround.

  1. In the task properties dialog, select the Schedule tab.
  2. In the Schedule Task drop-down list, select Weekly.
  3. In the weeks on field, select each and every day of the week. This ensures that the task runs each day of the week, including Saturday and Sunday.

Instruct Windows to Wake to Run Script

Use this tip to wake the computer from a power-saving mode to run your scheduled task.

  1. In the task properties dialog, select the Settings tab.
  2. Under Power Management, select the Wake the computer to run this task option.

Update Windows Password

Depending on your version of Windows, if you changed your Windows password, you may also need to update the password in each of your scheduled tasks.

  1. In the task properties dialog, in the Task tab, click Set password.
  2. Enter you new password.

Troubleshoot Scripts Using the Windows Task Scheduler

If the preceding tips did not correct the issue and your script still does not run when scheduled, you can use the Windows Task Scheduler to check for other task-related issues.

Open Windows Task Scheduler

  1. To open the Windows Task Scheduler, from the programs menu (Start | All Programs) select Accessories | System Tools | Task Scheduler.
  2. In the Task Scheduler window, select the Task Scheduler Library node in the left pane to display the list of scheduled tasks in the top-right pane.
  3. Select a task in the list to display task details in the bottom-right pane (or double-click the task to open the task Properties dialog).

Tip: Click Refresh in the Actions pane to refresh the window after adding or deleting scheduled tasks using Toad.

Review Error Codes

Confirm Toad Application and Script File Locations for a Task

Confirm that the path to the Toad executable and the path to the script file are correct.

  1. In the Task Scheduler window, double-click the task to open the task Properties dialog.
  2. Select the Actions tab.
  3. Double-click the Start a program action to open the Edit Action dialog.
  4. In the Program/script field, make sure that the path to the Toad executable is correct, and that the path points to the correct version of Toad.
  5. In the Add arguments field, make sure that the script path and script file name are correct.

Configure Task Scheduler to Send Email on Error

In some versions of Windows, you can configure the Task Scheduler to send an email if your scheduled task doesn't run.

Note: This allows you to receive email notification if the task doesn't run as scheduled. To receive email notification of an error during script execution, specify this option within your Automation script. See Troubleshoot Using Error Email for more information.

  1. To set up an email trigger, in the Task Scheduler window, double-click the task to open the task Properties dialog.
  2. On the General tab, in the Configure for field, select Windows 7.
  3. Select the Triggers tab and click New to add a new trigger.
  4. In the Begin the task field, select On an event from the drop-down list.
  5. In the Log field, select Microsoft-Windows-TaskScheduler/Operational.
  6. In the Source field, enter TaskScheduler as the source of the trigger.
  7. In the EventID field, enter 203 which specifies the type of event as an error. Click OK.
  8. Now, select the Actions tab and click New to add a new action.
  9. In the Action field, select Send an e-mail from the drop-down list, and then configure the email settings.

Troubleshoot Using Automation Script Logs

If your script runs, but there is an issue during execution, you can review the script log to help identify the issue.

  1. To view script logs, in Toad select Help | About and click the Application Data Directory link in the About box to open the directory.

  2. Open the Automation folder and select the log file for your script. Review the log and identify at which step the error occurred.
  3. If you need more details in the log, you can specify this in the settings of your Automation script.
    1. Open your Automation script in Toad.
    2. Click the Settings icon in the Automation design window.
    3. In the Activity Input tab, in the Logging level field, select Verbose. This instructs Toad to create a more detailed log.

    Note: If you use the Verbose option, Toad generates an additional log file just for email errors. The name of this log file is MailBee_<number>.txt and it can provide you with information about your email errors.

  

Related Topics

of