You can add new database partitions that are offline to a partitioned database system.
The newly added database partition becomes available to all databases when the database manager is
started again.
Before you begin
- Install the new server if it does not exist before you can create a database partition on
it.
- Make the executables accessible using shared filesystem mounts or local copies.
- Synchronize operating system files with those on existing processors.
- Ensure that the sqllib directory is accessible as a shared file
system.
- Ensure that the relevant operating system parameters (such as the maximum number of processes)
are set to the appropriate values.
- Register the host name with the name server or in the
hosts file in the /etc directory on all database
partitions.
SSH
keys must be set up to run remote commands using SSH. For more information, refer to Enabling the
execution of remote commands (Linux® and UNIX).
- Set the default value of the DB2_FORCE_OFFLINE_ADD_PARTITION registry
variable to TRUE to enforce that the 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 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 (db2nodes.cfg)
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 partition, 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 must 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 entire 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 partition. When the utility ends, the new server partitions are stopped.
- Start the database manager by running the START DBM command.
The newly added database partition is 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 might 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 redistributed the data across both the old and the
new database partitions.
- You can also update the configuration file manually, as follows:
- Edit the db2nodes.cfg file and add the new database partition to
it.
- Issue the following command to start the new database partition:
START DBM
DBPARTITIONNUM partitionnum
Specify the number you are assigning to the new database partition as the value of
partitionnum.
- If the new server is to be a logical partition (that is, it is not database partition
0), use db2set command to update the DBPARTITIONNUM registry
variable.
Specify the number of the database partition you are adding.
- Run the ADD DBPARTITIONNUM command on the new database
partition.
This command creates a database partition locally for every database that 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.
- When the ADD DBPARTITIONNUM command completes, issue the
START DBM command to start the other database partitions in the system.
Do not perform any system-wide activities, such as creating or dropping a database, until all
database partitions are successfully started.