Please enable JavaScript to view this site.

Executing the the Engine is often performed using shell scripts. Once the ENGINE has been parsed it can and usually is started using the sqdmon utility together with a local Daemon Controller.

Example

The same Engine in the previous example, DB2TOORA.sqd that will perform near real-time replication of "Sales" application data from a DB2 database captured on a z/OS system named "MVS21" to Oracle tables running on a UNIX system. The source "Host" system and DB2 System ID were passed as parameters because the engine script has been written so that it can be reparsed to process data coming from other systems as well.

#!/usr/bin/bash

cd ./home/test/sales/ENGINE

sqdata ./DB2TOORA.prc 2>&1 | tee DB2TOORA.rpt

cd ..

 

Execution of the same engine using SQDENG, might look like this:

#!/usr/bin/bash

cd ./home/test/sales/ENGINE

sqdeng --script=./DB2TOORA.sqd ENGINE=DB2TOORA HOST=MVS21 SSID=DB2T --list=DB2TOORA.prt 2>&1 | tee DB2TOORA.rpt

 

Notes:

1.In the example the working directory is one level up from the "ENGINE" directory containing the actual engine script. References in the script to the location of parts files like RDBMS DDL for table descriptions, called procedures, etc must be sensitive to their location in the directory hierarchy, ie: ./<directory_name>/<file_name>. In this case probably ./ORADDL (note the single dot).

2.See Command Line Execution for other Command line keywords and parameters.

 

Execute an engine script named DB2TOORA.sqd that will perform near real-time replication of "Sales" application data from a DB2 database captured on a z/OS system named "MVS21" to Oracle tables running on a UNIX system. The source "Host" system and DB2 System ID were passed as parameters because the engine script has been written so that it can be reparsed to process data coming from other systems as well.

sqdata ./engines/DB2TOORA.prc 2>&1 | tee DB2TOORA.rpt

 

Execution of the same engine using SQDENG, might look like this:

sqdeng --script=./ENGINE/DB2TOORA.sqd ENGINE=DB2TOORA HOST=MVS21 SSID=DB2T --list=DB2TOORA.prt > DB2TOORA.rpt

 

The Engine (SQDATA) uses the parsed Apply Engine script as input. The engine can be either executed directly at the command line, using a shell script or started using the sqdmon utility and the sqdaemon.

 

Syntax

SQDATA <engine>.prc > <engine>.rpt

 

or using the sqdmon start command along with a properly configured daemon:

SQDMON start ///<engine_alias> --service=2626

 

Example

A simple shell script is frequently used to execute the engine:

sqdata ./ENGINE/ORATOORA.prc > ORATOORA.rpt

 

or using the sqd>mon start command;

sqdmon start ///ORATOORA --service=2626

 

along with a properly configured sqdaemon:

[ORATOORA]

type=engine

program=sqdata

args=./ENGINE/ORATOORA.prc

working_directory=/home/sqdata/demo

stdout_file=/ORATOORA.rpt

stderr_file=/ORATOORA.rpt

auto_start=no

 

Note: In the Engine example the working directory, /home/sqdata/demo is one level up from the directory containing the actual engine script, "ENGINE". References to the parsed script must be to the location of parsed script.