Académique Documents
Professionnel Documents
Culture Documents
Process Highlights
Run any executable file including Ab Initio deployed scripts Restart without touching/deleting flags manually Run processes from different servers without impacting interprocess communication Check/Set Object status on Oracle Update ASLAM on Teradata and Oracle Collect Statistics and prepare tie-out Archive log files Archive data files Communicate completion/failure/time-out thru email to different mailing lists and pager
Process Architecture
Main Process - submitted thru crontab Sub-processes - submitted by Main Process Executable files - submitted by Sub-process
Send Mail
Collect Statistics
3
Main Process
Submitted thru crontab Sets environment for the entire process Validates existence/executability of sub-process files Submits one or more Sub-Processes Waits for Sub-Process completion Updates ASLAM on Teradata Archives Log Files Archives Data Files
Sub-Process
All sub-processes submitted simultaneously and not sequentially Has capability to wait for a variety of dependencies, including other Sub-Processes Can perform various functions depending on RUN_TYPE definition
Can perform any of the functions as determined by RUN_TYPE P F O OA : Process (submit any executable file such as Ab Initio deployed script) : Set Flag on local and remote directory location : Set Object Status on Oracle : Set ASLAM on Oracle
Can wait for one or more or all of the dependencies D F O S : Data file : Flag set by another process : Object Status on Oracle : Another Sub-process
Common Files Sourced by every process Ease of code maintenance Extend new features to all processes Developers can not alter code maintains integrity
Main process file Sub-Process file(s) Ab Initio deployed scripts List files Mail files Pager file
10
Used for checking/setting flags in inter-process communication Useful for fail-over protection and inter-process communication e.g.
export US_FIN_ITEM_ROLLUP_HOST=harp
11
Copy /usr/local/abinitio/template/template_main.ksh to bin/ directory ($AI_BIN) Rename as desired Make sure its executable Modify just one line of the file (directory path)
. $HOME/<directory path>/ab_project_setup.ksh $HOME/<directory path>
Sources /usr/local/abinitio/common/ddw_main_process.ksh
13
Copy /usr/local/abinitio/template/template_sub.run to run/ directory ($AI_RUN) Rename as desired Make sure its executable Define RUN_TYPE and related parameters Sources /usr/local/abinitio/common/ddw_sub_process.ksh
14
RUN_TYPE=P Runs a process by submitting an executable file such as Ab Initio deployed graph Parameter required is
RUN_JOB: executable shell script that needs to be processed
15
Two run files required one for START and another for FINISH
DDW Apollo - Process Automation Using Wrapper Scripts 16
RUN_TYPE=F Sets flags on local and target directories Parameters required are
FLAG_NAME: flag name REMOTE_HOST: host server name of downstream process as in hosts.env REMOTE_USER: useid for logging to REMOTE_HOST REMOTE_DIR: directory on REMOTE_HOST for setting the flag
17
OA_FINISH_PROCESS_NAME is required only when OA_ACTION is START Two run files required one for START and another for FINISH
DDW Apollo - Process Automation Using Wrapper Scripts 18
Used by Main Process or Sub-processes Located in env/ directory ($AI_ENV) Can be any of the following types
Job List Dependency List Stats List Archive List
19
run
Lists the sub-processes to be submitted by Main Process SUB_JOB_LIST parameter defines the file name ON/OFF flag determines which process to run Order in the job list file does not indicate order of their
Main Process reads this file several times - hence a copy of this file is stored in $AI_ENV/.ENV and accessed to preserve integrity from changes to the file till process completion e.g. entries
ON extract_svc_tags.run
DDW Apollo - Process Automation Using Wrapper Scripts 20
Lists the dependencies for which a sub-processes may wait SUB_DEPEND_LIST parameter defines the file name Four types of dependencies
D: F: O: S: Data File Flag set by another process Object Status Another Sub-process
Main Process reads this file several times - hence a copy of this file is stored in $AI_ENV/.ENV and accessed to preserve integrity from changes to the file till process completion
22
Dependency Type = D
e.g. build_svc_tags.run D sthsflat.sql DEFAULT (where DEFAULT = $COLL_HOME/load_seq_num)
23
Dependency Type = F Waits for a flag set by another process Format for entry
<subprocess> F <depedended flag> <directory location> <remote server> <remote userid> e.g. build_svc_tags.run F customer_can_${LOAD_SEQ_NUM}.1_moved.flg $CUST_MOVED_DIR $CAN_FIN_CUST_LOAD_HOST can_svc
Dependency Type = O Waits for Object Status on Oracle Format for entry
<subprocess> O <object_name> <subject name> <region> e.g. copy_girp_oh_od_all_us.run O PROD_ORDER_DETAIL FINANCE AMER
25
Dependency Type = S Waits for another Sub-Process submitted by the same Main Process Format for entry
<sub-process> S <depedended file> e.g. build_svc_tags.run S extract_svc_tags.run
26
27
AF : Anomaly File downloaded from source AT : Anomaly Table on Teradata along with database name, with optional where condition BT : Base Table on Teradata along with database name, with optional where condition DF : Records discarded with D flag - file created by Ab Initio graph DR : Delete Resent - file created by Ab Initio graph EF : Extract File IF : Incremental file IT : Incremental Table on Teradata along with database name, with optional where condition MB : Datamart base table on Oracle, with optional where condition MI : Oracle Incremental Datamart table, with optional where condition MT : Teradata Incremental Datamart table/view, with optional where condition OE : Extract from Oracle Tables, with optional where condition
Custom source types can be added to the list after modifying collect_stats.ksh accordingly
DDW Apollo - Process Automation Using Wrapper Scripts 29
Both multi-file and single-file systems are handled DML file required in definition for multi-file system, not for singlefile systems
30
When no where condition is defined, whole table count is returned Sources /usr/local/abinitio/common/get_td_cnt.ksh Requires $TD_LOGON parameter defined that points to a dbc file to login to Teradata
31
When no where condition is defined, whole table count is returned Sources /usr/local/abinitio/common/get_ora_cnt.ksh Gets oracle password using getpasswd function using oracle schema and oracle sid defined in this file
DDW Apollo - Process Automation Using Wrapper Scripts 32
33
34
Add additional email addresses delimited by a comma Subject file contains text that forms the subject part of a mail
e.g. Format for entry ERROR - <region> <process name> <task> Aborted
Body text file contains text that forms the body of a mail
35
36
ASLAM on Teradata
tables Each process has a Process_id and makes an entry to ASLAM Each Process works on one or more Objects and ASLAM tables maintain the relation between a Process and the Objects A Process can end with any of the four statuses
S E T U : Successful : Errored : Timed-out : Unknown
37
Log Files - 1
Four levels of log files are created in $AI_LOG
Generated by Main Process Generated by Sub-Process Generated by the executable submitted by a Sub-Process Log files defined inside an Ab Intio graph
Main Process log file defined as parameter LOG_FILE and each time Main Process is submitted, a separate log file is created
e.g. Definition: <identifier>_`date +%b%d_%Y:%H:%M:%S`.log Actual: build_corp_lookup_May24_2002:16:03:01.log
38
Log Files - 2
Sub-Process log file is created by suffixing date (MMMDD_YYYY:HH:MI:SS) to the run file and each time SubProcess is submitted, a new log file is created.
e.g. generate_dml_May22_2002:21:03:02.log
The log file generated by the executable submitted by the SubProcess (such as Ab Initio deployed script) takes its name from the script name appended with YYYYMMMDD and the extension is out instead of log. Each time the process is submitted, output is appended to this file (i.e. only one file per day)
e.g. collect_stats_lookup_download_2002May24.out
DDW Apollo - Process Automation Using Wrapper Scripts 39
Log Files - 3
Log files defined inside the Ab Initio graphs have constant names and are always replaced when the graph is re-run. Main
Log files older than certain number of days (LOG_FILE_KEEP_DAYS ) are archived and compressed by the Process and copied to $AI_LOGS/archive directory. Archived log files older than certain number of days (LOG_ARCH_KEEP_DAYS) are removed by the Main process.
40
Automating a Process - 1
1. 2. 3. 4. 5. Create the directory structure Setup Project environment Create Main Process File
(copy /usr/local/abinitio/template/template_main.ksh to $AI_BIN and modify)
41
Automating a Process - 2
1. 2. 3. 4. 5. Define Dependency list file
(refer to /usr/local/abinitio/template/template_dependency.lst for sample)
Automating a Process - 3
1. Define Pager file
(Copy /usr/local/abinitio/template/page_oncall to $AI_PAGING and modify as required)
2.
Copy /usr/loca/abinitio/template/collect_stats.ksh to $AI_RUN customize if custom source types are defined or tie-out calculation needs to be modified Define wrapper related Parameters in the project setup and make sure they are exported Setup ASLAM metadata
3. 4.
43
PAGE_SUB_DEPENDENCY (Y/N) Whether the sub-process to page waiting for another sub-process
44
45
46
47
48
49
50
Important Considerations
Main Process time-out does not kill any sub-process it has submitted they are still running so just restart the Main Process Sub-Process time-out indicates it has timed-out even before finished its job Sub-Process never times-out waiting for the process it has submitted (such as an Ab Initio deployed script) Failure of one Sub-Process in no way influences the outcome of another Sub-Process (except it may time-out if it has a dependency) Deleting running flags before restart can lead to concurrent sessions of the Sub-Process whose outcome may be unpredictable
51
52
Easy as Dell.
53