8/25/2016

How to setup logical data partitioning in DB2?

How to setup Logical Data Partition Step by Step:

What is Data Partitioning:

Present days databases and data warehouses become larger, this is somewhat complicated to maintain growth of the database. To avoid this and to manage the growth of the data IBM introduce the concept called "Database Partitioning Feature", "Table Partitioning" and Multi Dimensional Clustering". 

In this article we are going look at "Database Partitioning Feature".

Database Partitioning Feature:

There are two types of techniques we have to setup "Database Partitioning Feature".
  • Logical Partitioning (Shared Everything)
  • Physical Partitioning (Shared Nothing)

Logical Partitioning:

Logical Partitioning is also known as "Shared Everything". This means each node in the partitioning share every resource like CPU, RAM, Harddisk, etc..

Physical Partitioning:

Physical Partitioning is also known as "Share Nothing". This means we are going to create nodes on different servers, so each node uses its own CPU, RAM and Harddisk.

Now lets see how to setup Logical Database Partitioning Feature:

Step-1: 
If you are installing DB2 with db2setup then you have to check multipartition option at the time of installation. 

Step-2: 
Once all the instances and DAS servers get ready, you have to add node details to the db2nodes.cfg file.
vi /home/db2inst1/sqllib/db2nodes.cfg
0 hostname 0
1 hostname 1
2 hostname 2
After that try to start that instance you will get the error like "A communication error occurred"

Note: Please make sure you have proper IP and hostname entry in /etc/hosts file.

Step:3 To avoid this we need to set "DB2RSHCMD" to "/usr/bin/ssh"
db2set DB2RSHCMD=/usr/bin/ssh
Step:4 Start the instance
db2start
Now it'll ask for instance password several times. To avoid this we need to follow the next step.

Step:5 We need to create a public key to login automatically.
ssh-keygen -t rsa
cat id_rsa.pub >> authorized_keys
chmod 644 authorized_keys
chmod 600 id_rsa
# use approptiate ip_add and long_hostname for your environment in the commands below
ssh-keyscan -t rsa ip_addr, hostname >> known_hosts
#Test passwordless ssh:
ssh ip_addr hostname
ssh hostname hostname
db2start

Stop a node:

db2stop dbpartitionnum 1

Start a node:

db2start dbpartitionnum 1




1 comment:

  1. Vinay do we have to do the same process on all nodes in noshare mode?

    can you also share some insight and steps for MDC please

    ReplyDelete

ads