Preparing to use dbcc checkstorage

Before you can use dbcc checkstorage, configure Adaptive Server and set up the dbccdb database. Table 11-3 summarizes the steps and commands in the order you should use them.

Each action is described in detail in the following sections. The examples in this section assume a server that uses 2K logical pages.

Table 11-3: 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 processes

3. (Optional) Create a named cache for dbcc.

“Setting up a named cache for dbcc”

sp_cacheconfig

4. Configure 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/$SYBASE_ASE/scripts /installdbccdb

Notedbcc checkstorage runs its checks against the database on disk. If a corruption exists only in memory, dbcc may not detect it. To ensure consistency between two sequential dbcc checkstorage commands, first run a checkpoint. Be aware that running checkpoint may turn a transient memory corruption into a disk corruption.