Preparing to use dbcc checkstorage

Before you can use dbcc checkstorage, you must configure Adaptive Server and set up the dbccdb database. Table 26-3 summarizes the steps and commands in the order you should use them. Each action is described in detail in the following sections.

NoteThe examples in this section assume a server that uses 2K logical pages.

WARNING! Do not attempt to perform the actions or use the commands in Table 26-3 before you read the information in the referenced section. You must understand the consequences of each action before you make any changes.

Table 26-3: Tasks for preparing to use dbcc checkstorage

For this action

See

Use this command

1. Obtain recommendations for database size, devices (if dbccdb does not exist), workspace sizes, cache size, and the number of worker processes for the target database.

“Planning resources”

“Planning workspace size”

use master

sp_plan_dbccdb

2. If necessary, adjust the number of worker processes that Adaptive Server uses.

“Configuring worker processes”

sp_configure

number of worker processes

memory per worker process

3. Optional – create a named cache for dbcc.

“Setting up a named cache for dbcc”

sp_cacheconfig

4. Configure a your buffer pool.

“Configuring an 8-page I/O buffer pool”

sp_poolconfig

5. If dbccdb already exists, drop it and all associated devices before creating a new dbccdb database.

drop database

6. Initialize disk devices for the dbccdb data and the log.

“Allocating disk space for dbccdb”

disk init

7. Optional – create dbccdb on the data disk device.

create database

8. Optional – add disk segments.

“Segments for workspaces”

use dbccdb

9. Populate the dbccdb database and install dbcc stored procedures.

isql -Usa -P -i
$SYBASE/scripts/installdbccdb

10. Create the workspaces.

“dbccdb workspaces” in Chapter 59, “dbccdb Tables” in the Reference Manual

sp_dbcc_createws

11. Update configuration values.

“Updating the dbcc_config table”

sp_dbcc_updateconfig
   max worker processes
   dbcc named cache
   scan workspace
   text workspace
   OAM count threshold
   IO error abort
   linkage error abort

Notedbcc checkstorage runs its checks against the database on disk. If the corruption is only in memory, dbcc may not detect it. To ensure consistency between two sequential dbcc checkstorage commands, first run a checkpoint. However, this can have the side-effect of turning a transient memory corruption into corruption on disk