Professional Documents
Culture Documents
Raul F. Chong
IBM Toronto Laboratory
Agenda
Introduction
Control Center
Command Editor
Command Window / CLP
Task Center
Journal
Health Center
Scripting
2
IBM Software Group | DB2 Information Management Software
Command Window
Only on Windows. On Linux use the Linux shell
Can be started with “db2cmd”
3
IBM Software Group | DB2 Information Management Software
4
IBM Software Group | DB2 Information Management Software
Agenda
Introduction
Control Center
Command Editor
Command Window / CLP
Task Center
Journal
Health Center
Scripting
5
IBM Software Group | DB2 Information Management Software
Task Center
6
IBM Software Group | DB2 Information Management Software
7
IBM Software Group | DB2 Information Management Software
Any type of script can be scheduled using Task Center (whether or not
it was created through a DB2 GUI tool)
The advantage of creating tasks through a DB2 GUI tool is that they
can be edited again later using the original GUI tool used to create
them
Tasks are run at their scheduled time from the system where you
created the tools catalog, BUT run on the system where the database
exists
No dependencies on the client where the task was created
View previous executions of your tasks in the Journal
8
IBM Software Group | DB2 Information Management Software
Agenda
Introduction
Control Center
Command Editor
Command Window / CLP
Task Center
Journal
Health Center
Scripting
9
IBM Software Group | DB2 Information Management Software
Journal
10
IBM Software Group | DB2 Information Management Software
Journal
Select database
and system
11
IBM Software Group | DB2 Information Management Software
Agenda
Introduction
Control Center
Command Editor
Command Window / CLP
Task Center
Journal
Health Center
Scripting
12
IBM Software Group | DB2 Information Management Software
Health Center
Customize health
indicator settings
Choose screen
refresh time
13
IBM Software Group | DB2 Information Management Software
Health Center > Health Center menu > Configure > Alert Notification
14
IBM Software Group | DB2 Information Management Software
Agenda
Introduction
Control Center
Command Editor
Command Window / CLP
Task Center
Journal
Health Center
Scripting
15
IBM Software Group | DB2 Information Management Software
Scripting
There are two general forms of scripting:
SQL scripts
Operating system (shell) scripts
SQL Scripts
Simple to understand
Platform independent
Script parameters not supported
Operating system scripts
Greater flexibility
Additional logic possibilities
Supports parameters/variables
Platform-dependent
16
IBM Software Group | DB2 Information Management Software
CONNECT TO EXPRESS;
17
IBM Software Group | DB2 Information Management Software
18
IBM Software Group | DB2 Information Management Software
19
IBM Software Group | DB2 Information Management Software
set DBPATH=c:
set DBNAME=PRODEXPR
set MEMORY=25
db2 CREATE DATABASE %DBNAME% ON %DBPATH% AUTOCONFIGURE USING
MEM_PERCENT %MEMORY% APPLY DB AND DBM
db2 CONNECT TO %DBNAME% USER %1 USING %2
del schema.log triggers.log app_objects.log
db2 set schema user1
db2 –t –v –f schema.db2 –z schema.log
db2 –td@ -v –f triggers.db2 –z triggers.log
db2 –td@ -v –f functions.db2 –z functions.log
To execute this script from the command line, you would issue
the following command:
create_database.bat db2admin ibmdb2
20
IBM Software Group | DB2 Information Management Software
21
IBM Software Group | DB2 Information Management Software
In this QuickLab, you will create a simple installation script for the
EXPRESS database and its objects
Refer to the QuickLab #5 instructions
22
IBM Software Group | DB2 Information Management Software
What’s Next?
23