4 Using Tuxedo Job Enqueueing Service (TuxJES)
This chapter contains the following topics:
4.1 Overview
TuxJES addresses the following batch job phases:
- Input
- Conversion
- Processing
- Purge
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).
4.1.1 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.
Parent topic: Overview
4.1.2 TuxJES Components
TuxJES includes the following key components:
genjesprofile
Generates the security profile for Oracle Tuxedo applications
genjesacl
Generates the encrypted job access authorization configuration file for TuxJES system:
artjesadmin
TuxJES command interface. It is an Oracle Tuxedo client
ARTJESADM
TuxJES administration server. It is an Oracle Tuxedo server.
ARTJESCONV
TuxJES conversion server. It is an Oracle Tuxedo server.
ARTJESINITIATOR
JobTuxJES Initiator. It is an Oracle Tuxedo server.
ARTJESPURGE
TuxJES purge server. It is an Oracle Tuxedo server.
For more information, see the Oracle Tuxedo Application Runtime for Batch Reference Guide
Parent topic: Overview
4.2 Configuring a TuxJES System
This section contains the following topics:
- Setting up TuxJES as an Oracle Tuxedo Application (Using /Q)
- Setting up TuxJES as an Oracle Tuxedo Application (Using Database)
- Setting Up TuxJES in MP Mode
Parent topic: Using Tuxedo Job Enqueueing Service (TuxJES)
4.2.1 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
- Oracle Tuxedo /Q Queue Space and Queue Creation
- File System Configuration
- TuxJES Configuration File
- TuxJES Security Configuration
- TuxJES User Mapping File
Parent topic: Configuring a TuxJES System
4.2.1.1 Oracle Tuxedo Configuration File
The following Listing 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
):
ARTJESADM
ARTJESCONV
ARTJESINITIATOR
ARTJESPURGE
Note:
Multiple instances ofARTJESADM
, 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.
4.2.1.1.1 Block Time in UBBCONFIG for TuxJES
SCANUNIT
and BLOCKTIME
parameter. The value you assign must be a positive multiple of 5.
Table 4-1 Characteristics of the SCANUNIT and BLOCKTIME Parameters
Parameter | Characteristics |
---|---|
SCANUNIT
|
Controls the granularity of checking intervals and timeouts. SCANUNIT must be a multiple of 5 and between 0 and 60 seconds.
Example: The default is |
BLOCKTIME
|
The default time of |
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.
Parent topic: Oracle Tuxedo Configuration File
4.2.1.2 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 for Batch Reference Guide
4.2.1.3 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.
4.2.1.4 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
.
JOBLANG
JCL
or KSH
.
JCL
: support JCL job, user can only submit JCL
job.
KSH
: support KSH job, user can only submit KSH
job.
Not set: act as if KSH
is set.
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.
USE_COBOL_SERVER
If it is set to Y
, TuxJES COBOL server
(ARTJESCOBOLDB2MF
/ARTJESCOBOLDB2CIT
)
invokes user program; if it is set to N
or if it is
not set, TuxJES COBOL server does not invoke user program.
USE_COBOL_SERVER
configuration is only supported for
JCL job in Database mode.
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
.
USE_DB
ORACLE
or DB2
.
ORACLE
: Use Oracle Database to store job management
data.
DB2
: (not supported) Use DB2 Database to store job
management data.
Not set: Use /Q to store job information.
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.
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
Note:
If the usage rate of queue space reachs 80%, the first finished 10 jobs are automatically purged.For the automatically purged job, all the files in folder “<JESROOT>/<JOB_ID>
" is backed up as " <JESROOT>/<JOB_ID>.bak
"
4.2.1.5 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.
4.2.1.6 TuxJES User Mapping File
User mapping file is loaded and takes effect when
PRIVILEGE_MODE
value is specified
toMAPPING_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-------
".
The following Listing 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
4.2.2 Setting up TuxJES as an Oracle Tuxedo Application (Using Database)
This section contains the following topics:
Parent topic: Configuring a TuxJES System
4.2.2.1 Setting Up TuxJES
Note:
Now only Oracle Database is supported.4.2.2.1.1 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.
Parent topic: Setting Up TuxJES
4.2.2.1.2 JESCONFIG
A new configuration item named USE_DB
is added in JESCONFIG
file to enable Database usage. The following table lists USE_DB
values. Listing 6 shows an example.
Table 4-2 USE_DB Values
Name | Value | Description |
---|---|---|
USE_DB
|
ORACLE
|
Use Oracle Database to store job management data. |
DB2
|
Use DB2 as storage to store job information. | |
BDB
|
Use BDB as storage to store job information. | |
NOT SET |
Use /Q to store job information. |
Note:
autopurge
is not supported in Database mode; all the setting forautopurge
will be ignored.- NJE is not supported in Database mode.
- All other settings are the same as in /Q mode.
JESROOT=/nfs/users/john_doe/jreroot
USE_DB=ORACLE
DEFAULTJOBCLASS=B
DEFAULTJOBPRIORITY=9
EVENTPOST=S,C,E,P,L,A
Parent topic: Setting Up TuxJES
4.2.2.2 Setting Up Oracle Database
This section contains the following topics:
4.2.2.2.1 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
). gensysprofile
utility is used 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:
//host:port/server_name
instance_name
For example, you can use either orcl12c
, or //bej301420.cn.myexample.com:1522/orcl.cn.myexample.com
.
The output is a hidden file .jessysprofile
under
JESROOT
directory.
Note:
- 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
. - Only JES administrator or OS root user can run
gensysprofile
.
Parent topic: Setting Up Oracle Database
4.2.2.2.2 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
.
CreateTableJobDataOra.sh
This shell script creates table
JES2_JOB_PARAM
and create index on fieldJOBNAME
,CLASS
,PRTY
,STATUS
,SUBMITTIME
,GRPID
, andSRVID
; it also creates tableJES2_JOBNUM
and initialize the record in theJES2_JOBNUM
. Schema name is an optional parameter. If schema name is specified, tableJES2_JOBNUM
and tableJES2_JOB_PARAM
are created in specified schema. Its usage is:CreateTableJobDataOra.sh <DB_LOGIN_PARAMETER> <schema>
DropTableJobDataOra.sh
This shell script drops table
JES2_JOBNUM
and tableJES2_JOB_PARAM
. Schema name is an optional parameter. If schema name is specified, tableJES2_JOBNUM
and table JES2_JOB_PARAM are dropped in specified schema. Its usage is:DropTableJobDataOra.sh <DB_LOGIN_PARAMETER> <schema>
Parent topic: Setting Up Oracle Database
4.2.2.2.3 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:
Table 4-3 tnsnames.ora File Parameters
Parameter | Description |
---|---|
TYPE
|
Specifies the type of failover. |
METHOD
|
Determinates how fast failover occurs from the primary node to the backup node. |
BACKUP
|
Specifies a different net service name for backup connections. |
RETRIES
|
Specifies the number of times to attempt to connect. |
DELAY
|
Specifies the amount of time in seconds to wait between connect attempts. |
The following Listing shows a sample. In this sample, failover type session
and method basic
are configured for FAILOVER_MODE
.
TNSNAMES.ora
ART =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = bej301738.cn.myexample.com)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = art)
(FAILOVER_MODE =
(TYPE = session)
(METHOD = basic)
)
)
)
Parent topic: Setting Up Oracle Database
4.2.2.3 Setting Up DB2 Database
Note:
You should configureUSE_DB=DB2
in JESCONFIG
. See Setting Up TuxJES for more information.
Do the followings to set up DB2 database:
4.2.2.3.1 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
). Use
gensysprofile
utility to generate this file.
Its usage is:
gensysprofile -d <JESROOT>
Listing 9 shows a sample.
Listing 9 Sample for Getting DB2 Database Credential
gensysprofile -d /home/testuser1/work_batchrt/jesroot
gensysprofile will create a profile "/home/testuser1/work_batchrt/jesroot/.jessysprofile"
User name (0~30 characters):db2b004
User Password (0~31 characters):
Confirm User Password (0~31 characters):
Database instance name:artbatch
DB Schema(Optional):db2b002
/home/testuser1/work_batchrt/jesroot/.jessysprofile is created successfully
Note:
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.Parent topic: Setting Up DB2 Database
4.2.2.3.2 Creating Tables
Use the following command line to create necessary tables in DB2.
$JESDIR/tools/CreateTableJobDataDb2.sh <DB CONN STRING> <schema>
You can use the following command line to remove these tables:
$JESDIR/tools/DropTableJobDataDb2.sh <DB CONN STRING> <schema>
The following Listing shows a sample for creating tables in DB2.
Listing 10 Sample for Creating Tables in DB2
$JESDIR/tools/CreateTableJobDataDb2.sh "artbatch user db2b004 using db2b004"
<<omit some msg here>>
db2 => db2 (cont.) => db2 (cont.) => CREATE TABLE JES2_JOBNUM ( JOBNUM INT )
DB20000I The SQL command completed successfully.
db2 => INSERT INTO JES2_JOBNUM VALUES ('0')
DB20000I The SQL command completed successfully.
db2 => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => db2 (cont.) => CREATE TABLE JES2_JOB_PARAM ( JOBID INT NOT NULL, JOBNAME VARCHAR(32), CLASS INT, PRTY INT, STATUS VARCHAR(32), SUBMITTIME INT, TYPRUN VARCHAR(8), OWNER VARCHAR(32), JOBTYPE VARCHAR(3), EXECGRP VARCHAR(32), MACHINE INT, GRPID INT, SRVID INT, SRVPID INT, EXECTIME INT, ENDTIME INT, JOBPID INT, JOBRC VARCHAR(5), USRSEC INT, USRUSEC INT, SYSSEC INT, SYSUSEC INT, JOBSCRIPT VARCHAR(2048), EJROPTION VARCHAR(128), SHELLOPTION VARCHAR(128), INPUTTYPE INT, CLIENTMODE VARCHAR(32), CLTIDDATA1 INT, CLTIDDATA2 INT, CLTIDDATA3 INT, CLTIDDATA4 INT, PROFILECONTENT VARCHAR(1024), JOBENV VARCHAR(1024), Reserve1 INT, Reserve2 INT, Reserve3 VARCHAR(128), Reserve4 VARCHAR(128), CONSTRAINT PK_JES2_JOB_PARAM PRIMARY KEY (JOBID) )
DB20000I The SQL command completed successfully.
db2 => CREATE INDEX JES2_JOB_PARAM_JNAME on JES2_JOB_PARAM (JOBNAME)
DB20000I The SQL command completed successfully.
db2 => CREATE INDEX JES2_JOB_PARAM_CLASS on JES2_JOB_PARAM (CLASS ASC)
DB20000I The SQL command completed successfully.
db2 => CREATE INDEX JES2_JOB_PARAM_PRTY on JES2_JOB_PARAM (PRTY DESC)
DB20000I The SQL command completed successfully.
db2 => CREATE INDEX JES2_JOB_PARAM_STATUS on JES2_JOB_PARAM (STATUS)
DB20000I The SQL command completed successfully.
db2 => CREATE INDEX JES2_JOB_PARAM_SUBTIME on JES2_JOB_PARAM (SUBMITTIME ASC)
DB20000I The SQL command completed successfully.
db2 => CREATE INDEX JES2_JOB_PARAM_GRPID on JES2_JOB_PARAM (GRPID)
DB20000I The SQL command completed successfully.
db2 => CREATE INDEX JES2_JOB_PARAM_SRVID on JES2_JOB_PARAM (SRVID)
DB20000I The SQL command completed successfully.
db2 => commit
DB20000I The SQL command completed successfully.
db2 => DB20000I The TERMINATE command completed successfully.
Parent topic: Setting Up DB2 Database
4.2.2.3.3 Managing Job in DB2
Do the following to use this feature.
- Setting DB2 Environment
DB2 environment must be ready before you boot JES domain. Suggest using
db2profile
, such as$source /home/db2b004/sqllib/db2profile
, or settingLD_LIBRARY_PATH
andPATH
(and other DB2 environment variables one by one). See DB2 documentation for more information. - Booting JES Domain
Run
tmboot
to start JES domain, and then useartjesadmin
to submit or manage job.
Parent topic: Setting Up DB2 Database
4.2.2.4 Setting Up BDB Database
Note:
You should configureUSE_DB=BDB
in JESCONFIG
. See Setting Up TuxJES for more information.
Do the followings to set up BDB database:
4.2.2.4.1 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
). Use
gensysprofile
utility to generate this file.
Its usage is:
gensysprofile -d <JESROOT>
Because there is no username and password in BDB, you should
leave the username
field and the password
field blank and directly press ENTER
. For the
instance name
filed, you should input the file name of
BDB DB file (and do not include path). For example, if BDB DB file
is "/home/testuser1/appdir/jesroot/jesbdb
", the
corresponding database instance name should be
"jesbdb
".
Parent topic: Setting Up BDB Database
4.2.2.4.2 Creating Tables
Use the following command line to create necessary tables in
BDB. For BDB, the database is a file on disk, and this file must be
placed in folder <JESROOT>
.
$JESDIR/tools/CreateTableJobDataBdb.sh <BDB FILE FULL PATH>
For example,
$JESDIR/tools/CreateTableJobDataBdb.sh "/home/testuser1/appdir/jesroot/jesbdb"
You can use the following command line to remove these tables:
$JESDIR/tools/DropTableJobDataBdb.sh <BDB FILE PATH>
Parent topic: Setting Up BDB Database
4.2.3 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”.
Parent topic: Configuring a TuxJES System
4.3 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
- Displaying Job Information
- Holding a Job
- Releasing a Job
- Canceling a Job
- Purging a Job
- Displaying/Changing ARTJESINITIATOR Configuration
- Controlling ARTJESINITIATOR Servers
- Event Subscribing/Unsubscribing
Parent topic: Using Tuxedo Job Enqueueing Service (TuxJES)
4.3.1 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.
Parent topic: Using TuxJES
4.3.2 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:
- JOBNAME: The job Name
- JobID: The Job ID generated by TuxJES system
- Owner: The submission user of the job
- Prty: Priority of the job
- C: Job Class
- Status: Job Status
EXECUTING
: a job is runningCONVING
: a job waiting for conversionWAITING
: a job waiting for executionDONE
: a job finished successfullyFAIL
: a job finished but failedHOLD_WAITING
: a job is in hold state after conversionHOLD_CONVING
: a job is in hold state without conversionINDOUBT
: a job is in doubt state due to its initiator restartedCANCELED
: a job is canceled
- Submit time: The submit time of the job
- Step: The current running job step. It is only applicable to running jobs.
- Type Run: The
TYPRUN
definition of the job. - Machine: Only for running/done/failed jobs. It is the machine name that the job is/was running on.
- CPU usage: The user CPU usage and system CPU usage for the job execution.
- Result: Job operation result, “OK” or error message.
Note:
If there are too many jobs in JES2 system, printing all jobs' status in console may lead to time out; to avoid this situation, users need to configure long enough block time in ubbconfig of JES.For more information about how to set block time, please refer to Block Time in UBBCONFIG for TuxJES.
Parent topic: Using TuxJES
4.3.2.1 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
The following table lists the exit codes for artjesadmin
if -p
.
Table 4-4 Exit Code
Exit Code | Description | Notes |
---|---|---|
0 | Job is finished normally. Job status = DONE
|
A job is finished successfully. |
1 | Command execution fails. | The failure is caused by an internal error, a network error, or a syntax error. |
3 | Job status = FAIL
|
JOB execution fails. |
4 | Job status = CANCEL
|
A job is canceled. |
5 | Job status = CONVING
|
A job is waiting for conversion. |
6 | Job status = EXECUTING
|
A job is running. |
7 | Job status = HOLD_CONVING
|
A job is in hold state without conversion. |
8 | Job status = HOLD_WAITING
|
A job is in hold state after conversion. |
9 | Job status = WAITING
|
A job is waiting for execution. |
10 | Job status = DISCARD
|
This status will occur if tpenqueue() fails.
|
11 | Job status = INDOUBT
|
When a job is running, if JES server ARTJESINITIATOR is shutdown and then restarted, the job status will be INDOUBT .
|
22 | Job doesn’t exist. | N/A |
Standard Output
Information shown in Table 5 is printed to stdout in the following format.
<JOBID>,<JOBNAME>,<JOBSTATUS>,<JOB RETURN CODE>
Table 4-5 Standard Output
Output Content | Description | Sample |
---|---|---|
<JOBID>
|
Job ID | 00005097
|
<JOBNAME>
|
Job name | JOBA
|
<JOBSTATUS>
|
Job current status | DONE
|
<JOB RETURN CODE> |
Job return code from EJR (only available if a job has finished) | C000
|
Listing 11 Sample: Job has been Finished Normally
00000002
,JOBA,DONE,C0000
Listing 12 Sample: Job is Finished but Fails
00000002
,JOBA,FAILED,U0568
Listing 13 Sample: Job is Running
00000002
,JOBA,EXECUTING
Parent topic: Displaying Job Information
4.3.3 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
Parent topic: Using TuxJES
4.3.4 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
Parent topic: Using TuxJES
4.3.5 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
Parent topic: Using TuxJES
4.3.6 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.
Parent topic: Using TuxJES
4.3.6.1 Automatic Job Purge
Note:
Auto purge only happen at the time point after one job is inserted into queue space successfully and the queue usage reach the warning threshold. If there is no job exists in the OUTPUT queue in this time point, no job will be purged automatically. As an extreme case, after one job is submitted, the status of queue space changed to "available space are all occupied" and "no job in OUTPUT queue", no job can be purged automatically by this last job submission, in this situation, auto purge will never be performed, user must purge some job manually, otherwise no new job can be submitted.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.
Parent topic: Purging a Job
4.3.6.1.1 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:
- Activate auto purge if it's enabled in jesconfig file
- One line warning message is output to artjesadmin console following the "job submitted successfully" message, which indicate user to purge some jobs. Or show how many jobs has been auto purged (if auto purge is enabled).
Note:
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 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.
Parent topic: Automatic Job Purge
4.3.7 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
Parent topic: Using TuxJES
4.3.8 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 allARTJESINITIATOR
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, allARTJESINITIATOR
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, allARTJESINITIATOR
servers resume.
4.3.8.1 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.
Parent topic: Controlling ARTJESINITIATOR Servers
4.3.9 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.
Parent topic: Using TuxJES
4.4 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
- Using Job Operation Authorization Rules
- Using artjesadmin to Dynamically Change Job Access Authorization
Parent topic: Using Tuxedo Job Enqueueing Service (TuxJES)
4.4.1 Configuring Job Access Authorization Mechanism
The following configurations are mandatory to enable TuxJES job access authorization mechanism.
- Set
JES_ACL_FILE
inJESCONFIG
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 configureJES_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.
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
toPLAIN
(default) orENCRYPTED
inJESCONFIG
to specify whether theJES_ACL_FILE
is plain or encrypted. - Set
JES_ACL_MODE
toMAC
(default) orDAC
inJESCONFIG
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.
Parent topic: Authorizing TuxJES Job Access
4.4.2 Using Job Operation Authorization Rules
This section has the following topics:
Parent topic: Authorizing TuxJES Job Access
4.4.2.1 Setting Rules
The JES_ACL_FILE file where you set rules can be plain or encrypted.
Parent topic: Using Job Operation Authorization Rules
4.4.2.1.1 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
- permission
- user-list
- operation-list
- jobname-list
Here are some examples.
- Listing 14: In this example, user
tpuser1
is authorized to perform any kind of operation on any jobs. - Listing 15: In this example, user
tpuser2
is authorized to operate on jobs with theJOBZ
prefix in their name. - Listing 16: In this example, no user is authorized to purge any jobs.
Listing 14 Example for Setting Rules
ALLOW; tpuser1; *; *
Listing 15 Example for Setting Rules
ALLOW; tpuser2; *; JOBZ*
Listing 16 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.
Parent topic: Setting Rules
4.4.2.1.2 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.
Parent topic: Setting Rules
4.4.2.2 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 17 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.
Parent topic: Using Job Operation Authorization Rules
4.4.2.3 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
Parent topic: Using Job Operation Authorization Rules
4.4.2.4 Examples
The following are the list of examples:
- Example for Using Difference Ways to Set Rules
- Example for Using Wildcards to Set Rules
- Example for Using JES_ACL_MODE
Parent topic: Using Job Operation Authorization Rules
4.4.2.4.1 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.
Parent topic: Examples
4.4.2.4.2 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.
Parent topic: Examples
4.4.2.4.3 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.
Parent topic: Examples
4.4.3 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 18 or use
artjesadmin
sub command as Listing 19.
Listing 18 Example of Using artjesadmin Command to Dynamically Change Job Access Authorization
artjesadmin -f jesprofile -x setjesacl aclfile=aclrule.new,aclmode=DAC
Listing 19 Example of Using artjesadmin Sub Command to Dynamically Change Job Access Authorization
artjesadmin -f jesprofile
setjesacl -f aclrule.new -m DAC
Parent topic: Authorizing TuxJES Job Access
4.5 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
- Understanding TuxJES Trace File
- Understanding TuxJES Trace Message Format
- Understanding TuxJES Trace Message Level
- Controlling TuxJES Trace Message Level
Parent topic: Using Tuxedo Job Enqueueing Service (TuxJES)
4.5.1 Setting Environment Variables
Before running Batch Runtime, you can set the following environment variables:
Table 4-6 Available Environment Variables for Tracing TuxJES
Variable | Usage |
---|---|
JES_TRACE_PATH |
The directory where TuxJES trace files are stored. The default directory is ${APPDIR}/Logs .
|
JESTRACE
|
The display level of TuxJES trace messages. Set one of the following:
The default value is If - TuxJES outputs error messages and warning messages. |
Parent topic: Tracing TuxJES
4.5.2 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 thejestrace
file name of aARTJESADM
server; this server belongs to group 1 and its server ID is 1.ARTJESCONV.1.20.jestrace
is thejestrace
file name of aARTJESCONV
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 thejestrace
file name of a TuxJES client.
Parent topic: Tracing TuxJES
4.5.3 Understanding TuxJES Trace Message Format
A TuxJES trace message is composed of the following fields:
Table 4-7 TuxJES Trace Message Format
Field | Content |
---|---|
1 | Process ID (PID) |
2 | Thread ID (TID) |
3 | Current timestamp |
4 | Trace message level. For more information, see Understanding TuxJES Trace Message Level and Controlling TuxJES Trace Message Level. |
5 | Functions that can display the message |
6 | The message to be displayed with possible dynamic values |
Parent topic: Tracing TuxJES
4.5.4 Understanding TuxJES Trace Message Level
There are four TuxJES trace messages levels.
- ERROR Level
TuxJES outputs error messages only.
- WARN Level (Default Level)
TuxJES outputs error messages and warning messages.
- INFO Level
TuxJES outputs error messages, warning messages, and information messages.
- DEBUG Level
TuxJES outputs all messages.
Parent topic: Tracing TuxJES
4.5.5 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
- Using artjesadmin to Dynamically Change TuxJES Trace Message Level
Parent topic: Tracing TuxJES
4.5.5.1 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.
Parent topic: Controlling TuxJES Trace Message Level
4.5.5.2 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 yourUBBCONFIG SERVERS
section specifies. You can useartjesadmin
command as Listing 20 or useartjesadmin
sub command as Listing 21. - Example B: Change TuxJES trace message level to
ERROR
for the TuxJES servers which are running onSITE1
machine. You can useartjesadmin
command as Listing 22 or useartjesadmin
sub command as Listing 23 - Example C: Change TuxJES trace message level to
INFO
for all TuxJES administration servers that belong to group 1. You can useartjesadmin
command as Listing 24 or useartjesadmin
sub command as Listing 25 - 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 useartjesadmin
command as Listing 26 or useartjesadmin
sub command as Listing 27
For more information, see artjesadmin in Oracle Tuxedo Application Runtime for Batch Reference Guide.
Listing 20 Example A: artjesadmin Command
artjesadmin -x settracelevel trclvl=3
Listing 21 Example A: artjesadmin Sub Command
artjesadmin
settracelevel -t 3
Listing 22 Example B: artjesadmin Command
artjesadmin -x settraceleveltrclvl=0,lmid=SITE1
Listing 23 Example B: artjesadmin Sub Command
artjesadmin
settracelevel -t 0 -n SITE1
Listing 24 Example C: artjesadmin Command
artjesadmin -x settracelevel trclvl=2,grpid=1
Listing 25 Example C: artjesadmin Sub Command
artjesadmin
settracelevel -t 2 -g 1
Listing 26 Example D: artjesadmin Command
artjesadmin -x settracelevel trclvl=2,grpid=1,srvid=1
Listing 27 Example D: artjesadmin Sub Command
artjesadmin
settracelevel -t 2 -g 1 -i 1