Table of Contents Previous Next PDF


Tuxedo Job Enqueueing Service (TuxJES)

Tuxedo Job Enqueueing Service (TuxJES)
This chapter contains the following topics:
TuxJES Servers, Commands, and Utilities
TuxJES Job Operation
TuxJES Servers, Commands, and Utilities
This chapter describes servers, commands, and utilities included in the TuxJES feature.
Table 1 lists TuxJES commands and functions.
 
TuxJES command interface.
TuxJES administration server.
TuxJES conversion server.
TuxJES job control API.
TuxJES Queue system.
genjesprofile
Name
genjesprofile – Generates the security profile for TuxJES system
Synopsis
genjesprofile [-f userprofile]
Description
genjesprofile generates the TuxJES system security profile. When genjesprofile is launched, you are prompted to enter the Oracle Tuxedo application password, user name, user password, the database connection string for MT_DB_LOGIN, the database connection string for MT_GDG_DB_ACCESS, the database connection string for MT_DB_LOGIN2, and the database connection string for MT_CATALOG_DB_LOGIN, and the ftp password for MT_FTP_PASS.
The output is a security profile file that contains the Oracle Tuxedo application password, user name, user password, the database connection string for MT_DB_LOGIN, the database connection string for MT_GDG_DB_ACCESS, the database connection string for MT_DB_LOGIN2, and the database connection string for MT_CATALOG_DB_LOGIN with the file permission -rw-------, and the ftp password for MT_FTP_PASS.
Note:
Parameters and Options
genjesprofile supports the following parameters and options:
[-f <output_file>]
The location of the generated security profile file. If this option is not specified, the default value is ~/.tuxAppProfile.
See Also
artjesadmin
genjesacl
Name
genjesacl - Generates the encrypted job access authorization configuration file for TuxJES system.
Synopsis
genjesacl [-f <output_file>]
Description
genjesacl reads plain rules from STDIN line by line until EOF (pressing Ctrl+D at the beginning of the line in terminal can produce EOF), and then generates an encrypted configuration file. It must be used when JES_ACL_FILE_TYPE=ENCRYPTED is specified.
The generated encrypted configuration file can be used by the ARTJESADM tool to authorize TuxJES job access.
Parameters and Options
genjesacl supports the following parameters and options:
[-f <output_file>]
The location of the encrypted rule file that genjesacl generates. If this option is not specified, the default value is ~/.jesAclEncrypted.\
See Also
ARTJESADM
gensysprofile
Name
gensysprofile – Generates file to encrypt and store TuxJES Database connection information.
Synopsis
gensysprofile -d <JESROOT>
Description
gensysprofile generates file to encrypt and store TuxJES Database connection information.
Parameters and Options
gensysprofile supports the following parameters and options:
-d <JESROOT>
Specifies JESROOT directory, where this file is to be generated.
artjesadmin
Name
artjesadmin – TuxJES command interface.
Synopsis
Description
artjesadmin is the TuxJES command interface.The TuxJES system must be started first.
Parameters and Options
artjesadmin supports the following parameters and options:
-h
Option -h prints artjesadmin usage information as listed above.
-v
Option -v indicates the current version of Oracle Tuxedo Application Runtime for Batch.
-f
The security profile file generated by genjesprofile. The default value is ~/.tuxAppProfile. It requires the owner of the security profile must be the user who runs artjesadmin. The user name in this profile is the owner of the submitted jobs. A job without a specified owner is assigned the owner name "*".
A job with a particular owner can only be controlled by that owner. A job without a particular owner (*) can be controlled by anyone. Any user can print all jobs.
Note:
If -f profile is specified, the specified profile file will be used;
If -f is specified while profile is not, ~/.tuxAppProfile will be used as the profile file;
If -f is not specified, nothing will be used as the profile file.
-p and -j
Option -p and -j are added to get job status without interaction in artjesadmin console.
Table 2 lists the exit codes for artjesadmin if -p is specified.
 
Table 2 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.
Information shown in Table 3 is printed to stdout in the following format.
<JOBID>,<JOBNAME>,<JOBSTATUS>,<JOB RETURN CODE>
 
Listing 1 Sample: Job has been Finished Normally
00000002,JOBA,DONE,C0000
 
Listing 2 Sample: Job is Finished but Fails
00000002,JOBA,FAILED,U0568
 
Listing 3 Sample: Job is Running
00000002,JOBA,EXECUTING
 
-x showjobexec|resumejobexec|stopjobexec [[lmid=machine|grpid=groupid|grpid=groupid,srvid=serverid];...]
Option -x is specified to control ARTJESINITIATOR servers. It must be showjobexec, resumejobexec, or stopjobexec. For more information, see Sub Commands.
-t <timeout>
Option -t <timeout> is specified to control the timeout threshold when submitting a job in synchronous mode, asynchronous mode, or console mode. With -t option, an integer can be specified to control the timeout. If no timer is specified, clients will wait forever.
-T
Option -T is specified to submit a job in test mode, which only do checks rather than executing this job. For more information about test mode, see -t file|NULL argument in EJR Syntax.
-o ejr option
Option -o ejr option specifies the options passed to the EJR script file.
-y
Option -y is added to submit a job in the synchronous way. This option enables synchronous mode to wait for job end.
Note:
Table 4 lists the exit codes for artjesadmin if -y is specified.
 
Table 4 Exit Code
Information shown on Table 5 will be printed to stdout in the following format.
<JOBID>,<JOBNAME>,<JOBSTATUS>,<JOB RETURN CODE>
 
Listing 4 Sample: Job is Executed Successfully
00000002,JOBA,DONE,C0000
 
Listing 5 Sample: Job Fails
00000002,JOBA,FAILED,U0568
 
Listing 6 Sample: Timeout Occurs
00000002,JOBA,Already Timeout!
 
-i
Option -i is specified to submit KSH jobs. scriptfile should be full path for one KSH job.
-I
Option -I is specified to submit JCL jobs. scriptfile should be full path for one JCL job.
-x settracelevel [trclvl=trace_level[,[lmid=machine|grpid=groupid|grpid=groupid,srvid=serverid];...]]
Option -x settracelevel is specified to set the TuxJES trace message level. For more information, see Sub Commands.
-x setjesacl aclfile=rulepath[,aclfiletype=PLAIN|ENCRYPTED[,aclmode=MAC|DAC]]
Option -x setjesacl is specified to change job access authorization. For more information, see Sub Commands.
Sub Commands
artjesadmin supports the following sub commands:
submitjob (smj) -i|-I scriptfilename [-t timeout] [-o ejr option]
Submits a job to TuxJES system. The scriptfilename parameter is the job script to be submitted.
Note:
artjesadmin is not responsible for scriptfile propagation. It must be located on a shared file system if the conversion and execution are not on same machines. The options are as follows:
-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.
showjobexec(she) [-n machine] | [-g groupid [-i serverid]]
Display the number of executing jobs of ARTJESINITIATOR servers.If no option is specified, display the number of executing jobs of all ARTJESINITIATOR servers.
-n machine:
The Tuxedo logic machine name that the ARTJESINITIATOR server is running on.
-g groupid:
The Tuxedo group id of the ARTJESINITIATOR server.
-i serverid:
The Tuxedo server id of the ARTJESINITIATOR server.
stopjobexec(ste) [-n machine] | [-g groupid [-i serverid]]
Stops ARTJESINITIATOR servers from picking up a new job to execute; the server continue finishing current jobs. If no option is specified, all ARTJESINITIATOR servers stop picking up new jobs.
-n machine:
The Tuxedo logic machine name that the ARTJESINITIATOR server is running on.
-g groupid:
The Tuxedo group id of the ARTJESINITIATOR server.
-i serverid:
The Tuxedo server id of the ARTJESINITIATOR server.
resumejobexec(rse) [-n machine] | [-g groupid [-i serverid]]
Resume ARTJESINITIATOR servers pick up of new jobs to execute. If no option is specified, all ARTJESINITIATOR servers resume picking up new jobs.
-n machine:
The Tuxedo logic machine name that the ARTJESINITIATOR server is running on.
-g groupid:
The Tuxedo group id of the ARTJESINITIATOR server.
-i serverid:
The Tuxedo server id of the ARTJESINITIATOR server.
settracelevel(stl) -t tracelevel [-n machine] | [-g groupid [-i serverid]]
Set the TuxJES trace message level of TuxJES client and server.
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.
-t tracelevel:
Specify the TuxJES trace message level parameter. -t tracelevel 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.
-n machine:
Specify the Tuxedo logic machine which the TuxJES server is running on.
-g groupid:
Specify the Tuxedo group which the TuxJES server belongs to.
-i serverid:
Specify the Tuxedo server ID of the TuxJES server.
setjesacl (sja) -f rulepath [-t PLAIN|ENCRYPTED] [-m MAC|DAC]
Dynamically change job access authorization. Only the Oracle Tuxedo user who is mapped to (or identical with) Unix/Linux root (referred to as super user) can use this sub command.
-f rulepath:
Specify the path of job access authorization configuration file. Its usage is just likes JES_ACL_FILE in JESCONFIG.
-t PLAIN|ENCRYPTED:
Specify the rule file is encrypted or not. If not specified, use the default value PLAIN. Its usage is just likes JES_ACL_FILE_TYPE in JESCONFIG.
-m MAC|DAC:
Specify the action when no matching rule is found for the user. If not specified, use its default value MAC. Its usage is just likes JES_ACL_MODE in JESCONFIG.
Error(s)
Once successfully invoked, the return format Job xxx is submitted successfully. If an error occurs, an error message is printed.
artjesadmin also supports direct job submission using the following format: artjesadmin [-o='xxx'] -i/-I scriptfile.
artjesadmin has a return code different from zero if there is an error occurs as listed in Table 6.
 
Table 6 Error Codes
JES2SUBMIT service error
Printing
printjob(ptj) -n jobname | -j jobid | -c job_class |-a [-v][-t JCL|KSH][-m] | -l
Displays the existing jobs. If no option is specified, it displays all jobs. The options are as follows:
-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
-t JCL|KSH: Display JCL|KSH jobs
-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.
Listing 7 printjob Output
> ptj -a
JOBNAME JobID Owner Prty C Type Status
-------- -------- -------- --------- ------ --------
cjob 00000015 * 5 A KSH DONE
cjob 00000016 * 5 A KSH DONE
cjob 00000018 * 5 A KSH CONVING
 
total:3
success:3
 
JOBNAME: The job name.
JobID: The job ID generated by TuxJES system
Type: the job type (JCL or KSH)
Owner: Job Owner.
Prty: Job priority
C: The job class.
Status: Job status
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
In verbose mode, the job detail information is displayed:
If no option is specified, the "-a" option is assumed.
holdjob(hj) -n job name | -j jobid | -c job_class | -a
Hold the specified jobs which are in CONVING or WAITING status. The options are as follows:
-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
If no option is specified, the "-a" option is assumed.
releasejob(rlj) -n job name |-j jobid | -c job_class | -a
Releases the jobs in HOLD_WAITING or HOLD_CONVING status so that they can be picked up by ARTJESCONV for conversion or ARTJESINITIATOR for running. The options are as follows:
-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
If no option is specified, the "-a" option is assumed.
canceljob(cj) -n job name |-j jobid | -c job_class l -a
Cancels a job and moves it to the output queue. For running jobs, this command informs the related ARTJESINITIATOR to invoke EJR with "-k" option. Other jobs are moved directly to the output queue. The TuxJES system assumes the job is terminated when EJR returns. The options are as follows:
-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
If no option is specified, the "-a" option is assumed.
purgejob(pgj) -n job name |-j jobid | -c job class | -s job status | -a
Completed jobs in the output queue 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. If ARTJESPURGE is not started, the job remains in the output queue.
The options are as follows:
-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
If no option is specified, the "-a" option is assumed.
changeconcurrent(chco) -g groupname -i serverid -n concurrent_num
Changes the number of maximum concurrent executing jobs for the ARTJESINITIATOR server which is designated by the -g and -i options. The change takes effect with no need to restart the ARTJESINITIATOR server.
The options are as follows:
-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
The change is not persistent, which means the number is reset when the ARTJESINITIATOR server restarts.
printconcurrent(pco) -g groupname -i serverid
Displays the number of maximum concurrent executing jobs for the ARTJESINITIATOR server which is designated by -g and -i options.
The options are as follows:
-g groupname: the Tuxedo group name of the ARTJESINITIATOR server
-i serverid: the Tuxedo server id of the ARTJESINITIATOR server
event (et) [-t C,E,P,L,A] on|off
This command tells artjesadmin to subscribe particular job event. The options are:
C: job conversion complete event; the event name is ARTJES_JOBCVT
E: job execution finish event; the event name is ARTJES_JOBEXEC
P: job purge event; the event name is ARTJES_ARTJESPURGE
L: job cancel completed event; the event name is ARTJES_JOBCANCEL
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. "off" will unsubscribe all event subscriptions.
If the subscribed event type is not configured in JESCONFIG, an error is reported.
verbose(v) on|off
Turn on /off verbose mode.
See Also
Oracle Tuxedo Application Runtime for Batch User Guide
artjescleanlock
Name
artjescleanlock – The utility to clean stale lock records in lock files in MP mode.
Synopsis
artjescleanlock -c [-y] [-h <hostname>] [-f <filefullpath>]
artjescleanlock -l [-h <hostname>] [-f <filefullpath>]
Description
Artjescleanlock, based on the filter criteria specified by its options, is used to list or clean lock records in lock files. Before running this utility, environment variable MT_ACC_FILEPATH must be set properly.
Parameters and Options
artjescleanlock supports following options:
-l
Specifies the users want to just list or display the lock records matching the specified filter criteria.
-c
Specifies the users want to clean the lock records matching the specified filter criteria.
Note:
One and only one of “-l” and “-c” must be set; they are exclusive to each other.
[ -h hostname ]
Optional: It specifies a hostname as the filter criteria. Only lock records matching such hostname are impacted.
[ -f filename ]
Optional: It specifies a filename as the filter criteria. Only lock records matching this filename are impacted.
Note:
[-y]
Optional: It specifies whether the users want to forcibly clean the lock records without confirmation. Without “-y”, the utility will ask for users’ confirmation before cleaning. This option can only be used with “-c”.
ARTJESADM
Name
ARTJESADM – TuxJES Administration server.
Synopsis
ARTJESADM
SRVGRP=”identifier
SRVID=”number” CLOPT=” [-A][servopts options] -- -i JESCONFIG
Description
ARTJESADM is an Oracle Tuxedo application server provided by TuxJES. The artjesadmin command communicates with ARTJESADM for most tasks.
ARTJESADM must be configured in the UBBCONFIG file in front of other TuxJES servers since others they access services provided by ARTJESADM. If JESCONFIG is changed, all TuxJES related servers must be restarted for new configurations to take effect.
Parameters and Options
ARTJESADM supports the following parameters and options:
-i JESCONFIG
JESCONFIG represents the full path name of the TuxJES system configuration file. It allows the following parameters:
JESROOT
The full path name of the root directory to store job information. It is a mandatory attribute. If this directory does not exist, ARTJESADM creates it automatically.
JESROOT=/xxx/xxx
DEFAULTJOBCLASS
The default job class if the job class is not set for a job. It is an optional attribute. The default job class is A if this attribute is not set.
DEFAULTJOBCLASS=[A-Z],[0=9]
DEFAULTJOBPRIORITY
The default job priority if the job priority is not set for a job. It is an optional attribute. The default job priority is 0 if this attribute is not set.
DEFAULTJOBPRIORITY=[0-15]
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.
EVENTPOST=S,C,E,P,L,A
Specifies whether events are posted for a job at particular stages.
S: Job submission event. Event name: ARTJES_JOBSUBMIT
C: Job conversion complete event. Event name: ARTJES_JOBCVT
E: Job execution finish event. Event name: ARTJES_JOBFINISH
P: Job purge event. Event name: ARTJES_JOBPURGE
L: Job cancel completed event. Event Name: ARTJES_JOBCANCEL
A: All supported events.
If EVENTPOST is not specified, no events are posted. The data buffer with event pos is FML32 type and the fields are defined in JESDIR/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.
Because the JESCONFIG file and JES_ACL_FILE file are based on TuxJES security mechanism, it's important to well protect these two files at the very beginning. It is strongly recommended that read/write permissions for these two files should be granted to only the user who is responsible for booting the whole TuxJES domain (normally it is the root account).
JES_ACL_FILE_TYPE
The format of JES_ACL_FILE file. It can be set as PLAIN or ENCRYPTED (case insensitive). PLAIN means JES_ACL_FILE file is plain while ENCRYPTED means this file is encrypted. The encrypted file can be generated by genjesacl tool. 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 or DAC. MAC (Mandatory Access Control) means all operations are denied if no matching rule is found while DAC (Discretionary Access Control) means all operations are allowed if no matching rule is found. MAC is the default value. If JES_ACL_MODE is configured to invalid values, server ARTJESADM cannot boot up.
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 ( For more information, see JuxJES User Substitution in Oracle Tuxedo Application Runtime for Batch Reference Guide). 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.
It is recommended that the owner of user mapping file is root and the file permission is "-rw-------".
One Oracle Tuxedo user must be mapped to one OS user only, and it is recommended that one OS user is mapped to one Tuxedo user as well.
USE_DB
Enable to use Database to store job management data. Values could be:
ORACLE: Use Oracle Database to store job management data.
DB2: Use DB2 as storage to store job information. This is currently not supported.
NOT SET: Use /Q to store job information.
Example(s)
UBBCONFIG example:
ARTJESADM
SRVID=1 SRVGRP=SYSGRP CLOPT="-A -- -i /nfs/users/jes/jesconfig"
See Also
Oracle Tuxedo Application Runtime for Batch User Guide
ARTJESCONV
Name
ARTJESCONV – TuxJES conversion server.
Synopsis
ARTJESCONV
SRVGRP=”identifier
SRVID=”number” CLOPT=” [-A][servopts options] -- ”
Description
The TuxJES conversion server. It is responsible for invoking the EJR to do the job conversion.
Example(s)
UBBCONFIG example:
ARTJESCONV
SRVID=2 SRVGRP=SYSGRP CLOPT="-A -- "
See Also
Oracle Tuxedo Application Runtime for Batch User Guide
ARTJESINITIATOR
Name
ARTJESINITIATOR – Job Initiator
Synopsis
ARTJESINITIATOR
SRVGRP=”identifier
SRVID=”number” CLOPT=” [-A][servopts options] -- -C jobclasses [-n concurrent_num] [-d]”
Description
ARTJESINITIATOR is an Oracle Tuxedo application server provided the TuxJES. It is responsible for invoking the EJR to execute the jobs.
Once a ARTJESINITIATOR is killed or shutdown while it has job running, it will put the job in the INDOUBT state when it is restarted.
Parameters and Options
ARTJESINITIATOR supports the following parameters and options:
-c jobclasses[jobclass]
Specifies the job classes this ARTJESINITIATOR server is associated. If this option is not specified, ARTJESINITIATOR associates with all job classes.
-n concurrent_num
Specifies the number of maximum concurrent executing jobs for this ARTJESINITIATOR server. The default value is 1.
-d
Specifies the number of maximum concurrent executing jobs for this ARTJESINITIATOR server can be change by artjesadmin changeconcurrent command.
Example(s)
UBBCONFIG example:
ARTJESINITIATOR
SRVID=3 SRVGRP=SYSGRP MIN=10 CLOPT="-A -- -c AHZ"
In this example, ten ARTJESINITIATOR instances are configured and are associated with the "A","H" and "Z" job classes.
See Also
Oracle Tuxedo Application Runtime for Batch User Guide
ARTJESPURGE
Name
ARTJESPURGE – Purges job queue
Synopsis
ARTJESPURGE
SRVGRP=”identifier
SRVID=”number” CLOPT=” [-A][servopts options] -- ”
Description
ARTJESPURGE monitors the purge queue. If it finds a job in the purge queue, it removes the job in the queue and deletes the directory JESROOT/<JOBID>.
See Also
Oracle Tuxedo Application Runtime for Batch User Guide
TuxJES Queue System
In order to emulate the z/OS JES2 system, TuxJES system uses a queue mechanism for batch job life cycle management. All queues are created in one queue space called "JES2QSPACE". A batch job is represented by a message that resides and is transferred to queues listed in Table 7.
 
Table 7 TuxJES Queues
When a batch job is submitted to the TuxJES system, it is put in the conversion queue first. There is only one conversion queue in the system. A converted job is moved from the "conversion queue" to the "execution queue". The jobs in the queue are processed in FIFO order.
This queue is necessary if NJESUPPORT is enabled in jesconfig file. This queue maintains the mapping of each job and its execution group when the job is in the Execution Queue.
The TuxJES Queue Creation Script
The TuxJES system provides a sample shell script (jesqinit) to create the queue space (JES2QSPACE) and the queues listed in Table 7. You can modify the script to adapt to your environment, but must adhere to the following:
1.
2.
3.
Recommended /Q Creation Values
Device Size of Pages: 10000
Queue Space Size of Pages: 5000 (We assume the max number of jobs is 10000, each job will consume 2k bytes and the page size is 4k)
Number of Messages in Queue: 10000
Number of Concurrent Transactions: 1000
Number of Concurrent processes in queue: 100
Recommended queue space size: 4K x (number of jobs per day) x (days jobs stay in JES queues before being auto purged)
Note:
TuxJES User Substitution
JES supports defining the specific OS user to execute jobs. With the Tuxedo User-OS User mapping mechanism, JES system is able to associate the Tuxedo AAA credential adhering to a job with an OS user who has the limited permission to access resources when operating a job.
Terms
Table 8 lists the terms you need to know for a good understanding of the user substitution feature described in this section.
 
Job Owner Designation in Different Scenarios
The Job owner designated by JES system depends on the combination of configurations on artjesadmin and PRIVILEGE_MODE. Table 9 shows the relation between job owner designation and different configuration scenarios.
 
When artjesadmin is executed with...
When PRIVILEGE_MODE is set to...
USER_IDENTICAL or USER_MAPPING
Note:
Oracle Tuxedo SECURITY parameter must be set to USER_AUTH, ACL or MANDATORY_ACL, otherwise JES system fails to start up and the following error message is printed into ULOG: "ERROR: The current Tuxedo security level disallow the given privilege mode".
USER_IDENTICAL or USER_MAPPING
artjesadmin fails to login and the following error message is displayed: "ERROR: failed to join application."
Permissions of Job Operations
Table 10 and Table 11 show the permissions of users with different identities when operating jobs in TuxJES system enabling the user substitution.
 
 
Enabling User Substitution in TuxJES
To enable the user substitution in TuxJES, the following operations should be done:
Configuring JESCONFIG in TuxJES
The value of PRIVILEGE_MODE in JESCONFIG should be specified to MAPPING_CREDENTIAL or IDENTITY_CREDENTIAL.
If the value of PRIVILEGE_MODE in JESCONFIG is MAPPING_CREDENTIAL, the value of USER_MAPPING_FILE should be specified and the user mapping file should contain the mapping between Oracle Tuxedo users and OS users.
Booting Up JES System by Root User
When JES is working in SHM mode, it should be booted up by root user.
When JES is working in MP mode, do one of the following:
Execute tmboot by root when JES system is running on the master machine of a MP domain.
Execute tlisten by root when JES system is running on a slave machine of a MP environment.
It is recommended that all machines involved in a JES system use the same NIS system.
Configuring Tuxedo UBBCONFIG
All job users should have full permissions to IPC resource of the JES system.
The SECURITY parameter in RESOURCE section of TUXCONFIG should be USER_AUTH, ACL or MANDATORY_ACL.
Note:
If SECURITY parameter is set to APP_PW and AUTHSVC parameter is configured, the SECURITY level is regarded as USER_AUTH by Oracle Tuxedo.
Here is an example of UBBCONFIG:
Listing 8 Oracle Tuxedo UBBCONFIG File Example When Enabling User Substitution in TuxJES System
# (c) 2011 Oracle. All Rights Reserved.
#
*RESOURCES
IPCKEY <IPCKEY> # for example 132770
DOMAINID jessample
MASTER SITE1
MODEL SHM
MAXACCESSERS 200
MAXSERVERS 50
NOTIFY SIGNAL
PERM 0666 #Adding "PERM=0666" in RESOURCES section
SECURITY USER_AUTH
AUTHSVC "AUTHSVC"
 
*MACHINES
#
<uname -n>
LMID = SITE1
TUXDIR ="<full path of TUXEDO software>"
TUXCONFIG = "<full path of APPDIR>/tuxconfig"
TLOGDEVICE ="<full path of APPDIR>/TLOG"
TLOGSIZE=10
APPDIR = "<full path of APPDIR>"
ULOGPFX = "<full path of APPDIR>/ULOG"
 
*GROUPS
 
ARTGRP
LMID = SITE1 GRPNO = 1
QUEGRP
LMID = SITE1 GRPNO = 2
TMSNAME = TMS_QM TMSCOUNT = 2
OPENINFO = "TUXEDO/QM:<full path of APPDIR>/QUE:JES2QSPACE"
 
EVTGRP
LMID= SITE1 GRPNO=3
 
#
*SERVERS
# Adding RQPERM=0666 RPPERM=0666 in all JES servers entry in SERVERS section
DEFAULT: CLOPT="-A"
 
TMUSREVT SRVGRP=EVTGRP SRVID=1 CLOPT="-A"
RQPERM=0666 RPPERM=0666
 
TMQUEUE
SRVGRP = QUEGRP SRVID = 1
GRACE = 0 RESTART = Y CONV = N MAXGEN=10
CLOPT = "-s JES2QSPACE:TMQUEUE -- -t 5 "
RQPERM=0666 RPPERM=0666
 
ARTJESADM SRVGRP =ARTGRP SRVID = 1 MIN=1 MAX=1
CLOPT = "-A -- -i jesconfig"
RQPERM=0666 RPPERM=0666
 
ARTJESCONV SRVGRP =ARTGRP SRVID = 20 MIN=1 MAX=1
CLOPT = "-A --"
RQPERM=0666 RPPERM=0666
 
ARTJESINITIATOR SRVGRP =ARTGRP SRVID =30
CLOPT = "-A -- -n 20 -d"
RQPERM=0666 RPPERM=0666
 
ARTJESPURGE SRVGRP =ARTGRP SRVID = 100
CLOPT = "-A --"
 
AUTHSVR SRVGRP=ARTGRP SRVID=104 CLOPT="-A"
RQPERM=0666 RPPERM=0666
 
*SERVICES
 
Configuring File System Permission
To enable the user substitution successfully, you need to make sure the permission of the file system for users with different identities have been configured to meet the following requirements:
Note:
It is recommended that all job executors have the write permission to ULOG, stdout, and stderr, otherwise the log and output messages cannot be written successfully.
TuxJES Trace Message Control
TuxJES trace messages are stored in TuxJES trace file. By default, TuxJES trace file is stored in ${APPDIR}/Logs directory; before running Batch Runtime, you can change the directory by setting the environment variable JES_TRACE_PATH.
There are four TuxJES trace messages levels: ERROR, WARN, INFO, and DEBUG. WARN is used by default. 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.
For more information, see Tracing TuxJES in Oracle Tuxedo Application Runtime for Batch User Guide and artjesadmin in Oracle Tuxedo Application Runtime for Batch Reference Guide.
TuxJES Job Operation
TuxJES supports a standard job operation interface. A set of FML32 fields are defined for the service contract. The utility artjesadmin shipped in TuxJES uses typical Tuxedo ATMI APIs (See Oracle Tuxedo API: ATMI for more details) to submit,, control, and print job information. Customers are also supported to write personalized applications, which communicate with TuxJES job management system. This documentation explains the general steps and programming approaches.
FML32 Fields in Use for TuxJES Job Operation
All TuxJES job related fields are defined at $JESDIR/udataobj/jesflds. The corresponding header file is at $JESDIR/include/jesflds.h. Table 12 illustrates the fields used in job operation.
 
It carries error information for particular jobs. Unlike JES2_JOB_ERROR, JES2_JOB_MSG carries general failure information.
To use the above fields, you must include header file $JESDIR/include/jesflds.h in your source code, and use Tuxedo FML32 APIs to manipulate the FML32 buffer of input and output. For more information, please refer to Programming An Oracle Tuxedo ATMI Application Using FML.
ATMI Services in Use for TuxJES Job Operation
ARTJESADM server provides the following ATMI services as the job handling entries. Client programs can call these services using standard ATMI APIs, such as tpcall with FML32 buffer, in which the fields are prepared or retrieved for input and output.
JES2SUBMIT
This service provides the functionality to submit a job.
Input
Required Fields
JES2_JOB_SCRIPT
Optional Fields
JES2_JOB_OWNER
Note:
If JES2_JOB_OWNER is not specified, this job is deemed to "*" user, meaning no ownership of this job.
Output
Success
Output buffer will contain the following fields.
Failure
If the submission fails, JES2_JOB_ERROR carries the error message and tperrno is set to TPESVCFAIL.
JES2PRINT
This service is used to query job information. The interface allows you to get a particular job with job ID, a set of jobs with the same job name and job class, or all jobs. If multiple job instances are got in the results, they will be in FML32 occurrence style, in which occurrence starts at 0. For example, if three jobs are returned, the first job will be at occurrence of 0, the second job will be at 1, and the third job will be at 2.
Input
Required Fields
None. If nothing specified, the server will print all jobs.
Optional Fields
JES2_JOB_ID (if it is specified, only this job will be retrieved)
JES2_JOB_NAME (if it is specified, only the jobs of this name will be retrieved)
JES2_JOB_CLASS (if it is specified, only the jobs of this class will be retrieved)
Note:
ARTJESADM checks fields in the sequence of job ID, name, and class; once a field is checked, ARTJESADM stops checking.
Output
Success
If the retrieving is completed successfully, the following fields will be returned.
Notes:
JES2_JOB_ID is mandatory to use; others are optional.
It's suggested to use the occurrence of JES2_JOB_ID as the field manipulation base.
If there is something wrong with a particular job, JES2_JOB_MSG will be available in the corresponding sequence specified by JES2_JOB_ID. For partially wrong cases, tperrno will be TPOK.
Failure
If a general operation is failed, JES2_JOB_ERROR carries the error message and tperrno is set to TPESVCFAIL.
JES2HOLD
This service is used to hold a job not in running nor end status. The interface of job collection is the same with JES2PRINT.
Input
Required Fields
None. If nothing specified, the server will hold all jobs.
Optional Fields
JES2_JOB_ID (if it is specified, only this job will be held)
JES2_JOB_NAME (if it is specified, only the jobs of this name will be held)
JES2_JOB_CLASS (if it is specified, only the jobs of this class will be held)
Note:
ARTJESADM checks fields in the sequence of job ID, name, and class; once a field is checked, ARTJESADM stops checking.
Output
Success
If the operation is completed successfully, the following fields will be returned.
Note:
If there is something wrong with a particular job, JES2_JOB_MSG will be available in the corresponding sequence specified by JES2_JOB_ID. For partially wrong cases, tperrno will be TPOK.
Failure
If a general operation is failed, the JES2_JOB_ERROR carries the error message and tperrno is set to TPESVCFAIL.
JES2RELEASE
This service is used to release a job in hold status. The job can be in hold status by a hold operation, submitting time typerun. The interface of job collection is the same with JES2PRINT.
Input
Required Fields
None. If nothing specified, the server will release all jobs.
Optional Fields
JES2_JOB_ID (if it is specified, only this job will be released)
JES2_JOB_NAME (if it is specified, only the jobs of this name will be released)
JES2_JOB_CLASS (if it is specified, only the jobs of this class will be released)
Note:
ARTJESADM checks fields in the sequence of job ID, name, and class; once a field is checked, ARTJESADM stops checking.
Output
Success
If the operation is completed successfully, the following fields will be returned.
Note:
If there is something wrong with a particular job, JES2_JOB_MSG will be available in the corresponding sequence specified by JES2_JOB_ID. For partially wrong cases, tperrno will be TPOK.
Failure
If a general operation is failed, JES2_JOB_ERROR carries the error message and tperrno is set to TPESVCFAIL.
JES2CANCEL
This service is used to cancel a job. The interface of job collection is the same with JES2PRINT.
Input
Required Fields
None. If nothing specified, the server will cancel all jobs.
Optional Fields
JES2_JOB_ID (if it is specified, only this job will be canceled)
JES2_JOB_NAME (if it is specified, only the jobs of this name will be canceled)
JES2_JOB_CLASS (if it is specified, only the jobs of this class will be canceled)
Note:
ARTJESADM checks fields in the sequence of job ID, name, and class; once a field is checked, ARTJESADM stops checking.
Output
Success
If the operation is completed successfully, the following fields will be returned.
Note:
If there is something wrong with a particular job, JES2_JOB_MSG will be available in the corresponding sequence specified by JES2_JOB_ID. For partially wrong cases, tperrno will be TPOK.
Failure
If a general operation failed, JES2_JOB_ERROR carries the error message and tperrno is set to TPESVCFAIL.
JES2PURGE
This service is used to purge a job. If a job is not finished yet, the effect is the same with JES2CANCEL. The interface of job collection is the same with JES2PRINT.
Input
Required Fields
None. If nothing specified, the server will purge all jobs.
Optional Fields
JES2_JOB_ID (if it is specified, only this job will be purged)
JES2_JOB_NAME (if it is specified, only the jobs of this name will be purged)
JES2_JOB_CLASS (if it is specified, only the jobs of this class will be purged)
Note:
ARTJESADM checks fields in the sequence of job ID, name, and class; once a field is checked, ARTJESADM stops checking.
Output
Success
If the operation is completed successfully, the following fields will be returned.
Note:
If there is something wrong with a particular job, JES2_JOB_MSG will be available in the corresponding sequence specified by JES2_JOB_ID. For partially wrong cases, tperrno will be TPOK.
Failure
If a general operation is failed, JES2_JOB_ERROR carries the error message and tperrno is set to TPESVCFAIL.
Event Subscriptions for Job Status Changes
TuxJES provides an event notification mechanism based on Tuxedo EventBroker (See Subscribing to Events for more details). The following user-level events are provided when something happens at each stage. The data buffer of each event is FML32 buffer for a particular job.
 
Since the event post depends on JESCONFIG configurations in ARTJESADM, the switch must be turned on if all or some event want to.
Security Consideration
The application using the job management service interface must be compliant to Tuxedo ATMI security convention (see Introducing ATMI Security for more details). The proper application password and username/password must be prepared for tpinit() in a client application. To control the permission of services, adequate ACL or MANDATORY ACL should be configured in UBBCONFIG for the services listed in ATMI Services in Use for TuxJES Job Operation.
Sample of Submitting a Job
The following sample demonstrates how to submit a job. -I $JESDIR/include must include CFLAGS.
Listing 9 Sample of submitting a job
#include <stdio.h>
#include <tpadm.h>
#include <fml32.h>
#include <jesflds.h>
 
main(int argc, char *argv[])
{
FBFR32 *input;
FBFR32 *output;
long buflen;
 
if (tpinit((TPINIT *) NULL) == -1) {
(void)fprintf(stderr, "Tpinit failed: %s\n", tpstrerror(tperrno));
exit(1);
}
 
input = tpalloc("FML32",NULL,1024);
output = tpalloc("FML32",NULL,1024);
 
if (input == NULL || output == NULL) {
(void)fprintf(stderr, "Tpinit failed: %s\n", tpstrerror(tperrno));
exit(1);
}
if (Fappend32(input,JES2_JOB_SCRIPT, "JOBA", 0) < 0 ) {
(void)fprintf(stderr, " Fappend32 failed: \n");
exit(1);
}
Findex32(input,0);
if (tpcall("JES2SUBMIT", input, 0, &output,&buflen,0) < 0 ) {
(void) fprintf(stderr, "Can't send request to service JES2SUBMIT");
exit(1);
}else {
char *jobid;
jobid = Ffind32(output,JES2_JOB_ID,0,NULL);
if (jobid != NULL) {
fprintf(stdout,"Job %s is submitted\n",jobid);
}
}
tpfree(input);
tpfree(output);
(void)tpterm();
return(0);
}
 
 

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