0% found this document useful (1 vote)
1K views

TWS Commands Part1

TWS Commands

Uploaded by

Guru Prasad
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
1K views

TWS Commands Part1

TWS Commands

Uploaded by

Guru Prasad
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 61

TWS Commands

Clint Easterling
TWS L2 Support

2009 IBM Corporation


IBM Software Group

Agenda
Overview of Composer commands
Overview of Conman Commands
Useful tips
DB2
WebSphere utilities

2
IBM Software Group

TDWC vs. Command Line Terms


Workload Designer = Composer (database)
Workload submit/monitor = Conman (plan)
Job Stream = Schedule
Job, Job Definition = Job
Workstation = CPU, Workstation
Workstation Class = Workstation Class
Domain = Domain
Earliest Start = AT
Latest Start = UNTIL
Deadline = DEADLINE
Time Zone = TZ
Predecessor dependency = FOLLOWS
File dependency = OPENS
Prompt dependency = PROMPT #
Resource dependency = NEEDS
* wildcard = @ wildcard

3
IBM Software Group

Scheduling Object Key Words


Long Keyword Short Keyword
calendar = cal
domain = dom
eventrule = erule, er
jobdefinition = jd
jobstream = js
parameter = parm
prompt = prom
resource = res
user = user
workstationclass = wscl

4
IBM Software Group

Composer Commands
Command Short Name Function
Add a Add scheduling object from a file
Authenticate au Change User credentials
Continue Ignore the next error
Create/extract cr/ex Create text file from database object file
Delete de Delete scheduling object
Display d Display details of scheduling object
edit ed Edits file
Exit e Exit Composer
Help h Displays Help command
List l Displays list of database
lock Locks access to database object

5
IBM Software Group

Composer commands contunied


Command Short Name Function
modify m Modify scheduling objects
new n Add new object via online editing
print Print scheduling objects
redo Edit and rerun the previous command
rename rn Change the object name
replace rn Replace scheduling objects
unlock Release a scheduling object lock in the db
validate val Validate object definitions in a user file
version v Displays the Composer program banner
Systems Invoke operating system commands
commands

6
IBM Software Group

Composer help command


# composer help commands
COMPOSER COMMANDS
ADD Adds or updates object definitions in the database.
AUTHENTICATE Switches to another user ID while running composer.
CONTINUE Specifies that the next command error is to be ignored.
CREATE Synonym for "extract"
DELETE Deletes object definitions in the database.
DISPLAY Displays object definitions.
EDIT Edits a file.
EXIT Exits composer.
EXTRACT Creates a text file containing object definitions
extracted from the database.
HELP Displays a list of commands or help on specific commands.
LIST Lists summary information on database objects.
LOCK Locks the access to object definitions in the database.
MODIFY Modifies object definitions in the database.
NEW Adds new object definitions to the database.
PRINT Prints summary information on database objects.
REDO Edits and reruns the previous command.
RENAME Renames existing object definitions in the database.
REPLACE Replaces object definitions.
SYSTEM COMMAND Runs a system command.
UNLOCK Unlocks the access to object definitions in the database.
VALIDATE Validates object definitions.
VERSION Display the composer program banner.

Other help topics:

COMMANDS List of composer commands.


INTCHECK Describes the automatic integrity checks performed when
you run a command that modifies an object in the database.

7
IBM Software Group

How to use composer help


Example:
#composer
-help command Arguments
- Help lock
LOCK calendars Locks all calendar definitions.

Locks the access to scheduling objects definitions in the


calendar|cal Locks calendar definitions.
database.

calname The name of the calendar.


Authorization
Wildcard characters are permitted.

You must have modify access to the object.


parms Locks all parameter definitions.
Syntax
parm Locks parameter definitions.

lock
{[calendars | {calendar | cal}=calname] | parmname The name of the parameter.
[parms | [parm=parmname]] | Wildcard characters are permitted.
[prompts | [prom=promptname]] |
[resources | {resource | res}=resourcename] | prompts Locks all prompt definitions.
[[cpu={workstationame | workstationclassname | domainame}] |
[{workstation | ws}=workstationame] | prom Locks prompt definitions.
[{workstationclass | wscl}=workstationclassname] |
[{domain | dom}=domainame]] |
promptname The name of the prompt.
[{jobs | jobdefinition | jd}=[workstationame#]jobname] |
Wildcard characters are permitted.
[{sched|jobstream|js}= [workstationame#]jstreamname [valid from date|
valid to date |valid in date date] [full]] |
[{users | user}=[workstationame#]username] | resources Locks all resource definitions.
[{eventrule | erule | er}=eventrulename]}

8
IBM Software Group

Composer help command example continued


Comments If no value is assigned to TWS_SESSION, then the default value
identifying the session is set as follows:
Objects are locked to make sure that definitions in the database * If using composer in batch mode, the default value is the
are not overwritten by different users accessing concurrently to username used by the user when connecting to the master domain
the same objects. manager.
* If using composer in interactive mode, the default value
With this command the user explicitly acquires locks of database corresponds to an alphanumeric string automatically created by
objects. When one user has an object locked, any other user has the product.
read only access until the object is released or explicitly
unlocked by the administrator. If one user tries to lock an object Note: In the database the username of the user locking an object
that is already locked by someone else (other user), an error definition is saved in uppercase.
message is returned.
Examples
Locks on database objects are acquired by the user using username
and session, where session is a string that can be set in the To lock calendar named Holiday run the command:
environment variable TWS_SESSION identifying that specific user
work session. lock calendar=HOLIDAYS

This means that, on a machine, the TWS_SESSION identifier is See also


different for:
* a user connected in two different shells to the composer For the equivalent Job Scheduling Console task, see "Managing
command line program. database objects" in the IBM Tivoli Workload Scheduler Job
* a user connected, disconnected and then connected again to the Scheduling Console User's Guide. Event rule management is not
composer command line from the same shell. available form the Job Scheduling Console.

9
IBM Software Group

Conman Commands
Command Short Name Function
adddep job adj Add a dependency to a job
adddep sched ads Add a dependency to a job stream
altpass altpass Change a windows user password
altpri ap Alter the priority of job or job stream
cancel job cj Cancel a job
cancel sched cs Cancel a job stream
confirm confirm Confirm the state of a job
console cons Exit Composer
deldep job ddj Delete a dependency on a job
deldep sched dds Delete a dependency on a job stream
exit Exit the conman interface
fence fence Adjust the fence on a workstation

10
IBM Software Group

Conman Commands continued


Command Short Name Function
kill kill Kill a job that is in EXEC state
limit cpu lc Set the workstation limit
limit sched ls Set the limit on a job stream
link link Link a workstation/workstations to the MDM
release job rj Release dependencies on a job
release sched rs Release dependencies on a job stream
reply reply Reply to prompts
rerun rr Rerun a job (can also rerun FROM)
showcpus sc Shows a list of workstations in the env
showjobs sj Shows a list of jobs
showpropmts sp Shows a list of prompts
showsresources sr Shows a list of resources

11
IBM Software Group

Conman Commands continued


Command Short Name Function
showschedules ss Shows a list of schedules
shutdown shut Used to stop all of the TWS services
start start Used to start most of the TWS services
startappserver startapp Starts the TWS appserver
startevtp startevtp Starts the TWS event processor
startmon startmon Starts the TWS even monitoring service
status status Shows the current status of the appserver
stop stop Stops most of the TWS services (also;
progressive)
stopappserver stopapp Stops the TWS appserver
stopevtp stopevtp Stops the TWS event processor
stopmon stopmon Stops the TWS event monitoring service
submit sbd Submits a command to a system (submit batch
docommand do)

12
IBM Software Group

Conman Commands continued


Command Short Name Function
submit job sbj Submit a defined job to a system
submit sched sbs Submits a defined job stream to a system
switchevtp switchevtp Moves the event processor to another system
switchmgr switchmgr Moves a Manager to a Backup Manager
unlink unlink Unlinks a workstation/workstations from a DM

13
IBM Software Group

Conman Help commands


#conman
%help commands
Command Description
=================== ================================================
ADDDEP Adds dependencies to a job or job stream.
ALTPASS Alters the password of a user object in the current production plan.
ALTPRI Alters the priority of a job or job stream.
BULK_DISCOVERY Performs a bulk discovery. For use with IBM Tivoli Monitoring 6.1 (Tivoli Enterprise Portal).
CANCEL Cancels a job or job stream.
CONFIRM Confirms job completion.
CONSOLE Assigns the scheduler console and sets the message level.
CONTINUE Ignores the next command error.
DELDEP Deletes dependencies from a job or job stream.
DEPLOYCONF Gets the latest monitoring configuration for the event monitoring engine on the workstation.
DISPLAY Displays a job, file, or job stream definition.
EXIT Exits the conman command line program.
FENCE Changes the job fence on a workstation.
HELP Displays help information about commands.
KILL Stops a job that is running.
LIMIT Changes the limit of jobs that can run simultaneously on a workstation.
LINK Opens communication links between workstations.
LISTSYM Lists the production plan (Symphony files)

14
IBM Software Group

Conman help example


#conman
-help showcpus
SHOWCPUS Displays information about workstations and links.

You must have list access to the object being shown if the
enListSecChk option was set to yes on the master domain manager
when the production plan was created or extended.

Syntax

sc [[domain!]workstation]
[;info|;link]
[;offline]

sc [[domain!]workstation]
[;getmon]

15
IBM Software Group

Conman help example continued.


Examples

1. To display information about the workstation on which you are running conman in the info format, run the following command:
showcpus ;info

a sample output for this command is:


CPUID VERSION TIME ZONE INFO
MASTER 8.4 US/Pacific Linux 2.6.5-7.191-s390#1 SM
FTA1 8.4 Linux 2.4.9-e.24 #1 Tue May
FTA2 8.4 HP-UX B.11.11 U 9000/785

2. To display link information for all workstations, run the following command:
sc @!@;link

a sample output is the following:


CPUID HOST FLAGS ADDR NODE
MASTER MASTER AF T 51099 9.132.239.65
FTA1 FTA1 AF T 51000 CPU235019
FTA2 FTA2 AF T 51000 9.132.235.42

3. To display information about the workstation, run the following command:


showcpus

If you run this command in an environment when the primary


connection of the workstation with its domain or upper manager
is not active, you receive the following output:

CPUID RUN NODE LIMIT FENCE DATE TIME STATE METHOD DOMAIN
MASTER 360 *WNT MASTER 10 0 06/04/2007 1348 I J E

16
IBM Software Group

TWS commands
$ conman

%sc;l
CPUID HOST FLAGS ADDR NODE
PHOENIX PHOENIX AF T 31111 phoenix
PHOENIX+ PHOENIX A T 41114 localhost
SEDONA SEDONA A T 38511 phoenix.tivlab.austin.ibm.com
%sc
CPUID RUN NODE LIMIT FENCE DATE TIME STATE METHOD DOMAI
N
PHOENIX 5 *UNIX MASTER 10 0 04/12/10 08:28 I J MDEA MASTERDM
PHOENIX+ 5 OTHR BROKER 10 0 04/12/10 08:28 LTI JW MASTERDM
SEDONA 5 UNIX FTA 10 0 04/12/10 08:28 LTI JW MD MASTERDM

17

TWS Best Practices

2009 IBM Corporation


IBM Software Group

TWS stop and start procedures pre and post reboot.

To stop TWS and WebSphere correctly take the following steps:

Stop the WebSphere application server:


cd <TWSHome>
. ./tws_env.sh
conman "stopappserver; wait"

Stop the TWS engine and all of the TWS processes that support the engine:
cd <TWSHome>
. ./tws_env.sh
conman "stop;wait"
conman "shut;wait"

Stop DB2 \\ If you're using db2 and the server is local to the MDM host:
Stopping an instance (Linux, UNIX):
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?
topic=/com.ibm.db2.udb.admin.doc/doc/t0004897.htm

19
IBM Software Group

TWS stop and start procedures pre and post reboot.


After reboot:
Start DB2:
Starting a DB2 instance (Linux, UNIX):
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/t0004676.htm

Start WebSphere:
cd <TWSHome>
conman "startappserver;wait"

Start TWS:
cd <TWSHome>
./StartUp
conman "start"

*Note: There is a common misunderstanding with stopping the WebSphere


application server related to the appservman process
http://www-01.ibm.com/support/docview.wss?uid=swg21406241

To understand the appservman process go here:


http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1/index.jsp?topic=/com.ibm.tivoli.itws.doc_8.5.1/appserverman.htm

20
IBM Software Group

Managing TWS and full filesystems

The most frequent failure of TWS due to filespace issues occurs at


JnextPlan. However, filespace can affect TWS at any point during
production. It is recommended that filespace be monitored frequently to
avoid corruption of the production control (Symphony) file and any
other problems which may occur.

http://www-01.ibm.com/support/docview.wss?uid=swg21115012

21
IBM Software Group

TWS and full filesystem


The following lists some places to clear space should this problem occur (and also see the Technote
entitled "TWS directories need periodic maintenance " in the "Related information" section below:
1. ~twshome/schedlog directory holds previous symphony files. If regular backups are run of the TWS
directories, there should be no need for this directory to hold more than 30 day's of previous
symphony files.
2. ~twshome/stdlist directories hold previous day's standardlists. Again, if regular backups occur,
there should be no need to retain more than 30 days previous stdlist directories.
3. ~twshome/audit directories. The audit logs can become quite large, depending upon the size of the
TWS environment. These logs can be regularly maintained.
4. ~unisonhome/netman/stdlist directories (Windows only). The Netman directories can be regularly
maintained.
5. ~twshome /home/m84/appserver/logs/manageprofiles/twsprofile. These logs can be regularly
maintained.
6. ~twshome/appserver/profiles/twsprofile/logs.
7. ~twshome//appserver/profiles/twsprofile/logs/server1

22
IBM Software Group

Utility to calculate disk space


calculate_disk_usage.sh
UNIX script that monitors available disk space for TWS filesystem and
sends notification when available disk space drops below defined
threshold. TWS does not have a feature to self monitor the TWS
filesystem. Monitoring of disk space prevents filling up of TWS
filesystem and causing TWS processes to terminate, compromising the
production file and preventing production downtime. This function was
added to mon_msg.sh utility.

Technote: 1306331
http://www-01.ibm.com/support/docview.wss?uid=swg21306331

23
IBM Software Group

Utility to monitor available space


mon_avail_space
The mon_avail_space.sh is used to monitor filesystem available disk
space. The script uses a user specified variable that specifies the
available space threshold limit of filesystem. When available disk
space for filesystem drops below threshold limit, script will send a
notification stating that available disk space is below the defined
threshold limit and suggests increasing available disk space for
filesystem otherwise operations may be compromised. The script will
determine the filesystem to monitor if the directory name is specified
instead of the filesystem. The mon_avail_space.sh should be run
periodically to monitor available disk space on any filesystem.
Technote: 1326416
http://www-01.ibm.com/support/docview.wss?uid=swg21326416

24
IBM Software Group

Utility mon_msg.sh
mon_msg.sh - UNIX script that monitors size of .msg files, can be
configured to auto increase size of .msg file(s) that exceed defined
threshold and send notification via email or text message to cell phone
that threshold has been exceeded. Monitors available disk space of
TWS file system and sends notification stating that TWS file system
has exceeded defined threshold. Currently this function does not exist
in TWS. This will limit filling up of TWS filesystem and .msg files which
could cause TWS processes to terminate, compromise the production
file and prevent production downtime.

Technote: 1306335
http://www-01.ibm.com/support/docview.wss?uid=swg21306335

25
IBM Software Group

What does each line of planman showinfo mean?


[m851@cyborg ~]$ planman showinfo
Tivoli Workload Scheduler (UNIX)/PLANMAN 8.5.1 (20091127)
Licensed Materials - Property of IBM*
5698-WSH
(C) Copyright IBM Corp. 1998, 2009 All rights reserved.
* Trademark of International Business Machines
Installed for user "m851".
Locale LANG set to the following: "en"
Plan creation start time: 03/05/2010 06:00 TZ CST
##Plan date that was last added to the Symphony file
Production plan start time of last extension: 03/06/2010 06:00 TZ CST
##Date the added Plan will end
Production plan end time: 03/07/2010 05:59 TZ CST
##This is a 48 hour Plan.
##Number of hours in the last Plan extension
Production plan time extention: 024:00
##Date and Time that the last Plan was extended.
Plan last update: 03/05/2010 08:45 TZ CST
Preproduction plan end time: 03/20/2010 07:00 TZ CDT
Start time of first not complete preproduction plan job stream instance: 03/05/2010 06:00 TZ CST
##Current Run number of Plan
Run number: 7
Confirm run number: 7

26

DB2
TWS database access

2009 IBM Corporation


IBM Software Group

DB2
Verify that the DB2 database created for IBM Tivoli Workload Scheduler (TWS) is accessible and functional.

Assume the following for the scenario below:

db2inst1 = "DB2 instance owner"

TWS = "Name of database created by the TWS 8.5 installation."

\\Switch to the db2 instance owner's user and source the db2 environment

# su - db2inst1

$ . sqllib/db2profile

\\ List the databases that exist on this db2 instance "TWS" is the default db name for TWS v8.3

$ db2 list db directory

28
IBM Software Group

DB2
Script command is started on Mon Apr 12 13:16:40 CDT 2010.
$ db2 list db directory

System Database Directory

Number of entries in the directory = 2

Database 1 entry:

Database alias = TWS


Database name = TWS
Local database directory = /home/db2inst1
Database release level = c.00
Comment = TWS Database
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =

Database 2 entry:

Database alias = TWS_DB


Database name = TWS
Node name = LBNODE
Database release level = c.00
Comment =
Directory entry type = Remote
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =

29
IBM Software Group

DB2
$db2 connect to tws

Database Connection Information

Database server = DB2/AIX64 9.5.0


SQL authorization ID = DB2INST1
Local database alias = TWS

$ db2 select schemaname from syscat.schemata

SCHEMANAME
-----------------------------------------
DWB
EVT
LOG
MDL
NULLID
SQLJ
SYSCAT
SYSFUN
SYSIBM
SYSIBMADM
SYSIBMINTERNAL
SYSIBMTS
SYSPROC
SYSSTAT
SYSTOOLS

30
IBM Software Group

DB2 - Schema
$ db2 list tables for schema dwb

Table/View Schema Type Creation time


------------------------------- --------------- ----- --------------------------
ALL_ALLOCATIONS DWB T 2010-04-09-12.48.50.771858
ALR_ALLOCATION_RESOURCES DWB T 2010-04-09-12.48.51.099697
ARE_ABSTRACT_RESOURCES DWB T 2010-04-09-12.48.53.613348
CSR_COMPUTER_SYSTEM_RESOURCES DWB T 2010-04-09-12.48.51.834397
EPR_ENDPOINT_REFS DWB T 2010-04-09-12.48.46.145017
FSR_FILE_SYSTEM_RESOURCES DWB T 2010-04-09-12.48.52.064104
JOA_JOB_ARCHIVES DWB T 2010-04-09-12.48.47.508713
JOB_BROKER_JOBS DWB T 2010-04-09-12.48.46.410286
JOD_BROKER_JOB_DEFINITIONS DWB T 2010-04-09-12.48.46.804807
JOR_JOB_RESOURCES DWB T 2010-04-09-12.48.47.147652
JRA_JOB_RESOURCE_ARCHIVES DWB T 2010-04-09-12.48.48.572429
LGR_LOGICAL_RESOURCES DWB T 2010-04-09-12.48.52.309830
MEA_METRIC_ARCHIVES DWB T 2010-04-09-12.48.48.699851
MET_METRICS DWB T 2010-04-09-12.48.47.928200
NSR_NETWORK_SYSTEM_RESOURCES DWB T 2010-04-09-12.48.52.555379
NSS_NOTIFICATION_STATES DWB T 2010-04-09-12.48.48.264270
OSR_OPERATING_SYSTEM_RESOURCES DWB T 2010-04-09-12.48.52.785587
PPS_PRODUCT_PROPERTIES DWB T 2010-04-09-12.48.51.326873
RAA_RESOURCE_ADVISORY_AGENTS DWB T 2010-04-09-12.48.53.335531
REL_RESOURCE_DEPS DWB T 2010-04-09-12.48.53.081108
RGS_RESOURCE_GROUPS DWB T 2010-04-09-12.48.53.876648
SRV_SERVERS DWB T 2010-04-09-12.48.54.134014
TAJ_TWS_AGENT_JOBS DWB T 2010-04-09-12.48.50.195709

31
IBM Software Group

DB2
$ db2 list tables for schema mdl

Table/View Schema Type Creation time


------------------------------- --------------- ----- --------------------------
AJB_ABSTRACT_JOBS MDL T 2010-04-09-12.48.14.664073
AJS_ABSTRACT_JOB_STREAMS MDL T 2010-04-09-12.48.14.599346
CALENDARS_V MDL V 2010-04-09-12.48.34.145755
CAL_CALENDARS MDL T 2010-04-09-12.48.12.807603
DOM_DOMAINS MDL T 2010-04-09-12.48.13.424041
FILE_REFS_V MDL V 2010-04-09-12.48.34.591297
INTERNETWORK_DEPS_V MDL V 2010-04-09-12.48.34.477235
JDP_JOB_STREAM_INSTANCE_DEPS MDL T 2010-04-09-12.48.13.886978
JHR_JOB_HISTORY_RUNS MDL T 2010-04-09-12.48.14.536816
JOB_DEFINITION_REFS_V MDL V 2010-04-09-12.48.34.643748
JOB_DEPS_V MDL V 2010-04-09-12.48.34.413775
JOB_HISTORY_V MDL V 2010-04-09-12.48.34.308417
JOB_JOBS MDL T 2010-04-09-12.48.13.976201
JOB_STATISTICS_V MDL V 2010-04-09-12.48.34.236171
JOB_STREAM_DEPS_V MDL V 2010-04-09-12.48.34.531715
JOB_STREAM_REFS_V MDL V 2010-04-09-12.48.34.823317
JOS_JOB_STATISTICS MDL T 2010-04-09-12.48.14.460549
JSI_JOB_STREAM_INSTANCES MDL T 2010-04-09-12.48.13.783504
JST_JOB_STREAMS MDL T 2010-04-09-12.48.12.976221
NDP_NETWORK_DEPS MDL T 2010-04-09-12.48.14.160828
PROMPTS_V MDL V 2010-04-09-12.48.34.091416
PROMPT_REFS_V MDL V 2010-04-09-12.48.34.705880
PROPERTIES_V MDL V 2010-04-09-12.48.34.967084
RCY_RUN_CYCLES MDL T 2010-04-09-12.48.13.263102
RDP_RESOURCE_DEPS MDL T 2010-04-09-12.48.13.699290
RESOURCE_REFS_V MDL V 2010-04-09-12.48.34.770530
WKS_WORKSTATIONS MDL T 2010-04-09-12.48.13.543574
WUS_WINDOWS_USERS MDL T 2010-04-09-12.48.14.310074

32
IBM Software Group

DB2 Schema
$ db2 list tables for schema log

Table/View Schema Type Creation time


------------------------------- --------------- ----- --------------------------
ACTION_PARAMETERS_V LOG V 2010-04-09-12.48.33.792746
ACTION_RUNS_V LOG V 2010-04-09-12.48.33.733142
AUDIT_RECORDS_V LOG V 2010-04-09-12.48.33.976844
EVENT_RULE_INSTANCES_V LOG V 2010-04-09-12.48.33.863459
LLRC_LOG_RECORDS LOG T 2010-04-09-12.48.11.905529
LOG_MESSAGES_V LOG V 2010-04-09-12.48.33.917087
LRPR_RECORD_PROPERTIES LOG T 2010-04-09-12.48.12.327225

33
IBM Software Group

dbrunstat
Running DB2 maintenance manually
This section describes how to perform the DB2 maintenance process on demand, instead of waiting for DB2 to do it
according to its automatic maintenance policy. The process is run by the tool dbrunstats which you can run whenever
you need to, without stopping DB2 or interrupting its processing.
To run this tool, follow this procedure:
Locate the DB2 tools: see Locating the DB2 tools.
Check that the user who is going to run the procedure has the appropriate rights (see User permissions for running the
DB2 tools)
Open a DB2 shell, as follows:
UNIX
Follow these steps:
Issue the command su - db2inst1, or change to the subdirectory sqllib of the home directory of the owner of the DB2 instance (by default db2inst1)
Launch the command . ./db2profile
Windows
Select from the Start menu, Programs IBM DB2 Command Line Tools Command Window
Check that the command shell is correctly initialized by issuing the command db2, and checking that the command is
recognized.
Issue the command quit to leave the DB2 Processor mode.
From within the shell, change to the directory <TWA_home>/TWS/dbtools/db2/scripts
Run the script:
UNIX
dbrunstats.sh database [user [password]]
Windows
dbrunstats database [user [password]]

34
IBM Software Group

dbreorg
Reorganizing the DB2 database
Using this tool, the database physically reorganizes the data tables and indexes, optimizing disk space usage and ease of data access. The process is time-consuming, requires that the
database is backed up, and that Tivoli Workload Scheduler is stopped. However, at the end you have a database that is completely reorganized.
To reorganize the database follow this procedure:
Back up the Tivoli Workload Scheduler database. Use the method described in Backing up the database to offline storage.
Stop all Tivoli Workload Scheduler processes. See Unlinking and stopping Tivoli Workload Scheduler for full details.
Check that the user who is going to run the procedure has the appropriate rights (see User permissions for running the DB2 tools)
Open a DB2 shell, as follows:
UNIX
Follow these steps:
Issue the command su - db2inst1, or change to the subdirectory sqllib of the home directory of the owner of the DB2 instance (by default db2inst1)
Launch the command . ./db2profile
Windows
Select from the Start menu, Programs IBM DB2 Command Line Tools Command Window
Check that the command shell is correctly initialized by issuing the command db2, and checking that the command is recognized.
Issue the command quit to leave the DB2 Processor mode.
From within the shell, change to the directory <TWA_home>/TWS/dbtools/db2/scripts
Run the script:
UNIX
dbreorg.sh database [user [password]]
Windows
dbreorg database [user [password]]
where:
database
The name of the database:
If you are running this from the computer where the DB2 server is installed, the installed default name is TWS. Supply this value unless you have changed it.
If you are running this from the computer where the DB2 client is installed, the installed default name is TWS_DB. Supply this value unless you have changed it.
user
The DB2 administration user. If this is omitted the ID of the user running the command will be used.
password
The password of the DB2 administration user. If this is omitted it will be requested interactively.
The script runs, giving you various messages denoting its progress and successful conclusion.
Restart Tivoli Workload Scheduler.

35

ITWS 8.4 - Understanding WAS and its tools

Overview

2009 IBM Corporation


IBM Software Group

Embedded version of WebSphere Application


Server Express (Bobcat)
Its not an Express as stated in the name, but a Base without
some components (e.g. Admin Console)
Its an embedded component and should be considered as part
of TWS
TWS fix packs will upgrade Bobcat if required
External WAS is currently not supported
Can coexist with other WAS present on the machine (e.g. TWS
for z/OS Connector)
Documentation:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp

37
IBM Software Group

Embedded version of WebSphere Application


Server Express (Bobcat)
Installed by just copying files to the following path (no external
WAS Installation or CD):
<TWS_HOME>/appserver
TWS creates just one of the following profiles depending on the
installed components
Master: <TWS_HOME>/appserver/profiles/twsprofile
Connector: <TWS_HOME>/appserver/profiles/twsconnprofile
z/OS Connector: <TWS_HOME>/appserver/profiles/twszconnprofile

Relevant WAS directories (in profile directory)


WAS configuration: <profile>/config
EAR files: <profile>/installedApps
Resource Adapter (z/OS only): <profile>/installedConnectors
Logs and traces: <profile>/logs
TWSConfig.properties: <profile>/properties/TWSConfig.properties

38
IBM Software Group

Installation locations (UNIX)


Directory Masterspace FTAspace

TWSengine <TWS_HOME> 170/270MB

Libraries:ICUandatrc /usr/Tivoli/TWS 10/20MB


(UNIXonly)

Bobcat(WAS) <TWS_HOME>/appserver 250/290MB -

TWS 8.5
<TWS_HOME>/eWAS/profiles/twaprofile

WASprofile <TWS_HOME>/appserver/profiles/twsprofile Included in -


<TWS_HOME>/appserver/profiles/twsconnprofile bobcat space
<TWS_HOME>/appserver/profiles/twszconnprofile above

TWS 8.5
<TWS_HOME>/eWAS/profiles/twaprofile

WAStools <TWS_HOME>/wastools Included in -


bobcat space
above

Installationtempdir /tmp 170MB 40MB

39
IBM Software Group

Installation locations (Windows)


Directory Masterspace FTAspace

TWSengine C:\Program Files\IBM\TWS\<TWS_USER> 90MB


(defined by the user)
(TWS_HOME)
Bobcat(WAS) <TWS_HOME>\appserver 170MB -

WASprofile <TWS_HOME>\appserver\profiles\twsprofile Included in -


<TWS_HOME>\appserver\profiles\twsconnprofile bobcat space
<TWS_HOME>\appserver\profiles\twszconnprofile above

TWS 8.5

<TWS_HOME>\eWAS\profiles\twaprofile
<TWS_HOME>\eWAS\profiles\twaconnprofile
<TWS_HOME>\eWAS\profiles\twazconnprofile

WAStools <TWS_HOME>\wastools Included in -


bobcat space
above

Installationtempdir c:\Documents and Settings\<installing user>\Local 70MB 20MB


Settings\Temp

40

ITWS 8.4 - Understanding WAS and its tools


Using The Tools

2009 IBM Corporation


IBM Software Group

Network configuration for JSC

JSC Master / Connector


JSC / WAS communication uses RMI/IIOP protocol
Some connection are established between JSC and WAS involving JNDI and ORB
Services.
Some parameters are involved in this phase (showHostProperties and
changeHostProperties utilities can be used to manage them):
bootHost: this address (IP address or hostname) is returned to JSC and used to establish
connections to the JNDI server, this address must be visible from machine where JSC is running.
This value is set during installation, change the value only if you have problems connecting from
JSC (e.g. Server behind NAT, no DNS, etc..). Behind NAT use the public hostname / IP Address.
orbPort and csiServerAuthPort: by default is set to 0 (dynamically obtained from the OS), set
this port to a specific value if a firewall exists between JSC and TWS Master/Connector or Server
is behind NAT and you need to control the port used.
bootPort, orbPort and csiServerAuthPort must be opened on firewalls and forwarded on NATs

42
IBM Software Group

Users
Some userid/password are stored in WAS configuration:
Can be managed using showSecurityProperties and
changeSecurityProperties
WAS Admin user:
Used by WAS itself.
The installation configures WAS to use OS authentication and TWS user
If using default OS authentication view / modify the LocalOSServerID and
LocalOSServerpassword properties.
On Windows WAS Admin user is stored also in the service configuration to stop WAS (use
updateWasService to change the password).
TWS DB2 user:
Used by WAS to access TWS table on DB2.
view / modify the j2cUserid and j2cPassword properties of j2cAlias=db2.

43
IBM Software Group

WAS Tools
During the product life-cycle some configuration parameters may need to
be changed, e.g.:
Password of TWS user or DB2 user has changed
(changeSecurityProperties & updateWasService)

DB2 server is changed


(changeDataSourceProperties)

User registry moved on LDAP Server


(changeSecurityProperties)

Product trace must be captured to send documentation to IBM


(changeTraceProperties)

WAS Ports must be customized to use across firewalls or NATs


(changeHostProperties)

Can be run from any userid if WAS userid and pswd are provided as
parameters (except startWas)
WAS Tools are documented in the Planning and Installation Guide,
Appendix A
44
IBM Software Group

TWS installs the following UNIX and Linux scripts:-


backupConfig.sh
changeDataSourceProperties.sh
changeHostProperties.sh
changeTraceProperties.sh
changeSecurityProperties.sh
encryptProfileProperties.sh
restoreConfig.sh
showDataSourceProperties.sh
showHostProperties.sh
showSecurityProperties.sh
startWas.sh
stopWas.sh

45
IBM Software Group

WAS Tools - Start and Stop Was


The scripts startWas.bat (.sh) and stopWas.bat (.sh) let the TWS Administrator start and
stop the WAS server.
On Windows the WAS server is installed as an operating system service, on UNIX it is
just a process:
On Windows userid and password are not required since are stored in the service
On UNIX stopWas.sh needs twsuser userid and password
On UNIX startWas must be run by root when WAS uses the local operating systems user registry
Optionally startWas.bat and stopWas.bat also supports all the parameters that
WebSpheres startServer.bat and stopServer.bat use.
Usage (Windows):
startWas.bat [-service <Service Name>] [-options <startServer.bat params>]
stopWas.bat [-service <Service's Name>] [-wasHome <WAS Install Directory>]
[-options <stopServer.bat params>]
Usage (UNIX):
startWas.sh
stopWas.sh -user <username> -password <password>

46
IBM Software Group

WAS Tools - Backup and Restore Configuration


Scripts backupConfig.bat (.sh) and restoreConfig.bat (.sh) let the TWS
Administrator backup configuration files into a zip file and restore them.
These scripts call their counterparts provided in the
<TWSHOME>\appserver\bin directory and they have the same usage.
For a detailed description of these commands, see the WebSphere
Application Server V6 - System Management and Configuration
Handbook (Redbook SG24-6451)
Usage:
backupConfig.bat [backup_file] [-nostop] [-quiet] [-logfile <filename>]
[-replacelog] [-trace] [-username <uid>] [-password <pwd>]
[-profileName <profile>] [-help]
restoreConfig.bat backup_file [-location restore_location] [-quiet]
[-nowait] [-logfile <filename>] [-replacelog] [-trace] [-username <uid>]
[-password <pwd>] [-profileName <profile>] [-help]

47
IBM Software Group

Example of backupconfig.bat output


C:\TWS\tws84\wastools>backupConfig.bat :-

ADMU0116I: Tool information is being logged in file


C:\TWS\tws84\appserver\profiles\twsprofile\logs\
backupConfig.log
ADMU0128I: Starting tool with the twsprofile profile
ADMU5001I: Backing up config directory
C:\TWS\tws84\appserver\profiles\twsprofile\config to file
C:\TWS\tws84\wastools\WebSphereConfig_2005-12-12.zip
ADMU0505I: Servers found in configuration:
ADMU0506I: Server name: server1
ADMU2010I: Stopping all server processes for node DefaultNode
ADMU0512I: Server server1 cannot be reached. It appears to be
stopped ............................................................................................................
ADMU5002I: 137 files successfully backed up

48
IBM Software Group

Example of restoreConfig.bat output


C:\TWS\tws84\wastools>restoreConfig.bat WebSphereConfig_2005-12-11.zip

ADMU0116I: Tool information is being logged in file


C:\TWS\tws84\appserver\profiles\twsprofile\logs\
restoreConfig.log ADMU0128I: Starting tool with the twsprofile profile
ADMU0505I: Servers found in configuration:
ADMU0506I: Server name: server1
ADMU2010I: Stopping all server processes for node DefaultNode
ADMU0512I: Server server1 cannot be reached. It appears to be stopped.
ADMU5502I: The directory C:\TWS\tws83\appserver\profiles\twsprofile\config
already exists; renaming to
C:\TWS\tws84\appserver\profiles\twsprofile\config.old
ADMU5504I: Restore location successfully renamed
ADMU5505I: Restoring file WebSphereConfig_2005-12-11.zip to location
C:\TWS\tws84\appserver\profiles\twsprofile\config
.......................................................................................................................................
ADMU5506I: 127 files successfully restored
ADMU6001I: Begin App Preparation -
ADMU6009I: Processing complete.

49
IBM Software Group

WAS Tools - Show DataSource Properties


################################################################
DB2 Type2 Resource Properties
################################################################
DB2Type2JndiName=jdbc/twsdb2
DB2Type2Description=
DB2Type2ConnectionAttribute=cursorhold=0

The script DB2Type2EnableMultithreadedAccessDetection=false


DB2Type2Reauthentication=false
DB2Type2JmsOnePhaseOptimization=false

showDataSourceProperties.b DB2Type2DatabaseName=TWS_DB
DB2Type2PreTestSQLString=SELECT 1 FROM SYSIBM.SYSDUMMY1

at (.sh) lets the TWS ################################################################


DB2 Type4 Resource Properties

Administrator dump the current ################################################################


DB2Type4JndiName=jdbc/twsdb
DB2Type4DatabaseName=TWS
DataSource configuration DB2Type4DriverType=4
DB2Type4ServerName=FMOSSOT5
DB2Type4PortNumber=50000
properties. DB2Type4Description=
DB2Type4TraceLevel=
DB2Type4TraceFile=
DB2Type4FullyMaterializeLobData=true
The output has the same syntax DB2Type4ResultSetHoldability=2
DB2Type4CurrentPackageSet=
DB2Type4ReadOnly=false
of the template file for DB2Type4DeferPrepares=true
DB2Type4CurrentSchema=
DB2Type4CliSchema=
changeDataSourceProperties. DB2Type4RetrieveMessagesFromServerOnGetMessage=true
DB2Type4ClientAccountingInformation=
DB2Type4ClientApplicationInformation=
bat (.sh), so it can be used as DB2Type4ClientUser=
DB2Type4ClientWorkstation=

input for that script.


DB2Type4CurrentPackagePath=
DB2Type4CurrentSQLID=
DB2Type4KerberosServerPrincipal=
DB2Type4LoginTimeout=0
DB2Type4SecurityMechanism=
Usage: DB2Type4TraceFileAppend=false
DB2Type4CurrentFunctionPath=
DB2Type4CursorSensitivity=
showDataSourceProperties.bat DB2Type4KeepDynamic=
DB2Type4CurrentLockTimeout=
DB2Type4EnableMultithreadedAccessDetection=false
DB2Type4Reauthentication=false
DB2Type4JmsOnePhaseOptimization=false
DB2Type4PreTestSQLString=SELECT 1 FROM SYSIBM.SYSDUMMY1
DB2Type4DbFailOverEnabled=false
DB2Type4ConnRetriesDuringDBFailover=100
DB2Type4ConnRetryIntervalDuringDBFailover=3000

50
IBM Software Group

WAS Tools - Change DataSource Properties


The script changeDataSourceProperties.bat (.sh) allows the TWS
Administrator to change the DataSource properties for DB2 (TWS
Master or Backup Master only).
Usually this script can be used when some DataSource properties
must be updated, such as the Database name, host or port. The script
is supposed to be invoked when WAS is stopped.
Usage:
changeDataSourceProperties.bat <property file>
Property file template:
DataSourceProps.properties

51
IBM Software Group

WAS Tools - Show Host Properties


###############################################
Host Configuration Panel
The script ###############################################
oldHostname=localhost
showHostProperties.bat (.sh) newHostname=localhost
lets the TWS Administrator
###############################################
dump the current WAS Ports Configuration Panel
###############################################
configuration properties such as bootPort=31117
bootHost=fmossot5.rot.it.ibm.com
hostname and ports. soapPort=31118
soapHost=9.71.147.41
httpPort=31115
The output has the same syntax httpHost=*
httpsPort=31116
of the template file for httpsHost=*
adminPort=31119
changeHostProperties.bat adminHost=*
adminSecurePort=31116
(.sh), so it can be used as input adminSecureHost=*
sasPort=0
for that script. sasHost=localhost
csiServerAuthPort=0
Usage: csiServerAuthHost=localhost
csiMuthualAuthPort=0
csiMuthualAuthHost=localhost
showHostProperties.bat orbPort=0
orbHost=localhost

52
IBM Software Group

WAS Tools - Change Host Properties


The script changeHostProperties.bat (.sh) allows the TWS
Administrator to change the following:
the workstation hostname stated in WAS configuration files
TCP/IP ports used by WAS.
Usually this script can be used either when the workstation network
settings must be updated or a different set of ports should be used. It is
supposed to be invoked when WAS is stopped.
Usage:
changeHostProperties.bat <property file>
Property file template:
HostConfigProps.properties

53
IBM Software Group

WAS Tools - Change Host Properties


All of the properties in the properties file are optional. When you
are modifying the properties file you should be aware of the
following :-
When oldHostname and newHostname are provided (these settings
must be provided together), the host property related to each port is
updated when it has not been provided in the properties file and the
current value matches oldHostname
Port settings are updated only if they are provided in the properties file
A port-specific host setting, such as httpHost is not updated if not
specified except when its current setting matches oldHostname
An empty setting is considered as not provided

54
IBM Software Group

WAS Tools - Show Security Properties

####################################################
The script Global Security Panel
####################################################
showSecurityProperties.bat enabled=true
enforceJava2Security=false
(.sh) lets the TWS Administrator useDomainQualifiedUserNames=false
cacheTimeout=600
dump all the current WAS issuePermissionWarning=true
activeProtocol=CSI
security settings related to the activeAuthMechanism=SWAM
activeUserRegistry=LocalOS
usage of ITWS 8.4.
####################################################
The output has the same syntax Local OS Registry
####################################################
of the template file for LocalOSServerID=tws
LocalOSServerpassword=so24.nia
changeSecurityProperties.bat LocalOSServerREALM=TWSREALM

(.sh), so it can be used as input


for that script.
Usage:
showSecurityProperties.bat

55
IBM Software Group

WAS Tools - Show Security Properties


################################################ ###################################################
LDAP Panel SSL Panel
################################################ ###################################################
LDAPServerId=tws alias=DefaultSSLSettings
LDAPPassword=so24.nia keyFileName=$
LDAPServerType=IBM_DIRECTORY_SERVER {USER_INSTALL_ROOT}/etc/TWSServerKeyFile.jks
LDAPHostName= keyFilePassword=default
LDAPPort= keyFileFormat=JKS
LDAPBaseDN= trustFileName=$
LDAPBindDN= {USER_INSTALL_ROOT}/etc/TWSServerTrustFile.jks
LDAPBindPassword= trustFilePassword=default
LDAPsearchTimeout=120 trustFileFormat=JKS
LDAPreuseConnection=true clientAuthentication=false
LDAPIgnoreCase=true securityLevel=HIGH
LDAPsslEnabled=false enableCryptoHardwareSupport=false
LDAPsslConfig=DefaultNode/DefaultSSLSettings

###################################################
################################################ J2C Authentication Data Panel
Advanced LDAP Panel ###################################################
################################################ j2cAlias=db2
LDAPUserFilter=(&(uid=%v)(objectclass=ePerson)) j2cUserid=tws
LDAPGroupFilter=(&(cn=%v)(| j2cPassword=*****
(objectclass=groupOfNames) j2cDescription=TWS authentication data entry for
(objectclass=groupOfUniqueNames) DB2
(objectclass=groupOfURLs)))
LDAPUserIdMap=*:uid
LDAPGroupIdMap=*:cn
LDAPGroupMemberIdMap=ibm-allGroups:member;ibm-
allGroups:uniqueMember
LDAPCertificateFilter=
LDAPCertificateMapMode=EXACT_DN

56
IBM Software Group

WAS Tools - Change Security Properties


The script changeSecurityProperties.bat (.sh) allows the TWS
Administrator to change all the WAS security settings related to the
usage of ITWS 8.4. In particular they include:
General security settings such as the user registry to use (Local OS or LDAP).
Local OS User registry settings (user and password)
LDAP configuration settings
SSL key-stores
DB2 user settings for TWS Data source
This script is supposed to be executed when the WAS server is stopped.
Usage:
changeSecurityProperties.bat <property file>
Property file template:
SecurityProps_TEMPLATE.properties

57
IBM Software Group

WAS Tools - Change Trace Properties


The script changeTraceProperties.bat (.sh) allows the TWS
Administrator to change all WAS trace settings. This script must be
executed when the WAS server is running and can be used to change
the trace level for both TWS and WAS code.
The script uses TracingProps.properties properties file that defines the
trace modes.
tws_all sets all TWS traces to on
Usage:
changeTraceProperties -user <username> -password <password>
-mode <tracemode> [-propertyFile <Trace Properties>]
[-server <Server Name>] [-node <Node Name>]

58
IBM Software Group

WAS Tools - Change Trace Properties


Example (switch on traces for TWS code only):
changeTraceProperties.bat user tws83 password password83 mode
tws_all
Example (switch off traces for all the code):
changeTraceProperties.bat user tws83 password password83 mode
reset
Logs Written in the following path:
<TWS_HOME>/appserver/profiles/twsprofile/logs/server1

59
IBM Software Group

Database Utilities for Oracle


WAS tools are available for DB2 and Oracle
ShowDataSourceProperties
shows the configuration of both Oracle Data Sources (type 2 and type 4)
ChangeDataSourceProperties
allows changing the properties of the Oracle Data Source in use
allows switching between type 2 and type 4 data sources
by default, the TWS server uses the type 2 data source, based on native client calls (OCI)
known limitations exist with the type 4 data source (CLOBs cannot exceed 4000 chars)

Other utilities are available for DB2 only


Collection of database statistics can be done using Oracle tools
Use functions in the DBMS_STATS package to collect statistics manually
On Oracle 10g, configure GATHER_STATS_JOB to collect statistics automatically
Database maintenance activities are left to the Oracle DBA
The TWS metronome script does not run the Oracle database backup

60
IBM Software Group

TWS Information Center

http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1/topic/com.ibm.tivoli.itws.doc_8.5.1/ic-
homepage.html

Learning and Demos


Product Manuals
Community and Support

TWS Support Portal


http://www-947.ibm.com/support/entry/portal/Overview/Software/Tivoli/Tivoli_Workload_Scheduler

61

You might also like