Table of Contents Previous Next PDF


Using Tuxedo Job Enqueueing Service (TuxJES)

Using Tuxedo Job Enqueueing Service (TuxJES)
This chapter contains the following topics:
Overview
The batch job system is an important mainframe business application model. The Tuxedo Job Enqueueing Service (TuxJES), emulation application provides smooth mainframe application migration to open systems. TuxJES implements a subset of the mainframe JES2 functions (for example, submit a job, display a job, hold a job, release a job, and cancel a job).
TuxJES addresses the following batch job phases:
Requirements
TuxJES is an Oracle Tuxedo application; Oracle Tuxedo is required in order to run TuxJES.
A shared file system (for example, NFS), is required in order to deploy TuxJES in distributed environment.
TuxJES Components
TuxJES includes the following key components:
Generates the security profile for Oracle Tuxedo applications
Generates the encrypted job access authorization configuration file for TuxJES system
TuxJES command interface. It is an Oracle Tuxedo client
TuxJES administration server. It is an Oracle Tuxedo server.
TuxJES conversion server. It is an Oracle Tuxedo server.
TuxJES Job Initiator. It is an Oracle Tuxedo server.
TuxJES purge server. It is an Oracle Tuxedo server.
For more information, see the Oracle Tuxedo Application Runtime for Batch Reference Guide.
Configuring a TuxJES System
Setting up TuxJES as an Oracle Tuxedo Application (Using /Q)
TuxJES is an Oracle Tuxedo application. Most of the TuxJES components are Oracle Tuxedo client or Oracle Tuxedo servers. You must first configure TuxJES as an Oracle Tuxedo application. The environment variable JESDIR must be configured correctly which points to the directory where TuxJES installed.
Oracle Tuxedo Configuration File
Listing 1 shows an Oracle Tuxedo configuration file (UBBCONFIG) example segment for a TuxJES system.
Listing 1 Oracle Tuxedo UBBCONFIG File Example for the TuxJES System
*GROUPS
QG
LMID=L1 GRPNO=2 TMSNAME=TMS_QM TMSCOUNT=2
OPENINFO="TUXEDO/QM:/jes2queue/QUE:JES2QSPACE"
ARTG
LMID=L1 GRPNO=4
EVTG
LMID=L1 GRPNO=8
*SERVERS
DEFAULT:
CLOPT="-A"
TMQUEUE
SRVGRP = QG SRVID = 1
RESTART = Y CONV = N MAXGEN=10
CLOPT = "-s JES2QSPACE:TMQUEUE -- -t 5 "
ARTJESADM SRVGRP =ARTG SRVID = 1 MIN=1 MAX=1
CLOPT = "-A -- -i jesconfig"
ARTJESCONV SRVGRP =ARTG SRVID = 20 MIN=1 MAX=1
CLOPT = "-A --"
ARTJESINITIATOR SRVGRP =ARTG SRVID = 30
CLOPT = "-A -- -c ABCDEFG
ARTJESPURGE SRVGRP =ARTG SRVID = 100
CLOPT = "-A --"
 
The following TuxJES servers should be included in the Oracle Tuxedo configuration file (UBBCONFIG):
Note:
Multiple instances of ARTJESADM, ARTJESCNOV, ARTJESINITIATOR and ARTJESPURGE can be configured.
For the TuxJES administration server ARTJESADM, a TuxJES configuration file should be specified using the -i option. In the Oracle Tuxedo configuration file (UBBCONFIG), ARTJESADM should be configured in front of ARTJESCONV, ARTJESINITIATOR, or ARTJESPURGE servers.
For more information, see the Oracle Tuxedo Application Runtime for Batch Reference Guide.
TuxJES uses the Oracle Tuxedo /Q component, therefore an Oracle Tuxedo group with an Oracle Tuxedo messaging server TMQUEUE with TMS_QM configured is required in the UBBCONFIG file. The name of the /Q queue space should be configured as JES2QSPACE.
A TuxJES system can be either an Oracle Tuxedo SHM application which runs on a single machine, or an Oracle Tuxedo MP application which runs on multiple machines.
For more information on how to set up Oracle Tuxedo application, see Oracle Tuxedo related documentation.
Block Time in UBBCONFIG for TuxJES
For job operations (except for job submission), you can specify the number of timeout periods for blocking messages and other system activities by setting the SCANUNIT and BLOCKTIME parameter. The value you assign must be a positive multiple of 5.
 
Controls the granularity of checking intervals and timeouts. SCANUNIT must be a multiple of 5 and between 0 and 60 seconds.
Example: SCANUNIT 20
BLOCKTIME controls how much time can a message block before it times out.
SCANUNIT * BLOCKTIME must not exceed 32767.
The default time of SCANUNIT * BLOCKTIME is approximately 60 seconds.
Listing 2 Example Settings
*RESOURCES
IPCKEY 113333
DOMAINID jesdomain
MASTER SITE1
MODEL SHM
MAXACCESSERS 200
MAXSERVERS 50
NOTIFY SIGNAL
SCANUNIT 20
BLOCKTIME 50
 
In this example, sanity scans are performed in every 20 seconds and request block for no more than 20 * 50 = 1000 seconds.
For job submission, timeout is not controlled by BLOCKTIME and SCANUNIT, it is specified in the artjesadmin command line, for example:
artjesadmin -t 60 -i JOBA
In this example, if submission of JOBA cannot be finished in 60 seconds, timeout will be returned.
TuxJES relies on /Q to store or retrieve messages which represent jobs. The timeout mechanism for /Q operations inside TuxJES is only controlled by MAXTRANTIME in UBBCONFIG RESOURCES section.
You should explicitly specify the MAXTRANTIME in UBBCONFIG; otherwise, Tuxedo automatically uses the default value (this value may vary depending on Tuxedo release).
Set this MAXTRANTIME value based on the specific system loading. The following example sets MAXTRANTIME to 5 minutes.
Listing 3 Example: Use MAXTRANTIME to Control Timeout
*RESOURCES
IPCKEY 133770
DOMAINID jessample
MASTER SITE1
MODEL SHM
MAXTRANTIME 300 # 300 seconds
 
For more information about MAXTRANTIME in UBBCONFIG RESOURCES section, see UBBCONFIG(5) in Tuxedo documentation.
If any timeout occurs on /Q operation, like tpdequeue() or tpenqueue(), you can adjust MAXTRANTIME to accommodate it.
Oracle Tuxedo /Q Queue Space and Queue Creation
A /Q queue space with name JES2QSPACE must be created for a TuxJES system (some /Q queues should be created within this queue space). TuxJES provides a sample shell script (jesqinit) to create the queue space (JES2QSPACE) and the queues. For more information, see the Oracle Tuxedo Application Runtime Batch Reference Guide.
File System Configuration
TuxJES uses a file system to communicate with Batch Execution Engine. A directory is created on the file system for the communication between TuxJES and Batch Execution Engine. The name of the directory should be specified in the TuxJES configuration file. This directory should reside at a shared file system (for example, NFS), if you want to deploy the TuxJES system on multiple machines.
TuxJES Configuration File
A configuration file can be specified for the TuxJES administration server ARTJESADM. The following parameters can be configured in the configuration file:
JESROOT
The root directory to store job information. It is a mandatory attribute. If this directory does not exist, ARTJESADM creates it automatically.
DEFAULTJOBCLASS
The default job class if the job class is not set in JCL. It is an optional attribute. The default job class is A if this attribute is not set.
DEFAULTJOBPRIORITY
The default job priority if the job priority is not set in JCL. It is an optional attribute. The default job priority is 0 if this attribute is not set.
DUPL_JOB=NODELAY
If it is not set, only one job can be in execution status for a job name. NODELAY will remove the dependency check. The default value is delay execution.
NJESUPPORT=ON
If it is not set, NJE support will be disabled and thus jobs cannot be run on the specified server group by Batch Runtime API m_JobSetExecLocation. The default value is OFF.
EVENTPOST=S,C,E,P,L,A
Specifies whether events are posted for a job at particular stages.
S: Job submission event.
C: Job conversion complete event.
E: Job execution complete event.
P: Job purge event.
L: Job cancel completed event.
A: all supported events
If EVENTPOST is not specified, no events are posted. The data buffer with event post is FML32 type and the fields are defined in tuxjes/include/jesflds.h.
JES_ACL_FILE
The full path of job access authorization configuration file. This file can be plain or encrypted, see JES_ACL_FILE_TYPE for more information.
JES_ACL_FILE_TYPE
The format of JES_ACL_FILE file. It can be set as PLAIN or ENCRYPTED (case insensitive). The default value is PLAIN.
JES_ACL_MODE
The action when no matching rule is found for the tuple of user, operation, and job in JES_ACL_FILE. It can be set as MAC (Mandatory Access Control) or DAC (Discretionary Access Control). The default value is MAC.
JOBREPOSITORY
The path of the job repository where jobs are stored. The script file path inputted in job submitting may be a relative path in JOBREPOSITORY if it is set.
You can specify multiple path names, delimit them with a colon (:). For example,
JOBREPOSITORY=<path1>:<path2>:<path3>
To find job to submit, Batch Runtime searches from these paths in the order that you specify (in JOBREPOSITORY). When finding a job name match, Batch Runtime stops searching, and submits this matched job.
PRIVILEGE_MODE
Specifies whether and how to enable the user substitution (See TuxJES User Substitution). The values are:
NONE: Default value. Indicates jobs are executed by the OS user who starts JES system. This is compatible with all previous implementations on JES system.
USER_IDENTICAL: Indicates jobs are executed by the Oracle Tuxedo user with which JES client joins JES system. Make sure that each Oracle Tuxedo user corresponds to an existing OS user before you choose this value.
USER_MAPPING: When this value is specified, the JES system looks up the TuxJES user mapping file and finds out the OS user corresponding to the Oracle Tuxedo user with which JES client joins JES system, and then appoints this OS user as the job executor.
USER_MAPPING_FILE
The full path where TuxJES user mapping file is stored. It is used along with PRIVILEGE_MODE when its value is USER_MAPPING.
SYSLOG=OFF,ON,DAILY,WEEKLY,MONTHLY
OFF: Specifies no logs.
ON: Specifies writing to SYSLOG. Default value. The SYSLOG is entitled "jessys.log". You can change its path from the default "$JESROOT/jessys.log" to other directories by using SYSLOG_PATH.
DAILY: Specifies writing to SYSLOG. A new log file is created daily. The SYSLOG is entitled "jessys.log.<mmddyy>". For example, the SYSLOG entitled "jessys.log.032715" stands for the log file created for the day of March 27, 2015. You can change its path from the default "$JESROOT/jessyslog/jessys.log.<mmddyy>" to other directories by using SYSLOG_PATH.
WEEKLY: Specifies writing to SYSLOG. A new log file is created weekly. The SYSLOG is entitled "jessys.log.<mmddyy>", where the "dd" means the first day of current week (Sunday is the first day of the week). For example, the SYSLOG entitled "jessys.log.032215" stands for the log file created for the week from March 22, 2015 (Sunday) to March 28, 2015 (Saturday). You can change its path from the default "$JESROOT/jessyslog/jessys.log.<mmddyy>" to other directories by using SYSLOG_PATH.
MONTHLY: Specifies writing to SYSLOG. A new log file is created monthly. The SYSLOG is entitled "jessys.log.<mmddyy>", where the "dd" means the first day of current month. For example, the SYSLOG entitled "jessys.log.030115" stands for the log file created for the month of March 2015. You can change its path from the default "$JESROOT/jessyslog/jessys.log.<mmddyy>" to other directories by using SYSLOG_PATH.
SYSLOG_PATH
Specifies the path of SYSLOG files.
When SYSLOG=ON is set, you get the SYSLOG entitled "$SYSLOG_PATH/jessys.log" and located in the directory where you specify through this SYSLOG_PATH.
When SYSLOG=DAILY,WEEKLY,MONTHLY is set, you get the SYSLOG entitled "$SYSLOG_PATH/jessys.log.<mmddyy>" and located in the directory where you specify through this SYSLOG_PATH. The "jessys.log.<mmddyy>" confirms to the naming rules for SYSLOG=DAILY,WEEKLY,MONTHLY.
If you do not specify SYSLOG_PATH, the SYSLOG files are still located in $JESROOT/jessyslog (when SYSLOG is set to DAILY, WEEKLY, or MONTHLY) or $JESROOT (when SYSLOG is set to ON) by default.
QSPACE_THRESHOLD
Percentage: 1 ~ 99. This is a threshold value for queue space usage rate, while the usage of queue space reach this threshold, new job can be submitted but warning message will be shown in the output of artjesadmin. And auto purge will be performed if it isenabled. The default is 80.
AUTOPURGE
Integer number: 0 ~ 32767 (2^15-1).
0: Disable the automatic purging. Default value.
N(>=1): Enable the automatic purging and purge the first finished N Jobs one time.
If N>=(size of OUTPUT queue), all the jobs in OUTPUT queue are purged.
AUTOPURGE_KEEPFILES
ON: Backup folder <JESROOT>/<JOB_ID> to <JESROOT>/<JOB_ID>.bak while automatic purging, just delete the relevant message from "OUTPUT" queue.
If AUTOPURGE=0, this item is ignored. Default value.
OFF: Delete all the files belong to the job (in folder <JESROOT>/<JOB_ID>) while automatic purging.
Listing 4 jesconfig Example
JESROOT=/nfs/users/john_doe/jreroot
DEFAULTJOBCLASS=B
DEFAULTJOBPRIORITY=9
EVENTPOST=S,C,E,P,L,A
QSPACE_MAX_USAGE=80
AUTOPURGE=10
AUTOPURGE_KEEPFILES=ON
 
Notes:
For the automatically purged job, all the files in folder “<JESROOT>/<JOB_ID>" is backed up as " <JESROOT>/<JOB_ID>.bak"
TuxJES Security Configuration
TuxJES leverages the Oracle Tuxedo security mechanism to implement authentication. If authentication is enabled, a security profile should be generated using the genapprofile utility and it should be used as a artjesadmin parameter to access the TuxJES system. The user used in the profile will be the job owner. A job only can be administrated by its owner, such as cancel, purge, hold and release. A job can be viewed by everybody. If a job is without owner, it can be manipulated by everyone.
Even if an Oracle Tuxedo application does not have security configured, the genjesprofile utility still can be used to enforce job owner permission checking and store the database connection MT_DB_LOGIN.
Based on this security mechanism, ART for Batch provides a lightweight job access authorization mechanism to control user's job operation actions. This authorization only needs simple configuration without involving any authorization server or even third-party security product. For more information, see Authorizing TuxJES Job Access.
TuxJES User Mapping File
User mapping file is loaded and takes effect when PRIVILEGE_MODE value is specified to MAPPING_CREDENTIAL. It defines the mapping relationship between Oracle Tuxedo users and OS users. Every line in the mapping file is in the format as below:
tuxedousername OSusername
It is recommended that the owner of user mapping file is root and the file permission is "-rw-------".
Listing 5 shows a segment example of user mapping file for the TuxJES system.
Listing 5 User Mapping File Example For the TuxJES System
tuxedouser1 OSuser1
tuxedouser2 OSuser2
 
Setting up TuxJES as an Oracle Tuxedo Application (Using Database)
Setting Up TuxJES
As an alternative of /Q, TuxJES can use Database to store and manage metadata of Batch jobs. In this mode, TuxJES does not need /Q anymore, providing better performance and full data consistency.
Note:
UBBCONFIG
TuxJES uses Database to store jobs rather than /Q; therefore, you do not need to use group for /Q and server TMQUEUE/TMS_QM any more. All other servers and groups are not impacted.
JESCONFIG
A new configuration item named USE_DB is added in JESCONFIG file to enable Database usage. Table 2 lists USE_DB values. Listing 6 shows an example.
 
Table 2 USE_DB Values
Notes:
autopurge is not supported in Database mode; all the setting for autopurge will be ignored.
Listing 6 JESCONFIG Example
JESROOT=/nfs/users/john_doe/jreroot
USE_DB=ORACLE
DEFAULTJOBCLASS=B
DEFAULTJOBPRIORITY=9
EVENTPOST=S,C,E,P,L,A
 
Setting Up Oracle Database
Getting Database Credential
When using Database as storage, connection information is necessary. It is encrypted and stored in a separate hidden file under JESROOT directory (JESROOT/.jessysprofile). A new utility gensysprofile is added to generate this file.
Its usage is:
gensysprofile -d <JESROOT>
When gensysprofile is launched, you are prompted to enter the user name, password, (Database) server name, and DB schema. Show prompt on the screen:
Listing 7 Screen Prompt
User name:
Password:
Server name:
DB Schema(Optional):
 
(Database) Server name string indicates the location where Database server can be found and is normally the name of the Database instance. The syntax is the same as the one used to set the TWO_TASK environment variable. Its format is either of the following:
For example, you can use either orcl12c, or //bej301420.cn.oracle.com:1522/orcl.cn.oracle.com.
The output is a hidden file .jessysprofile under JESROOT directory.
DB Schema is an optional parameter for user to input. If it is specified, TuxJES stores and manages metadata of Batch jobs in specified schema.
Notes:
If your Database does not exists at the location and must go through SQLNET to connect to it, you should specify host, port, and server_name in the format of //host:port/server_name.
Create Tables
To use Oracle Database to store job management data, you must first create table JES2_JOBNUM and JES2_JOB_PARAM. Two external shell scripts are provided for you to create and drop these two tables. The two scripts are located at $JESDIR/tools.
This shell script creates table JES2_JOB_PARAM and create index on field JOBNAME, CLASS, PRTY, STATUS, SUBMITTIME, GRPID, and SRVID; it also creates table JES2_JOBNUM and initialize the record in the JES2_JOBNUM. Schema name is an optional parameter. If schema name is specified, table JES2_JOBNUM and table JES2_JOB_PARAM are created in specified schema. Its usage is:
CreateTableJobDataOra.sh <DB_LOGIN_PARAMETER> <schema>
This shell script drops table JES2_JOBNUM and table JES2_JOB_PARAM. Schema name is an optional parameter. If schema name is specified, table JES2_JOBNUM and table JES2_JOB_PARAM are dropped in specified schema. Its usage is:
DropTableJobDataOra.sh <DB_LOGIN_PARAMETER> <schema>
Set Up Database TAF for Oracle (Optional)
If Oracle Database TAF (Transparent Application Failure) is enabled, when Database server crashes, after Database recovery, TuxJES can provide service continuously with no need for restarting TuxJES domain. If TAF is not enabled, once Database connection is broken, you must restart TuxJES domain after Database recovery.
You can configure TAF on both the client side and the server side. If both are configured, server-side settings take precedence.
For TAF configuration, see Oracle Database documentation for more information. The following is simple description of TAP.
Configure TAF on the client side by including the FAILOVER_MODE parameter in the CONNECT_DATA portion of a connect descriptor.
Configuring TAF option on the client side requires you to add Oracle Net parameters to tnsnames.ora file. The parameter that drives the TAF option is the FAILOVER_MODE under the CONNECT_DATA section of a connect descriptor. FAILOVER_MODE may contain the following parameters.
 
Listing 8 shows a sample. In this sample, failover type session and method basic are configured for FAILOVER_MODE.
Listing 8 Sample Configuration for Failover
TNSNAMES.ora
ART =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = bej301738.cn.oracle.com)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = art)
(FAILOVER_MODE =
(TYPE = session)
(METHOD = basic)
)
)
)
 
Setting Up TuxJES in MP Mode
TuxJES now can be easily configured within MP mode. For the purpose of running job, however, the configuration in both EJR and TuxJES need to be adjusted so that jobs can be run in parallel on different machines. This section clarifies the configuration mandatory for configuring Batch Runtime in MP mode.
Being shared by all the servers on different machines in a TuxJES domain, the data of jobs should be located on a shared storage (NFS), and can be accessible by all machines in the domain. In addition, the NFS should be mounted with the same mount point on all machines. Finally, JESROOT should be configured correctly on each node to point to the shared JES Root Directory. During runtime, all the TuxJES servers on any machine would write data to or get data from such shared JESROOT.
For the details of configuring EJR in MP mode, see “Configuring Batch Runtime in MP Mode” under “Using Batch Runtime”.
Using TuxJES
After the TuxJES system starts, you can use the artjesadmin utility to submit a job, hold a job, release a job, cancel a job, purge a job, display the job information, or subscribe event for job status change.
Submitting a Job
You can submit a job using the artjesadmin subcommand submitjob:
submitjob (smj) -i|-I scriptfilename [-t timeout] [-o ejr option]
-i scriptfilename: The script file.
-I scriptfilename: The option specified to submit JCL jobs.
-t timeout: Specifies to control the timeout threshold when submitting a job.
-o ejr option: Specifies the options passed to the EJR script file.
You can submit a job synchronously by using artjesadmin -y option.
For more information, see artjesadmin in Oracle Tuxedo Application Runtime for Batch Reference Guide.
Displaying Job Information
You can display the information of a job or a series of jobs using the artjesadmin subcommand printjob:
printjob(ptj) -n jobname | -j jobid | -c job_class |-a [-v] [-m] | -l
-n jobname: Display jobs with given job name
-j jobid: Display a particular job information
-c job_class: Display a particular class jobs information
-a: Display all jobs
-v: Verbose mode
-m: Print the CPU time usage of each step in one JOB
-l: Display the number of jobs for each job class in each job status type
Note:
-l option is not supported when you use /Q to store and manage metadata of Batch jobs.
The output of the printjob subcommand includes:
EXECUTING: a job is running
CONVING: a job waiting for conversion
WAITING: a job waiting for execution
DONE: a job finished successfully
FAIL: a job finished but failed
HOLD_WAITING: a job is in hold state after conversion
HOLD_CONVING: a job is in hold state without conversion
INDOUBT: a job is in doubt state due to its initiator restarted
CANCELED: a job is canceled
Type Run: The TYPRUN definition of the job.
Note:
For more information about how to set block time, please refer to Block Time in UBBCONFIG for TuxJES.
Getting Job Status (Synchronous)
You can get job status synchronously by using artjesadmin in the following format:
artjesadmin [-f [security_profile]] -p -j jobid
-p and -j
Option -p and -j are added to get job status without interaction in artjesadmin console.
Exit Code
Table 4 lists the exit codes for artjesadmin if -p.
 
Table 4 Exit Code
Job status = EXECUTING
Job status = HOLD_CONVING
Job status = HOLD_WAITING
This status will occur if tpenqueue() fails.
When a job is running, if JES server ARTJESINITIATOR is shutdown and then restarted, the job status will be INDOUBT.
Standard Output
Information shown in Table 5 is printed to stdout in the following format.
<JOBID>,<JOBNAME>,<JOBSTATUS>,<JOB RETURN CODE>
 
Listing 9 Sample: Job has been Finished Normally
00000002,JOBA,DONE,C0000
 
Listing 10 Sample: Job is Finished but Fails
00000002,JOBA,FAILED,U0568
 
Listing 11 Sample: Job is Running
00000002,JOBA,EXECUTING
 
Holding a Job
You can hold a job or a series of jobs which are in CONVING or WAITING status using the artjesadmin subcommand holdjob:
holdjob(hj) -n job name | -j jobid | -c job_class | -a
-n jobname: hold jobs with given job name
-j jobid: hold a particular job
-c job_class: hold a particular class jobs
-a: hold all jobs
Releasing a Job
You can release a job or a series of jobs which are in HOLD_WAITING or HOLD_CONVING status using the artjesadmin subcommand releasejob:
releasejob(rlj) -n job name | -j jobid | -c job_class | -a
-n jobname: release jobs with given job name
-j jobid: release a particular job
-c job_class: release a particular class jobs
-a: release all jobs
Canceling a Job
You can cancel a job or a series of jobs using the artjesadmin subcommand canceljob:
canceljob(cj) -n job name | -j jobid | -c job_class | -a
-n jobname: cancel jobs with given job name
-j jobid: cancel a particular job
-c job_class: cancel a particular class jobs
-a: cancel all jobs
Purging a Job
You can purge a job or a series of jobs using the artjesadmin subcommand purgejob:
purgejob(pgj) -n job name |-j jobid | -c job class | -s job status | -a
-n jobname: purge jobs with given job name
-j jobid: purge a particular job
-c job class: purge jobs with given job class
-s job status: purge jobs with given job status
-a: purge all jobs
Completed jobs in the DONE or FAIL status are moved to the purge queue. For other jobs, purgejob has same effect as canceljob. The purgejob command does not purge the job directly. The ARTJESPURGE server deletes the job from the TuxJES system.
Automatic Job Purge
When all the "available space" in queue space is occupied, any new job can't be submitted. To enable new job submission, users need to manually purge some jobs to decrease the usage rate. But this may introduce inconvenience and big effort to the application administrator. Another enhancement, Automatic Purging, can be introduced. With automatic purging enabled, whenever queue space usage rate reaches the warn level threshold, a specified count of jobs in OUTPUT queue are purged automatically. Automatic purging can be enabled or disabled (by default), and users can choose to backup files of all the jobs purged automatically or delete them permanently.
Notes:
If job submission failed, auto purge will not be activated.
Auto purge doesn't impact the current job submission.
JES system doesn't do auto purge in the background in any other form, such as check with a fixed interval.
OEM integration using TSAMPlus plug-in supports auto-archive of job logs and sysouts. If the jobs are purged, the key job information and job logs are available in the EM management repository.
The check action for queue space usage only happen at the time point after one job is inserted into queue space successfully. Only job submission can activate this check action. If job submission failed, this check action will not be activated.
The check result does not impact the current job submission.
JES system does not check queue space usage in the background in any other form, such as check with a fixed interval.
Set Warning Threshold for Queue Space
Set a warning threshold for usage rate of the queue space. This threshold can be configured in file "jesconfig". When submit a new job, JES will check current usage rate of the queue space, if it has reached the warning threshold:
1.
2.
This feature depends on one new feature of tuxedo /Q: return current queue space usage rate in percentage.
Notes:
If queue space is greater than warning threshold but is little than 100, that is "available space" has not been exhausted, new job submission is permitted, but warning message will be outputted in artjesadmin console.
If job submission failed, this check action will not be activated.
The check result doesn't impact the current job submission.
JES system does notcheck queue space usage in the background in any other form, such as check with a fixed interval.
Displaying/Changing ARTJESINITIATOR Configuration
You can display the number of maximum concurrent ARTJESINITIATOR server executing jobs using the artjesadmin subcommand printconcurrent:
printconcurrent(pco) -g groupname -i serverid
-g groupname: the Tuxedo group name of the ARTJESINITIATOR server
-i serverid: the Tuxedo server id of the ARTJESINITIATOR server
You can change the number of maximum concurrent ARTJESINITIATOR server executing jobs using the artjesadmin subcommand changeconcurrent:
changeconcurrent(chco) -g groupname -i serverid -n concurrent_num
-g groupname: the Tuxedo group name of the ARTJESINITIATOR server
-i serverid: the Tuxedo server id of the ARTJESINITIATOR server
-n concurrent_num: the number of maximum concurrent executing jobs
Controlling ARTJESINITIATOR Servers
You can display the number of ARTJESINITIATOR server executing jobs using the artjesadmin subcommand showjobexec:
showjobexec(she) [-n machine] | [-g groupid [-i serverid]]
-n machine
The Tuxedo logic machine name running ARTJESINITIATOR server.
-g groupid:
The Tuxedo group id of the ARTJESINITIATOR server
-i serverid:
The Tuxedo server id of the ARTJESINITIATOR server
Note:
If no option is specified, executing jobs for all ARTJESINITIATOR servers are displayed.
You can stop ARTJESINITIATOR servers from picking up a new job to execute; however, servers continue finishing current jobs.
stopjobexec(ste) [-n machine] | [-g groupid [-i serverid]]
-n machine:
The Tuxedo logic machine name running ARTJESINITIATOR server.
-g groupid:
The Tuxedo group id of the ARTJESINITIATOR server.
-i serverid:
The Tuxedo server id of the ARTJESINITIATOR server.
Note:
If no option is specified, all ARTJESINITIATOR servers stop picking up new jobs.
You can resume ARTJESINITIATOR server pick up and new job execution.
resumejobexec(rse) [-n machine] | [-g groupid [-i serverid]]
-n machine:
The Tuxedo logic machine name running ARTJESINITIATOR server.
-g groupid:
The Tuxedo group id of the ARTJESINITIATOR server
-i serverid:
The Tuxedo server id of the ARTJESINITIATOR server
Note:
If no option is specified, all ARTJESINITIATOR servers resume.
Controlling ARTJESINITIATOR Servers (Synchronous)
You can control ARTJESINITIATOR servers synchronously by using artjesadmin in the following format:
artjesadmin [-f [security_profile]] -x showjobexec|resumejobexec|stopjobexec [[lmid=machine|grpid=groupid|grpid=groupid,srvid=serverid];...]
-x showjobexec [[lmid=machine|grpid=groupid|grpid=groupid,srvid=serverid];...]:
Displays the number of executing jobs for all ARTJESINITIATOR servers, logical machine servers, servers by group id, or servers by group id and server id.
-x stopjobexec [[lmid=machine|grpid=groupid|grpid=groupid,srvid=serverid];...]:
Stops pick up of new jobs to execute for all ARTJESINITIATOR servers, logical machine servers, servers by group id, or server by group id and server id.
-x resumejobexec [[lmid=machine|grpid=groupid|grpid=groupid,srvid=serverid];...]:
Resumes pick up of new jobs to executefor all ARTJESINITIATOR servers, ogical machine servers, servers by group id, or server by group id and server id.
Event Subscribing/Unsubscribing
You can subscribe or unsubscribe job status change event using the artjesadmin subcommand event:
event (et) [-t C,E,P,L,A] on|off
C: job conversion complete event
E: job execution finish event
P: job purge event
L: job cancel completed event
A: all supported events. If the event is set to "on", A is the default.
on |off: The submission is on or off. the "on" setting can be used with the -t option.
After subscribing to an event, you are notified on the artjesadmin console when the corresponding event is generated.
Authorizing TuxJES Job Access
Based on TuxJES security mechanism, ART for Batch provides a lightweight job access authorization mechanism to control user's job operation actions. This authorization only needs simple configuration without involving any authorization server or even third-party security product.
In this mechanism, administrator can authorize particular user to do particular job operations, using TuxJES job operation authorization rules.
If an Oracle Tuxedo user is mapped to (or identical with) Unix/Linux root, it would be treated as a super user. This super user is allowed to do any job operation with no authorization checking performed.
Configuring Job Access Authorization Mechanism
The following configurations are mandatory to enable TuxJES job access authorization mechanism.
Set JES_ACL_FILE in JESCONFIG.
This is to specify the full path of job access authorization configuration file. For example:
JES_ACL_FILE=/home/user/simpjob/jesacl
If JES_ACL_FILE cannot be opened successfully, or it contains invalid format rules, ARTJESADM cannot boot up.
Note:
Do not configure JES_ACL_FILE if you want to use other authorization servers such as EAUTHSVR or if you do not want to use any kind of authorization, because the configuration for the job access authorization mechanism has higher precedence than other standalone ACL authorization servers.
Note:
Besides the above JES_ACL_FILE configurations, you should set other configurations to enable TuxJES security mechanism. For example, set PRIVILEGE_MODE to USER_IDENTICAL or USER_MAPPING in JESCONFIG, and set SECURITY to USER_AUTH, ACL, or MANDATORY_ACL in UBBCONFIG file.
The following configurations are optional to use this mechanism.
Set JES_ACL_FILE_TYPE to PLAIN (default) or ENCRYPTED in JESCONFIG to specify whether the JES_ACL_FILE is plain or encrypted.
Set JES_ACL_MODE to MAC (default) or DAC in JESCONFIG to specify the action when no matching rule in the rule file is found. See Example for Using JES_ACL_MODE for an example.
Also, we use genjesacl tool to generate the encrypted rule file for TuxJES system.
For more information, see ARTJESADM and genjesacl.
Using Job Operation Authorization Rules
Setting Rules
The JES_ACL_FILE file where you set rules can be plain or encrypted.
Plain JES_ACL_FILE File
Set job operation authorization rule in the plain text file that JES_ACL_FILE specifies. Use the following CSV format:
permission; user-list; operation-list; jobname-list
Here are some examples.
Listing 12: In this example, user tpuser1 is authorized to perform any kind of operation on any jobs.
Listing 13: In this example, user tpuser2 is authorized to operate on jobs with the JOBZ prefix in their name.
Listing 14: In this example, no user is authorized to purge any jobs.
Listing 12 Example for Setting Rules
ALLOW; tpuser1; *; *
 
Listing 13 Example for Setting Rules
ALLOW; tpuser2; *; JOBZ*
 
Listing 14 Example for Setting Rules
DENY;*; PURGE;*
 
permission
Specifies ALLOW or DENY for the permission.
This field is case insensitive.
user-list
Specifies Oracle Tuxedo user name. When specifying user name, you should not only follow Oracle Tuxedo's naming requirements but also follow the below requirements.
- User name should not contain a semicolon (
;).
- User name should not be just an asterisk (*).
Multiple users are separated by ":". An asterisk (*) means all Oracle Tuxedo users. Wildcards are not supported in this field. For example, tpuser* does not mean all users that have name starting with tpuser.
For Oracle Tuxedo's naming requirements, see Oracle Tuxedo Command Reference.
operation-list
Specifies job operations. The job operations could be SUBMIT, CANCEL, PURGE, HOLD, and RELEASE.
Among these five kinds of job operation, SUBMIT is the most important one and is the prerequisite of the following four kinds of job operation because if a user wants to cancel, purge, hold or release a job, TuxJES firstly checks whether the user is the owner of the job (only if the user is granted as SUBMIT and successfully submit a job, that user becomes the owner of this job and will own this job until it is purged out of TuxJES system).
Multiple operations are separated by ":". An asterisk (*) means all of these operations (equals to SUBMIT:CANCEL:PURGE:HOLD:RELEASE). Wildcards are not supported in this field. This field is case insensitive.
jobname-list
Specifies job names. The job name is not the file name of the job; it is the internal job name specified in m_JobBegin and translated from //<NAME> JOB statement in JCL.
Multiple job names are separated by ":". Wildcards "*" (for zero or more characters) and "?" (for only one character) are supported.
Encrypted JES_ACL_FILE file
If you set JES_ACL_FILE_TYPE=ENCRYPTED, you must configure the JES_ACL_FILE file as an encrypted file. This encrypted file can be generated by the genjesacl tool.
For more information, see JESCONFIG and genjesacl.
Processing Rules
In terms of multiple matching rules, the first matching rule takes precedence. A matching rule means that the user, operation and job fields are all matched.
If no rule is found to match the user, operation and job, the configuration of JES_ACL_MODE in JESCONFIG file takes effect. If JES_ACL_MODE is not set, its default value JES_ACL_MODE=MAC takes effect, meaning that the operation is denied.
Listing 15 shows an example.
Listing 15 Example for Processing Rules
ALLOW; tpuser1;*;*
DENY; tpuser1;*; JOBA
 
Though the above two rules are both matching rules, the first matching rule takes precedence, meaning that user tpuser1 is authorized to operate on JOBA and the second matching rule does not take effect.
If you want user tpuser1 to operate all the jobs except for JOBA, exchange the sequence of the above two rules.
Adding Comments to Rules
The lines (ignoring leading space) starting with character # are considered as comments. For example:
# This is comment
# This is also comment.
ALLOW;tpuser1;*;JOBA:JOBB
Do not write comments right after the rule in the same line. For example, the #C in the following line is not considered as a comment.
ALLOW;tpuser1;*;JOBA:JOBB#C
Examples
Example for Using Difference Ways to Set Rules
Suppose jobs whose names start with JOBAA, JOBBB and JOBCC need to be protected. You want to grant tpuser1 and tpuser2 for jobs whose names start with JOBAA, and grant tpuser3 and tpuser4 for jobs whose names start with JOBBB and JOBCC. All other jobs do not need to be protected.
The following rules can satisfy this requirement.
ALLOW;tpuser1:tpuser2;*;JOBAA*
ALLOW;tpuser3:tpuser4;*;JOBBB*:JOBCC*
DENY;*;*;JOBAA*:JOBBB*:JOBCC*
ALLOW;*;*;*
The following rules can also satisfy this requirement.
ALLOW;tpuser1:tpuser2;*;JOBAA*
ALLOW;tpuser3:tpuser4;*;JOBBB*:JOBCC*
DENY;*;*;JOBAA*:JOBBB*:JOBCC*
Then configure JES_ACL_MODE=DAC in JESCONFIG file.
Example for Using Wildcards to Set Rules
Suppose there are three Oracle Tuxedo users in the system: tpuser1, tpuser2, tpuser3; there are 30 jobs in the system: JOBX01-JOBX10, JOBY01-JOBY10, and JOBZ01-JOBZ10.
You want to grant tpuser1 and tpuser2 to operate all jobs, and grant tpuser3 to only operate 12 jobs: JOBX10, JOBY10, and JOBZ01-JOBZ10.
There are many solutions.
Option A:
DENY;tpuser3;*;JOBX0?:JOBY0?
ALLOW;*;*;*
Option B:
ALLOW;tpuser3;*;JOBX10:JOBY10:JOBZ*
ALLOW;tpuser1:tpuser2;*;*
In this case, Option A is not recommended because it authorizes the potential new user a high permission.
Example for Using JES_ACL_MODE
Suppose the rule file just contains one line.
ALLOW; tpuser1; *; JOBA
If user tpuser1 wants to submit JOBB and user tpuser2 wants to submit JOBA, there is no matching rule for these requirements; then the settings for JES_ACL_MODE take effect.
By default, JES_ACL_MODE is MAC, meaning that these actions would be denied; however, if you specify JES_ACL_MODE to DAC, the above operations will be allowed.
Using artjesadmin to Dynamically Change Job Access Authorization
You can dynamically change job access authorization, using artjesadmin command.
artjesadmin -f [security_profile] -x setjesacl aclfile=rulepath[,aclfiletype=PLAIN|ENCRYPTED[,aclmode=MAC|DAC]]
You can also use artjesadmin sub command.
setjesacl (sja) -f rulepath [-t PLAIN|ENCRYPTED] [-m MAC|DAC]
For example, to change the rule file of job access authorization to another file (aclrule.new) with DAC mode, you can use artjesadmin command as Listing 16 or use artjesadmin sub command as Listing 17.
Listing 16 Example of Using artjesadmin Command to Dynamically Change Job Access Authorization
artjesadmin -f jesprofile -x setjesacl aclfile=aclrule.new,aclmode=DAC
 
Listing 17 Example of Using artjesadmin Sub Command to Dynamically Change Job Access Authorization
artjesadmin -f jesprofile
setjesacl -f aclrule.new -m DAC
 
Tracing TuxJES
ART for Batch supports you to trace messages (error messages, warning messages, information messages, and debugging messages) generated by TuxJES client and server. These messages are formatted and stored in TuxJES trace files; you can use four different trace levels (ERROR, WARN, INFO, and DEBUG) to determine which messages will be displayed.
Setting Environment Variables
Before running Batch Runtime, you can set the following environment variables.
 
ERROR or error: TuxJES outputs error messages only.
WARN or warn: TuxJES outputs error messages and warning messages.
INFO or info: TuxJES outputs error messages, warning messages, and information messages.
DEBUG or debug: TuxJES outputs all messages.
If JESTRACE is not defined or if it is specified with none of these values above, TuxJES assumes that JESTRACE is specified with WARN - TuxJES outputs error messages and warning messages.
Understanding TuxJES Trace File
Every TuxJES server and client has its own TuxJES trace file. These trace files store trace messages generated by TuxJES client and server, including error messages, warning messages, information messages, and debugging messages.
By default, JES trace files are stored in ${APPDIR}/Logs directory; before running Batch Runtime, you can change the directory by setting the environment variable JES_TRACE_PATH.
A TuxJES server's trace file is named with the combination of server name, group ID, server ID, and a fixed-suffix "jestrace". For example,
ARTJESADM.1.1.jestrace is the jestrace file name of a ARTJESADM server; this server belongs to group 1 and its server ID is 1.
ARTJESCONV.1.20.jestrace is the jestrace file name of a ARTJESCONV server; this server belongs to group 1 and its server ID is 20.
A TuxJES client's trace file is named with the client name and a fixed-suffix "jestrace". For example,
artjesadmin.jestrace is the jestrace file name of a TuxJES client.
Understanding TuxJES Trace Message Format
A TuxJES trace message is composed of the following fields.
 
Understanding TuxJES Trace Message Level
There are four TuxJES trace messages levels.
TuxJES outputs error messages only.
TuxJES outputs error messages and warning messages.
TuxJES outputs error messages, warning messages, and information messages.
TuxJES outputs all messages.
Controlling TuxJES Trace Message Level
You can use environment variable JESTRACE to set the TuxJES trace message level, or use command artjesadmin to dynamically change it, determining which level of messages will be displayed.
Using JESTRACE to Set TuxJES Trace Message Level
You should set environment variable JESTRACE before running Batch Runtime. Once you set JESTRACE, it will set the TuxJES trace message level of all TuxJES clients and servers that your UBBCONFIG SERVERS section specifies.
For more information about JESTRACE, see Setting Environment Variables.
Using artjesadmin to Dynamically Change TuxJES Trace Message Level
You can dynamically change TuxJES trace message level, using artjesadmin command:
artjesadmin [-f [security_profile]] -x settracelevel [trclvl=trace_level[,[lmid=machine|grpid=groupid|grpid=groupid,srvid=serverid];...]]
You can also use artjesadmin sub command:
settracelevel(stl) -t tracelevel [-n machine] | [-g groupid [-i serverid]]
The parameter trclvl and -t can be set as 0, 1, 2, or 3. 0 indicates ERROR level; 1 indicates WARN level; 2 indicates INFO level; 3 indicates DEBUG level.
If none of the machine, groupid, and serverid parameter is specified, the artjesadmin will change the TuxJES trace message level of the current client and all servers that your UBBCONFIG SERVERS section specifies. Once you specify one or more parameters, the artjesadmin will only change the TuxJES trace message level of the servers that you specifies; the current client will not be changed.
Example A: Change TuxJES trace message level to DEBUG for the current client and all servers that your UBBCONFIG SERVERS section specifies. You can use artjesadmin command as Listing 18 or use artjesadmin sub command as Listing 19.
Example B: Change TuxJES trace message level to ERROR for the TuxJES servers which are running on SITE1 machine. You can use artjesadmin command as Listing 20 or use artjesadmin sub command as Listing 21.
Example C: Change TuxJES trace message level to INFO for all TuxJES administration servers that belong to group 1. You can use artjesadmin command as Listing 22 or use artjesadmin sub command as Listing 23.
Example D: Change TuxJES trace message level to INFO for a TuxJES administration server; this server belongs to group 1, and its server ID is 1. You can use artjesadmin command as Listing 24 or use artjesadmin sub command as Listing 25.
For more information, see artjesadmin in Oracle Tuxedo Application Runtime for Batch Reference Guide.
Listing 18 Example A: artjesadmin Command
artjesadmin -x settracelevel trclvl=3
 
Listing 19 Example A: artjesadmin Sub Command
artjesadmin
settracelevel -t 3
 
Listing 20 Example B: artjesadmin Command
artjesadmin -x settracelevel trclvl=0,lmid=SITE1
 
Listing 21 Example B: artjesadmin Sub Command
artjesadmin
settracelevel -t 0 -n SITE1
 
Listing 22 Example C: artjesadmin Command
artjesadmin -x settracelevel trclvl=2,grpid=1
 
Listing 23 Example C: artjesadmin Sub Command
artjesadmin
settracelevel -t 2 -g 1
 
Listing 24 Example D: artjesadmin Command
artjesadmin -x settracelevel trclvl=2,grpid=1,srvid=1
 
Listing 25 Example D: artjesadmin Sub Command
artjesadmin
settracelevel -t 2 -g 1 -i 1
 
See Also

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.