DB2 Version 9.7 for Linux, UNIX, and Windows

How automatic storage table spaces manage storage expansion

If you are using automatic storage table spaces, the database manager creates and extends containers as needed. If you add storage to the database, new containers are created automatically. How the new storage space gets used, however, depends on whether you REBALANCE the table space or not.

When an automatic storage table space is created, the database manager creates a container on each of the storage paths of the automatic storage database (where space permits). Once all of the space in a table space is consumed, the database manager automatically grows the size of the table space by extending existing containers or by adding a new stripe set of containers.

Storage for automatic table spaces is managed at the database level; that is, you add storage to the database, rather than to table spaces as you do with DMS table spaces. When you add storage to a database, the automatic storage feature will create new containers as needed to accommodate data. However, table spaces that already exist will not start consuming storage on the new paths immediately. When a table space needs to grow, the database manager will first attempt to extend those containers in the last range of the table space. A range is all the containers across a given stripe set. If this is successful, applications will start using that new space. However, if the attempt to extend the containers fails, as might happen when one or more of the file systems are full, for example, the database manager will attempt to create a new stripe set of containers. Only at this point does the database manager consider using the newly added storage paths for the table space. Figure 1 illustrates this process.
Figure 1. How automatic storage adds containers as needed
Adding a storage path in DB2 9.5
In the preceding diagram:
  1. The table space starts out with two containers that have not yet reached their maximum capacity. A new storage path is added to the database using the ALTER DATABASE statement with the ADD STORAGE clause. However, the new storage path is not yet being used.
  2. The two original containers reach their maximum capacity.
  3. A new stripe set of containers is added, and they start to fill up with data.
  4. The containers in the new stripe set reaching their maximum capacity.
  5. A new stripe set is added because there is no room for the containers to grow.
If you want to have the automatic storage table space start using the newly added storage path immediately, you can perform a rebalance, using the REBALANCE clause of the ALTER TABLESPACE command. If you rebalance your table space, the data will be reallocated across the containers and stripe sets in the newly-added storage. This is illustrated in Figure 2.
Figure 2. Results of adding new storage and rebalancing the table space
Adding new storage and rebalancing the table space
In this example, rather than a new stripe set being created, the rebalance expands the existing stripe sets into the new storage path, creating containers as needed, and then reallocates the data across all of the containers.