Creates a workspace of the specified type and size on the specified segment and database.
sp_dbcc_createws dbname, segname, [wsname], wstype, "wssize[K|M]"
is the name of the database in which the workspace is to be created. Values are dbccdb and dbccalt.
is the name of the segment for the workspace.
is the name of the workspace. If the value is null, sp_dbcc_createws generates the name scan_wsnnnnnn for the scan workspace and text_wsnnnnnn for the text workspace, where nnnnnn is a unique 6-digit number.
specifies the type of workspace to be create. Values are scan and text.
is the workspace size, specified with K (kilobytes) or M (megabytes). If you do not specify K or M, wssize specifies the number of pages. The minimum size for a workspace is 24 pages.
Creates a 10MB scan workspace named scan_wspubs2 on the scanseg segment in dbccdb:
sp_dbcc_createws dbccdb, scanseg, scan_wspubs2, scan, "10M"
Creates a 14MB scan workspace named text_ws000001 on the textseg segment in dbccdb:
sp_dbcc_createws dbccdb, textseg, text, "14M"
sp_dbcc_createws creates a workspace with the specified name and size and initializes it.
Before you create a workspace, create the segment with sp_addsegment.
Before you create a workspace, make sure you have configured a buffer pool of at least 16K, to achieve maximum performance.
When you create a workspace, make sure to add a 5% overhead on the space needed on the device because of large page allocation scheme used when creating the workspace.
Use sp_plan_dbccdb to determine size estimates.
After creating a workspace, run sp_dbcc_updateconfig to record the new configuration information in dbcc_config.
Each workspace must have a unique name.
To delete a workspace, in dbccdb issue:
drop table workspace_name
The permission checks for sp_dbcc_createws differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be the database owner of dbccdb (or dbccalt). |
Granular permissions disabled |
With granular permissions disabled, you must be the database owner of dbccdb (or dbccalt), or have sa_role to run sp_dbcc_createws. |
See the System Administration Guide for more information on the scan and text workspaces, and the dbccalt database.
Commands dbcc
dbcc stored procedures sp_dbcc_alterws, sp_dbcc_evaluatedb
System procedures sp_addsegment, sp_plan_dbccdb, sp_helpsegment