DB2 partition experiment solution in Windows
OS: Windows XP
DB2 UDB 8.1.3
Create two logical partitions on a host
You have created a sample database when installing DB2.
(1) execute db2ncrt to create database partitions
Db2ncrt/N: 1/u: username, password/h: Hostname/P: 1/O: Hostname/G: Hostname
(2) db2stop; db2start
(3) view the db2nodes. cfg file
0 hostname 0
1 hostname 1 hostname
(4) Create a database
DB2 create database mydb1
(5) create a partition Group
DB2 create database partition group pg01 on dbpartitionnum (0 to 1)
DB2 list database partition groups
(6) create a buffer pool
DB2 create bufferpool bp01 database partition group pg01 size 500
DB2 select bpname, ngname from syscat. bufferpools
(7) create a tablespace mytbls1
Different partitions on the same machine need different containers. The following SQL statements are generated by the DB2 control center.
Connect to mydb1;
Create regular tablespace mytbls1 in database partition group "pg01" pagesize 4 K managed by system using ('C:/DB2/node0000/tbls0') on dbpartitionnum (0) using ('C: /DB2/node0001/tbls1 ') on dbpartitionnum (1) extentsize 16 overhead 10.5 prefetchsize 16 transferrate 0.14 bufferpool "bp01" dropped table reoff off;
Comment on tablespace mytbls1 is '';
Connect reset;
(8) create a table in the tablespace
DB2 "create table tab1 (col1 int, col2 int, col3 char (10) in mytbls1 partitioning key (col1, col2 )"
(9) Create an index
DB2 "create index index1 on tab1 (col1, col2 )"
(10) Enable partition Parallelism
DB2 update dBm CFG using intra_parallel Yes
DB2 needs to be restarted
(11) Test the db2_all command
Db2_all "DB2 update dB CFG for mydb1 using logfilsiz 500"
(12) Test the command
"
Create ABC in the C:/Windows/system32 directory
"
Create ABC in the C: Directory
References
<Vivid introduction to DB2 UDB V8 for UNIX, Linux, and Windows>
<A vivid introduction to DB2 UDB for Linux, UNIX and Windows version 8 with database partitioning function (Part 1)>
Appendix A db2ncrt Parameters
The db2ncrt utility creates a node in the partitioned database system.
Db2ncrt/N: Node
/U: username, password
[/I: instance]
[/H: Host]
[/M: Machine]
[/P: Port]
[/O: instance owning
Machine]
[/G: netname]
The command independent variable is:
O/n specified node number
O/u specifies the account name and password of the DB2 service.
Command Options:
O/I specified instance (if different from the default/current instance)
O/h specifies the TCP/IP host name (if the host name is not the machine's default TCP/IP
Host Name)
O/M specifies the site name (if the node is created on a remote machine)
O/P specifies the logical port number (if this is not the first node on the machine)
O/o specifies the computer name of the machine that owns the instance (when the first node is created on the machine)
O/g specifies the network name or "ip address ".