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.
The 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.
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. |
use master sp_plan_dbccdb |
|
2. If necessary, adjust the number of worker processes that Adaptive Server uses. |
sp_configure |
|
3. Optional – create a named cache for dbcc. |
sp_cacheconfig |
|
4. Configure a your 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. |
disk init |
|
7. Optional – create dbccdb on the data disk device. |
create database |
|
8. Optional – add disk segments. |
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. |
sp_dbcc_updateconfig max worker processes dbcc named cache scan workspace text workspace OAM count threshold IO error abort linkage error abort |
dbcc 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