You can define an SQL job to run an SQL query against an Oracle, Microsoft SQL Server, or IBM DB2 database. When the job runs, the SQL statement is invoked and the results are stored in an output file or job spool file. You can also add criteria to the job definition to test the query result. If the result matches the criteria, the job completes. Otherwise, the job fails.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows and CA WA Agent for Databases.
Follow these steps:
The Application appears in the workspace.
The SQL icon appears on the Application workspace view.
The Basic page of the SQL dialog opens.
Defines the name of the job that you want to schedule.
Limits: 128 alphanumeric characters, plus the special characters commercial at (@), pound (#), dollar sign ($), underscore (_), square brackets ([]), brace brackets ({}), and percent sign (%) as a symbolic variable introducer character.
Specifies the name of the Database Agent that runs the job.
Note: The drop-down list displays all the agents that are defined in the Topology for the specified job type.
Specifies the SQL statement to be run.
Note: You can use a JavaScript symbolic variable in this field, preceded by the percent sign (%), for example, %TEST. In SQL, the percent sign represents a wildcard character. To use a wildcard character in this field, escape the percent sign by doubling it, for example, %%TEST.
Specifies the database user the job runs under. The database user specified in the job definition overrides the default specified in the agentparm.txt file. The user must be defined in the Topology. This field supports the use of a namespace for a user that has more than one password. Contact your administrator for the user name defined in the Topology.
Note: The drop-down list displays all the user IDs that are defined in the Topology for the specified agent. You must have at least Read access to the ADMIN.Network Topology permission to view this list.
Examples: Bob, Production:Bob
Specifies the type of Oracle user. In Oracle, a user with sufficient authority can log in with different system privileges. For example, if a job requires sysdba privileges, you would enter as sysdba in this field.
Specifies the database resource location. The server uses Java database connectivity (JDBC) to connect to the database. This URL overrides the default specified in the agentparm.txt file.
For an Oracle database, use the following format:
jdbc:oracle:thin:@host:port:dbname
For an Microsoft SQL Server database, use the following format:
jdbc:sqlserver://host:port;DatabaseName=dbname
For an IBM DB2 database, use the following format:
jdbc:db2://host:port/dbname
Defines the output file to store the results of the SQL query.
Default: Spool file
Defines a regular expression that is used to evaluate a return string. If the return string matches the regular expression, the job completes successfully. Otherwise, the job fails.
Notes:
The SQL job is defined.
Example: Run an SQL Query against an Oracle Database
Suppose that you want a job named SQL to run a query against an Oracle database and store the results in the job's spool file on the DBAGENT agent computer.
To run an SQL query against an Oracle database
|
Copyright © 2014 CA.
All rights reserved.
|
|