How to create database Partition in DB2

Source: Internet
Author: User
Tags how to create database

Today, we will mainly talk about the actual operations to establish database Partition in DB2. The following describes the actual operations to establish database Partition in DB2, we hope this will help you learn how to establish database Partition in DB2 in the future.

Run the following command to create a db instance: db2icrt-s ESE-u db2admin, aaa123456-h anwenhao dbinstancename.

Create database partition

1. Create a db instance for which you need to create a database partition

You can use the command DB2 to create a db instance:

 
 
  1. db2icrt -s ESE -u db2admin,aaa123456 -h ANWENHAO DBINSTANCENAME 

After creating the corresponding instance, You need to restart DB2.

2. Add the new db instance to DB2:

 
 
  1. CATALOG LOCAL NODE DB2INST1 INSTANCE DB2INST1 SYSTEM ANWENHAO OSTYPE NT; 

3. Set the dbInstance to be operated in the command line

 
 
  1. set db2instance=db2inst1 
  2. db2 get instance  
  3. db2 attach to db2inst1  

4. Create DBPartition:

 
 
  1. db2start dbpartitionnum 1 ADD DBPARTITIONNUM HOSTNAME ANWENHAO PORT 1   
  2. COMPUTER ANWENHAO USER db2admin PASSWORD aaa123456 WITHOUT TABLESPACES  

5. 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:

 
 
  1. CREATE DATABASE PARTITION GROUP "NODE1" ON DBPARTITIONNUMS (1);  
  2. COMMENT ON DATABASE PARTITION GROUP "NODE1" IS 'ANWENHAO _1';  

Then, you can choose whether to create a table space in a database partition group when db2. In this way, we can easily use DB2 database Partition to create cluster applications.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.