Administration Guide
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:
- As an option on db2start
- Using:
- The command line processor ADD NODE command
- The sqleaddn_api
- The sqlepstart_api.
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:
- The same as those defined for the catalog node for each database. (This is
the default.)
- The same as those defined for another partition.
- Not created at all. The ALTER TABLESPACE statement must be used to add
temporary table space containers to each database before the database can be
used.
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.
|
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:
- 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:
- 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.
- Register the host name with the name server in the hosts file
in the etc directory on all database partitions.
- 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.
- 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.
- 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.
- Optionally, take a backup of all databases on the new database partition.
- Optionally, redistribute data to the new database partition. For details,
see Chapter 16. "Redistributing Data Across Database Partitions".
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:
- Issue DB2STOP to stop all the servers.
- 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:
- 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.
- Register the host name with the name server in the hosts file
in the etc directory on all database partitions.
- 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".
Continue the procedure as follows:
- 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.
- Issue the DB2STOP command.
When you issue the DB2STOP command, the db2nodes.cfg file is
updated to include the new server.
- Issue the DB2START command to start the database system.
- Optionally, take a backup of all databases on the new database partition.
- Optionally, redistribute data to the new server. For details, see Chapter 16. "Redistributing Data Across Database Partitions".
Continue the procedure as follows:
- Edit the db2nodes.cfg file and add the new database partition
to it.
- 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.
- 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.
- 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.
- 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.
- Optionally, take a backup of all databases on the new server.
- 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 ]