Troubleshooting Scheduled Automation Scripts in Toad Data Point

 Automation simplifies life – until that script fails to run. All these processes are stuck in the “log jam”, with the problem waiting to be determined and cleared. In this blog, the following tips and procedures will assist one in troubleshooting Automation Script problems when a script does not run when scheduled.

 In this blog installment, the following troubleshooting techniques are covered:

  • How can one troubleshoot, identify and localize to and correct any problems?
  • How can one learn how to troubleshoot script scheduling and execution issues?
  • How can one use the Job Manager to troubleshoot issues with scheduled Automation scripts?
  • How can one use the Windows Task Scheduler to troubleshoot scheduled Automation script issues?
  • How can one use Automation script logs and error emails to troubleshoot script execution issues?

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

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.

 

AUTOMATION TROUBLESHOOTING CHECKLIST

Watch a video, Troubleshooting scheduled Automation scripts in Toad Data Point, which highlights these checklist points.

Running Automation Scripts on a Server

If you run Toad Data Point 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 Data Point.
  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 the 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 the 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

Note: This method does not apply to scripts running in Toad Intelligence Central. See Manage Automation Scripts in Intelligence Central for more information.

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.

  • A green checkmark in this column indicates the task ran without issue.
  • A square icon in this column indicates that there was an issue with the scheduled task.

View Task Properties

  • Double-click the task in the Task List tab to open the task properties dialog. You can use this dialog to review or configure task settings and to modify the task schedule.

Ensure Task Runs When Logged Off

In the task properties dialog, in the Task tab, deselect the Run only if logged on option. This ensures that Toad will run even if you are 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 your new password.

Troubleshoot Scripts Using the Windows Task Scheduler

Note: This method does not apply to scripts running in Toad Intelligence Central. See Manage Automation Scripts in Intelligence Central for more information.

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

  • If your script errors, Toad returns an error code, which displays in the Last Run Result column in the Task Scheduler window.

Review the following error codes for more information.

Error Code

   Description

0x0

   The script executed successfully.

0x3E7

   There was an error during script execution and the       script terminated.

   Decimal equivalent: 999.

0x6F

   There was an error during script execution and the script continued to run.

   Tip: If the script continued on an error, one of the following settings is specified in the script:

   o The Continue On Error option is selected for the script.

   o The Stop on error option is deselected for an activity.

   Decimal equivalent: 111

0x22B

   The Trial license key for this instance of Toad expired. Enter a Commercial license key.

   Decimal equivalent: 555

other

   Error codes other than those described above, indicate that the script did not start. For example, if    the path to Toad is incorrect in the scheduled task, then the script will not start.

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 an 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 the 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 theSource 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 on the Application Data Directory link in the About box to open the directory.

Note: For scripts running in Intelligence Central, open the Script Manager. See Manage Automation Scripts in Intelligence Central.

  1. Open the Automation folder and select the log file for your script. Review the log and identify at which step the error occurred.
  2. If you need more details in the log, you can specify this in the settings of your Automation script.
  3. Open your Automation script in Toad.
  4. Click the Settings icon in the Automation design window.
  5. 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_.txt and it can provide you with information about your email errors.

  

Further valuable Toad Data Point resources are available at Toad World.

Anonymous