EXTEND DBSPACE (Increase space for the database)
Use this command to increase space for the database by adding directories for the database to use.
Privilege class
To issue this command, you must have system privilege or unrestricted storage privilege.
When you issue the EXTEND DBSPACE command, directories are added to the database. With the default parameter settings, data is redistributed across all database directories, and storage space is reclaimed. This action improves parallel I/O performance and makes the new directory space available for immediate use.
If you do not want to redistribute data when you add new directories, you can specify RECLAIMSTORAGE=NO. If you specify No for this parameter, all space in existing directories is filled before new directories are used. You can redistribute data and reclaim space later, but you must complete the manual procedure for this task by using DB2 commands.
- Complete the process when the server is not handling a heavy workload.
- The time that is required to redistribute data and reclaim space might vary. It is affected by factors such as the file system layout, the ratio of new paths to existing storage paths, server hardware, and concurrent operations. To get a rough estimate, you can try the operation with a small Tivoli Storage Manager database on a lab system. Use your results as a reference to estimate the time that is required for the procedure.
- Do not interrupt the redistribution process. If you try to stop it, for example, by halting the process that is completing the work, you must stop and restart the DB2® server. When the server is restarted, it will go into crash recovery mode, which takes several minutes, after which the redistribution process resumes.
After an operation to extend the database space is complete, halt and restart the server to fully use the new directories. If the existing database directories are nearly full when a new directory is added, the server might encounter an out of space condition (reported in the db2diag.log). You can fix the out of space condition by halting and restarting the server.
Syntax
.-,------------. V | >>-EXTend DBSpace----db_directory-+-----------------------------> .-REClaimstorage--=--Yes-----. .-Wait--=--No------. >--+----------------------------+--+------------------+-------->< '-REClaimstorage--=--+-No--+-' '-Wait--=--+-No--+-' '-Yes-' '-Yes-'
Parameters
- db_directory (Required)
- Specifies the directories for database storage. The directories must be empty and accessible by
the user ID of the database manager. A directory name must be a fully qualified name and cannot
exceed 175 characters in length. Enclose the name in quotation marks if it contains embedded blanks,
an equal sign, or other special characters. If you are specifying a list of directories for database
storage, the maximum length of the list can be 1400 characters.Restriction: You cannot specify Universal Naming Convention (UNC) paths.Tip: Specify directories that are the same size as existing directories to ensure a consistent degree of parallelism for database operations. If one or more directories for the database are smaller than the others, they reduce the potential for optimized parallel prefetching and distribution of the database.
- REClaimstorage
- Specifies whether data is redistributed across newly created database
directories and space is reclaimed from the old storage paths.
This parameter is optional. The default value is Yes.
Unless you specify WAIT=YES, the operation is completed as a background process.
- Yes
- Specifies that data is redistributed so that new directories are
available for immediate use.Important: The redistribution process uses considerable system resources so ensure that you plan ahead.
After the process starts, messages are issued to inform you about the progress. You can use the QUERY PROCESS command to monitor the operation. To cancel the process, you can use the CANCEL PROCESS command, but if a data redistribution operation is in progress, it completes before the process is stopped.
- No
- Specifies that data is not redistributed across database directories and storage space is not reclaimed when space is added for the database.
- Wait
- Specifies whether this command is processed in the background
or foreground.
- No
- Specifies background processing. The default is NO.
- Yes
- Specifies foreground processing.
You cannot specify YES from the server console.
Example: Add directories to the storage space for the database, redistribute data, and reclaim storage
Add two directories (/tsm_db/stg1 and tsm_db/stg2) under the /tsm_db directory to the storage space for the database. Issue the command:extend dbspace /tsm_db/stg1,/tsm_db/stg2
Example: Add drives to the storage space for the database, redistribute data, and reclaim storage
Add drives D and E to the storage space for the database. Issue the command:extend dbspace D:,E:
Related commands
Command | Description |
---|---|
DSMSERV EXTEND DBSPACE | Adds directories to increase space for use by the database. |
QUERY DB | Displays allocation information about the database. |
QUERY DBSPACE | Displays information about the storage space defined for the database. |