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.
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. |
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:
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.
When you stop all the database partitions in the system, the node configuration file is updated to include the new database partition.
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. |
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:
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.
Continue the procedure as follows:
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.
When you issue the DB2STOP command, the node configuration file is updated to include the new server.
Note: | You may have to issue the DB2START command twice for all database partition servers to access the new node configuration file. |
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:
DB2START NODENUM nodenum
Specify the number you are assigning to the new database partitioned server as the value of nodenum.
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.
You should not attempt to do any system-wide activities, such as creating or dropping a database, until all database partitions are successfully started.