IBM Books

Administration Guide


Adding Database Partitions to a System

You can add database partitions to the 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 should 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 system 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 the 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, 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. See "Altering a Nodegroup" for more information on how to update the node configuration file.

Adding Database Partitions to a Running System

You can add new database partitions to a multiple server 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:

    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 in the hosts file in the etc directory on all database partitions.

  2. Run the DB2START command on any database partition, specifying the NODENUM, ADDNODE, HOSTNAME, PORT, and NETNAME parameters. The values that you specify for these parameters are used to update the db2nodes.cfg file. You can also optionally specify the source for any temporary table spaces which need to be created with the databases. If no table space information is provided, the temporary table space definitions are retrieved from the catalog node for each database.

    When the command completes, the new server is stopped. The db2nodes.cfg file is not updated with the new server information until DB2STOP is executed. This ensures that the Add Node utility (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 nodes in the system, the db2nodes.cfg 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.

  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 16. "Redistributing Data Across Database Partitions".

Adding Database Partitions to a Stopped System

You can add new database partition to a multiple server 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 db2nodes.cfg file for you, or you can do it manually. The preliminary steps for both procedures are the same.

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

  1. Issue DB2STOP to stop all the servers.

  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. Install the new processor. This includes making executables accessible (using shared file-system mounts or local copies), synchronizing operating system files with those on existing processors, ensuring that 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 in the hosts file in the etc directory on all database partitions.

    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 db2nodes.cfg".

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

Having the Database Manager Update db2nodes.cfg

Continue the procedure as follows:

  1. Run the DB2START command on the new database partition specifying NODENUM, ADDNODE, HOSTNAME, PORT, and NETNAME parameters. The values that you specify for these parameters are used to update the db2nodes.cfg file.

    When the command completes, the new server is stopped. The db2nodes.cfg file is not updated with the new server information until DB2STOP is executed. This ensures that the Add Node utility (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 db2nodes.cfg file is updated to include the new server.

  3. Issue the DB2START command to start the database system.

  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 16. "Redistributing Data Across Database Partitions".

Updating db2nodes.cfg Manually

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 utility on the new server.

    This utility also causes a database partition to be created locally for every database that already exists in the system. The database parameters for the new partitions are set to the default value, and each partition remains empty until you move data to it.

  5. When the Add Node utility 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 servers are successfully started.

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

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


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

[ DB2 List of Books | Search the DB2 Books ]