Today, we will introduce the actual operation steps for building database Partition in db2. If you are interested in the actual operation steps for creating database Partition, you can click to view the following articles. The following describes the relevant content.
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;
Create database Partition3 in db2 and set the dbInstance to be operated on in the command line
- set db2instance=db2inst1
- db2 get instance
- db2 attach to db2inst1
Db2 creates database Partition4 and DBPartition:
- db2start dbpartitionnum 1 ADD DBPARTITIONNUM HOSTNAME ANWENHAO PORT1 COMPUTER ANWENHAO USER db2admin PASSWORD aaa123456 WITHOUT TABLESPACES
Db2 creates database Partition5. After creation, you need to 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.