You can add new database partitions to a partitioned database system
while it is stopped. The newly added database partition becomes available
to all databases when the database manager is started again.
Before you begin
- You must install the new server before you can create a database
partition on it.
- Set the default value of the DB2_FORCE_OFFLINE_ADD_PARTITION registry
variable to TRUE to enforce that any added database
partitions is offline.
Procedure
To add a database partition to a stopped partitioned
database server using the command line:
- Issue STOP DBM to stop all the database
partitions.
- Run the ADD DBPARTITIONNUM command on
the new server.
A database partition is created locally
for every database that already exists in the system. The database
parameters for the new database partitions are set to the default
value, and each database partition remains empty until you move data
to it. Update the database configuration parameter values to match
those on the other database partitions.
- Run the START DBM command to start the
database system.
Note that the database partition configuration
file has already been updated by the database manager to include the
new server during the installation of the new server.
- Update the configuration file on the new database partition
as follows:
- On any existing database partitions, run the START
DBM command.
Specify the new database partition
values for DBPARTITIONNUM, ADD DBPARTITIONNUM, HOSTNAME, PORT,
and NETNAME parameters as well as the COMPUTER, USER,
and PASSWORD parameters.
You can also specify
the source for any temporary table space container definitions that
need to be created with the databases. If you do not provide table
space information, temporary table space container definitions are
retrieved from the catalog partition for each database.
For example, to add three new database partitions to an
existing database, issue the following commands:
START DBM DBPARTITIONNUM 3 ADD DBPARTITIONNUM HOSTNAME HOSTNAME3
PORT PORT3;
START DBM DBPARTITIONNUM 4 ADD DBPARTITIONNUM HOSTNAME HOSTNAME4
PORT PORT4;
START DBM DBPARTITIONNUM 5 ADD DBPARTITIONNUM HOSTNAME HOSTNAME5
PORT PORT5;
When
the START DBM command is complete, the new server
is stopped.
- Stop the database manager by running the STOP
DBM command.
When you stop all the database partitions
in the system, the node configuration file is
updated to include the new database partitions. The node configuration file is
not updated with the new server information until STOP DBM is
executed. This ensures that the ADD DBPARTITIONNUM command,
which is called when you specify the ADD DBPARTITIONNUM
parameter to the START DBM command, runs on the
correct database partitions. When the utility ends, the new server
partitions are stopped.
- Start the database manager by running the START
DBM command.
The newly added database partitions
are now started with the rest of the system.
When all the database
partitions in the system are running, you can run system-wide activities,
such as creating or dropping a database.
Note: You might have to
issue the START DBM command twice for all database partition servers
to access the new db2nodes.cfg file.
- Optional: Alter the database partition group
to incorporate the new database partition.
This action
could also be an option when redistributing the data to the new database
partition.
- Optional: Redistribute data to the new database
partition.
This action is not really optional if you want
to take advantage of the new database partition. You can also include
the alter database partition group option as part of the redistribution
operation. Otherwise, altering the database partition group to incorporate
the new database partition must be done as a separate action before
redistributing the data to the new database partition.
- Optional: Back up all databases on the new
database partition.
Although optional, this would be helpful
to have for the new database partition and for the other database
partitions particularly if you have redistributed the data across
both the old and the new database partitions.