Planning workspace size

Two workspaces are required for dbccdb: scan and text. Space requirements for these workspaces depend on the size of the largest database that will be checked. To run concurrent dbcc checkstorage operations, set up additional workspaces.


Determining the sIze for the largest database to be checked

Different databases can use the same workspaces. Therefore, the workspaces must be large enough to accommodate the largest database with which they will be used.

Notesp_plan_dbccdb suggests workspace sizes—the following details for determining the workspace size are provided for background information only.

Each page in the target database is represented by one 18-byte row in the scan workspace. This workspace should be approximately 1.1 percent of the target database size.

Every non-null text column in the target database inserts a 22-byte row in the text workspace. If there are n non-null text columns in the target database, the size of the text workspace must be at least (22 * n) bytes. The number of non-null text columns is dynamic, so allocate enough space for the text workspace to accommodate future demands. The minimum space required for the text workspace is 24 pages.


Number of workspaces that can be used concurrently

You can configure dbccdb to run dbcc checkstorage concurrently on multiple databases. This is possible only when the second and subsequent dbcc checkstorage operations have their own dedicated resources. To perform concurrent dbcc checkstorage operations, each operation must have its own scan and text workspaces, worker processes, and reserved cache.

The total space requirement for workspaces depends on whether user databases are checked serially or concurrently. If you run dbcc checkstorage operations serially, the largest scan and text workspaces can be used for all user databases. If you run dbcc checkstorage operations concurrently, set dbccdb to accommodate the largest workspaces that will be used concurrently. Determine the workspace sizes by adding the sizes of the largest databases that will be checked concurrently.

See “dbccdb Tables” in the Reference Manual: Tables.


Automatic workspace expansion

The sp_dbcc_updateconfig. . automatic workspace expansion option indicates whether checkstorage automatically resizes the workspace, if necessary.

At the beginning of a checkstorage run, the size of the workspace is validated. If more space is needed, and automatic workspace expansion is enabled, checkstorage automatically expands the workspace if adequate space is available on the respective segments. If more space is needed, and automatic workspace expansion is not enabled, checkstorage exits and prints an informative message.

A value of 1 (the default value) enables automatic workspace expansion. A value of 0 disables automatic workspace expansion. See the Reference Manual: Procedures.


Default scan and text workspaces

Default scan and text workspaces are created when you run the installdbccdb script. The name of the default scan workspace is def$scan$ws and its size is 256K. The default text workspace is named def$text$ws and its size is 128K. These default workspaces are used if you have not configured default workspaces and the target database does not have configured workspace values.