sp_dbcc_patch_finishtime  sp_dbcc_runcheck

Chapter 4: dbcc Stored Procedures

sp_dbcc_recommendations

Description

Analyzes faults reported by the checkstorage operation corresponding to the specified operation ID, or date, and generates a list of recommended corrective actions for the specified object in the target database.

Syntax

sp_dbcc_recommendations dbname [,“date”[, opid [, “objectname”]]]

Parameters

dbname

is the name of the database for which recommendations are generated. Type is varchar, and this parameter is required.

date

is a datetime value representing the date and time the dbcc checkstorage operation (for which the reported faults will be analyzed) finished. If you do not specify date or opid, Adaptive Server uses the date of the most recent operation. If you specify both date and opid, Adaptive Server ignores the date. date is optional.

opid

is the operation ID of the checkstorage operation, for which the reported faults will be analyzed. If an opid or date is not specified, Adaptive Server uses the date of the most recent operation. If both date and opid are specified, Adaptive Server ignores the date. The type for this parameter is int.

objectname

is the name of the object for which sp_dbcc_recommendations generates the recommendations. If an objectname is not specified, recommendations for all objects in the database are generated. The type for this parameter is varchar.

Examples

Example 1

Generates a list of recommended fixes for the object t1, in database my_db, based on the faults reported by the checkstorage operation corresponding to operation id 2:

sp_dbcc_recommendations my_db, null, 2, ‘t1’

Example 2

Generates a list of recommended fixes for all objects in database my_db, based on the faults reported by the checkstorage operation that finished on Sep 15 2002 at 7:10:18:463PM:

sp_dbcc_recommendations my_db, ‘Sep 15 2002 7:10:18:463PM’

Example 3

Generates a list of recommended fixes for all objects in database my_db, based on the most recent checkstorage operation:

sp_dbcc_recommendations my_db

Usage

sp_dbcc_recomendations analyzes faults reported by the checkstorage operation corresponding to the specified operation ID, or date, and generates a list of recommended corrective actions for the specified object in the target database

Permissions

Any valid user of the target database can run sp_dbcc_recommendations.





Copyright © 2005. Sybase Inc. All rights reserved. sp_dbcc_runcheck

View this book as PDF