Database Operations

Vector AM includes a utility, called DButil, that enables you to directly maintain, update and purge your Site database using SQL expressions. Use DButil to create customized Site maintenance operations that you want to run or schedule regularly. For example, the Delete Change History Data, Delete Job Logs, and Delete Metering Data operations are based on DButil. They enable you to delete change history, job log, and software metering data from your Site database.

Take care when using this tool. DButil can overwrite data, delete tables and compromise the integrity of your database. Always test new DButil operations on a copy of your database before using them with live data.

To create a database operation:

1    Right-click an operations view and choose New from the shortcut menu.

2    In the Add New Operation dialog, select Command Launch in the Type list and click OK.

3    In the Customize Command Launch dialog, enter an Operation name and Description, and select the tabs in which you want to display the operation.

4    Select the Command Launch tab and type DBUTIL.EXE in the Program field.

5    In the Command line field, type:

$DSNACCESS "PROMPT=UserMessage" /SQLUPDATE "SQL=SQLStatement”

where:

$DSNACCESS is a Vector AM token that specifies the DSN details of the Site database.

“PROMPT=UserMessage” specifies the text of the user prompt that is displayed before the operation is run. Omit this parameter, if you want this operation to run with no user intervention.

/SQLUPDATE "SQL=SQLStatement” specifies a SQL command, or the name of a command file that contains SQL commands.

For example, the Delete Change History operation in the Console uses DButil in conjunction with Vector AM tokens to delete change history data that is more than 60 days old from the current Site database:

$DSNACCESS "PROMPT=Delete Old Change History Data?" /SQLUPDATE "SQL=Delete * from NODEHISTORY Where ENTRYDATE < #$MM/DD/YY(-60)$#"

6    Choose Run once only and click OK to create the operation. You can now run the operation from the Console or submit it as a job.

Related Topics

Command Launch Operations