Professional Documents
Culture Documents
IBM Information Management Cloud Computing Center of Competence IBM Canada Labs
1
2011 IBM Corporation
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
DB2 Express-C
DB2 Express-C
Extra functionality
Extra functionality
Extra functionality
10
11
Latest version for DB2 on Linux, UNIX and Windows is DB2 9.7
12
2011 IBM Corporation
13
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
14
15
Linux
Red Hat, Suse, Ubuntu and more
16
Maximum requirements:
System of any size Uses at most 2 cores and 2 GB of RAM
17
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
21
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
23
24
P o rt
25
P o rt
26
P o rt
P o rt
27
P o rt
P o rt
28
P o rt
P o rt
29
P o rt
P o rt
30
P o rt
P o rt
31
P o rt
IBMDEFAULTBP
P o rt
32
P o rt
IBMDEFAULTBP LOGS
P o rt
33
P o rt
USERSPACE1
IBMDEFAULTBP LOGS
IBMDEFAULTBP LOGS
P o rt
34
P o rt
USERSPACE1
IBMDEFAULTBP LOGS
IBMDEFAULTBP LOGS
P o rt
35
P o rt
USERSPACE1
IBMDEFAULTBP LOGS
IBMDEFAULTBP LOGS
P o rt
36
P o rt
USERSPACE1
IBMDEFAULTBP LOGS
P o rt
USERSPACE1
IBMDEFAULTBP LOGS
P o rt
39
40
Table spaces
Table A Table B
41
Table spaces
Table A Table B
Table space MYTBLS1 Logical Physical Memory Disk 1 Disk 2 Disk 3 Bufferpool 1 Bufferpool 2
42
Table spaces
Table A Table B
Table space MYTBLS1 Logical Physical Memory Disk 1 Disk 2 Disk 3 Bufferpool 1 Bufferpool 2
43
Table spaces
Table A Table B
Table space MYTBLS1 Logical Physical Memory Disk 1 Disk 2 Disk 3 Bufferpool 1 Bufferpool 2
44
Table spaces
Table A Table B
Table space MYTBLS1 Logical Physical Memory Disk 1 Disk 2 Disk 3 Bufferpool 1 Bufferpool 2
45
46
47
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
48
DB2 configuration
DB2 Express-C Server (Linux/Windows)
Instance MYINST
Database MYDB1
P o rt
49
DB2 configuration
DB2 Express-C Server (Linux/Windows) Environment variables Instance MYINST
Database MYDB1
P o rt
50
DB2 configuration
DB2 Express-C Server (Linux/Windows) Environment variables Instance MYINST Database Manager Configuration File (dbm cfg) Database MYDB1
P o rt
51
DB2 configuration
DB2 Express-C Server (Linux/Windows) Environment variables Instance MYINST Database Manager Configuration File (dbm cfg) Database MYDB1 Database Configuration File (db cfg)
P o rt
52
DB2 configuration
DB2 Express-C Server (Linux/Windows) Environment variables Instance MYINST Database Manager Configuration File (dbm cfg) Database MYDB1 Database Configuration File (db cfg)
P o rt
54
Note: There should not be spaces at all between the equal sign and the parameter name, and the value in a db2set command. For example: db2set db2comm = tcpip db2set db2comm=tcpip
55
2011 IBM Corporation
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
56
SQL Scripts
Pros Simple to understand Platform independent
57
58
59
2011 IBM Corporation
CREATE TABLE arfchong.mytable ( col1 INTEGER NOT NULL, col2 VARCHAR(40), col3 DECIMAL(9,2) );
60
Cons: Platform-dependent
62
Execute as follows:
create_database.bat myuserid mypassword
63
2011 IBM Corporation
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
64
Directories
System database directory list db directory Local database directory list db directory on <drive/path> Node directory list node directory DCS directory list dcs directory
65
66
mydb1
67
mydb1
DB2COMM=TCPIP
68
mydb1
DB2COMM=TCPIP Port = 50000 User defined in O/S: User ID = myuser Password = mypsw
System DB Directory
Node Directory
70
System DB Directory
Node Directory
mynode
71
System DB Directory
Node Directory
mydb1
mynode
1) catalog tcpip node mynode remote myhost.ibm.com server 50000 2) catalog database mydb1 at node mynode
72
2011 IBM Corporation
System DB Directory
Node Directory
Instance DB2
mydb1
mynode
network
mydb1
1) catalog tcpip node mynode remote myhost.ibm.com server 50000 2) catalog database mydb1 at node mynode
73
Agenda
DB2 server editions, clients and drivers DB2 Express-C overview The DB2 Command Line Processor (demo) The DB2 Environment Configuring DB2 Working with scripts Connecting to a DB2 server Data movement utilities
74
75
db2look Extracts:
DDL Permissions Database statistics Table space characteristics
76
Thank you!
77
2011 IBM Corporation