This article describes how to create a database Partition for a db2 database for your reference. The following describes how to create a database Partition.
You can run the following command to create a db instance:
Db2icrt-s ESE-u db2admin, aaa123456-h anwenhao dbinstancename create database partition
Create database Partition1. Create a db instance that requires database partitioning
You can run the following command to create a db instance:
Db2icrt-s ESE-u db2admin, aaa123456-h anwenhao dbinstancename after creating the corresponding instance, You need to restart DB2.
Create database Partition2 in db2 and add the new db instance to DB2:
Catalog local node DB2INST1 INSTANCE DB2INST1 system anwenhao ostype nt; db2 creates database Partition3. Set the dbInstance to be operated on in the command line.
Set db2instance = db2inst1 db2 get instance db2 attach to db2inst1 db2 CREATE database Partition4. Create DBPartition:
Db2start dbpartitionnum 1 add dbpartitionnum hostname anwenhao PORT1 computer anwenhao user db2admin PASSWORD aaa123456 without tablespaces db2 CREATE database Partition5. After creation, restart db2. DB2 will add a database partition and redistribution at this time.
The preceding operation completes database partition.
Create database partition group:
Create database partition group "NODE1" on dbpartitionnums (1); comment on database partition group "NODE1" IS 'anwenhao _ 1 '; then, you can select whether to create a table space in a database partition group. In this way, we can easily use DB2 database Partition to create cluster applications.