IBM Books

Administration Guide


Adding Database Partitions to a Partitioned Database System

You can add database partitions to the partitioned database system either when it is running, or when it is stopped. The following sections describe how to do this task. Because adding a new server can be time consuming, you may want to do it when the database manager is already running. The procedure is described in Adding Database Partitions to a Running System.

The ADD NODE command is used to add a database partition to a system. This command can be invoked:

The method you use to invoke the command is dependent upon whether your system is stopped (using db2start) or running (using any of the other choices).

When a new database partition is added to the system using the ADD NODE command, all existing databases in the instance are created on the new database partition. You can also specify which containers for temporary table spaces will be used with the databases that are created. The containers can be:

A database on the new partition cannot be used to contain data until one or more nodegroups are altered to include the new database partition. See Adding and Dropping Database Partitions for more information on how to alter a nodegroup.
Note:If there are no databases defined in the system and you are running DB2 Enterprise - Extended Edition on a UNIX-based system, edit the db2nodes.cfg file to add a new database partition definition; do not use any of the following procedures, as an error will result. Refer to "Altering a Nodegroup" in the Administration Guide, Design and Implementation for more information on how to update the node configuration file.
Windows NT Considerations:If you are using DB2 Enterprise - Extended Edition on Windows NT and have no databases in the instance, you should use the DB2NCRT command to scale the database system. For information about this command, refer to the Command Reference. If, on the other hand, you already have databases, you should use the DB2START ADDNODE command, as this ensures that a database partition is created for each existing database when you scale the system. For information about the DB2START command and the parameters that you must use on Windows NT, refer to the Command Reference. On Windows NT, you should never manually edit the node configuration file (db2nodes.cfg), as this can introduce inconsistencies into the file.

Adding Database Partitions to a Running System

You can add new database partitions to a partitioned database system while it is running and while applications are connected to databases. However, a newly added server does not become available to all databases until the database manager is shut down and restarted.

To add a database partition to a multiple server system:

  1. If the database partition is to be created on a server that already exists in the system, go to the next step. Otherwise, do the following:

  2. Run the DB2START command on any database partition, specifying the NODENUM, ADDNODE, HOSTNAME, PORT, and NETNAME parameters. On the Windows NT platform, you must also specify the COMPUTER, USER, and PASSWORD parameters. For more information about the DB2START command, refer to the Command Reference.

    You can also optionally specify the source for any temporary table space container definitions that need to be created with the databases. If no table space information is provided, the temporary table space container definitions are retrieved from the catalog node for each database.

    When the command completes, the new server is stopped. The node configuration file is not updated with the new server information until DB2STOP is executed. This ensures that the ADD NODE command (which is called when the ADDNODE parameter is specified) runs on the correct database partition. When the utility ends, the new server is stopped.

  3. Stop the database manager by running the DB2STOP command.

    When you stop all the database partitions in the system, the node configuration file is updated to include the new database partition.

  4. Start the database manager by running the DB2START command.

    The newly added database partition is now started along with the rest of the system.

    When all the database partitions in the system are running, system-wide activities, such as creating or dropping a database, can be done.
    Note:You may have to issue the DB2START command twice for all database partition servers to access the new db2nodes.cfg file.

  5. Optionally, take a backup of all databases on the new database partition.

  6. Optionally, redistribute data to the new database partition. For details, see Chapter 26, Redistributing Data Across Database Partitions.

Adding Database Partitions to a Stopped System

You can add new database partition to a partitioned database system while it is stopped. The newly added server becomes available to all databases when the database manager is started up again. You have two options. You can either have the database manager update the node configuration file for you, or you can do it manually. The preliminary steps for both procedures are the same.
Note:You should not update the node configuration file manually while working on Windows NT. Instead, you should use the database manager to update this file.

To add a new database partition to a multiple server system:

  1. Issue DB2STOP to stop all the database partitions.

  2. If the server is to be created on a processor that already exists in the system, go to the next step. Otherwise, do the following:

    1. On UNIX platforms,

      1. Install the new server. This includes making executables accessible (using shared file-system mounts or local copies), synchronizing operating system files with those on existing processors, ensuring that the sqllib directory is accessible as a shared file system, and ensuring that the relevant operating system parameters (such as the maximum number of processes) are set to the appropriate values.

      2. Register the host name with the name server or in the hosts file in the etc directory on all database partitions.

    2. On Windows NT platforms,

      1. Install the new server.

      2. Run the ADD NODE command on the new server. This command causes a database partition to be 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.

      3. Run the DB2START command to start the database system. Note that the node configuration file (db2nodes.cfg) has already been updated to include the new server during the installation of the new server.

      4. Optionally redistribute data onto the new server. See Chapter 26, Redistributing Data Across Database Partitions for more details on how to do this.

    3. If you want the database manager to update the db2nodes.cfg file for you, continue with the instructions in Having the Database Manager Update the Node Configuration File.
      Note:On Windows NT, you should not edit the db2nodes.cfg file manually, as this can introduce inconsistencies into the file. Instead, you should have the database manager update this file.

      If you want to update the db2nodes.cfg file yourself, continue with the instructions in Updating the Node Configuration File Manually.

Having the Database Manager Update the Node Configuration File

Continue the procedure as follows:

  1. Run the DB2START command on the new database partition specifying NODENUM, ADDNODE, HOSTNAME, PORT, and NETNAME parameters. On the Windows NT platform, you must also specify the COMPUTER, USER, and PASSWORD parameters. For more information about the DB2START command, refer to the Command Reference. The values that you specify for these parameters are used to update the node configuration file.

    When the command completes, the new server is stopped. The node configuration file is not updated with the new server information until DB2STOP is executed. This ensures that the ADD NODE command (which is called when the ADDNODE parameter is specified) runs on the correct database partition. When the utility ends, the new server is stopped.

  2. Issue the DB2STOP command.

    When you issue the DB2STOP command, the node configuration file is updated to include the new server.

  3. Issue the DB2START command to start the database system.
    Note:You may have to issue the DB2START command twice for all database partition servers to access the new node configuration file.

  4. Optionally, take a backup of all databases on the new database partition.

  5. Optionally, redistribute data to the new server. For details, see Chapter 26, Redistributing Data Across Database Partitions.

Updating the Node Configuration File Manually

Note:On Windows NT, you should not edit the node configuration file manually, as this can introduce inconsistencies into the file. Instead, you should have the database manager update this file.

Continue the procedure as follows:

  1. Edit the db2nodes.cfg file and add the new database partition to it.

  2. Issue the following command to start the new node:
      DB2START NODENUM nodenum
    

    Specify the number you are assigning to the new database partitioned server as the value of nodenum.

  3. If the new server is to be a logical database partition (that is, it is not node 0), use db2set command to update the DB2NODE registry value, specifying the number of the server you are adding.

  4. Run the ADD NODE command on the new server.

    This command also causes a database partition to be 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.

  5. When the ADD NODE command completes, issue the DB2START command to start the other database partitions in the system.

    You should not attempt to do any system-wide activities, such as creating or dropping a database, until all database partitions are successfully started.

  6. Optionally, take a backup of all new database partitions on the new server.

  7. Optionally, redistribute data to the new database partition. For details, see Chapter 26, Redistributing Data Across Database Partitions.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]