DBCC Flashcards
DBCC INPUTBUFFER
Displays the last statement sent from a client to an instance of Microsoft SQL Server.
DBCC OPENTRAN
Displays information about the oldest active transaction and the oldest distributed and nondistributed replicated transactions, if any, within the specified database.
DBCC OUTPUTBUFFER
Returns the current output buffer in hexadecimal and ASCII format for the specified session_id.
DBCC PROCCACHE
Displays information in a table format about the procedure cache.
DBCC SHOW_STATISTICS
DBCC SHOW_STATISTICS displays current query optimization statistics for a table or indexed view.
DBCC SHOWCONTIG
Displays fragmentation information for the data and indexes of the specified table or view.
Deprecated: Use sys.dm_db_index_physical_stats
DBCC SQLPERF
Provides transaction log space usage statistics for all databases. It can also be used to reset wait and latch statistics.
DBCC TRACESTATUS
Displays the status of trace flags.
DBCC USEROPTIONS
Returns the SET options active (set) for the current connection.
DBCC CHECKALLOC
Checks the consistency of disk space allocation structures for a specified database.
DBCC CHECKCATALOG
Checks for catalog consistency within the specified database. The database must be online.
DBCC CHECKCONSTRAINTS
Checks the integrity of a specified constraint or all constraints on a specified table in the current database.
DBCC CHECKDB
Checks the logical and physical integrity of all the objects in the specified database by performing the following operations:
- Runs DBCC CHECKALLOC on the database.
- Runs DBCC CHECKTABLE on every table and view in the database.
- Runs DBCC CHECKCATALOG on the database.
- Validates the contents of every indexed view in the database.
- Validates link-level consistency between table metadata and file system directories and files when storing varbinary(max) data in the file system using FILESTREAM.
- Validates the Service Broker data in the database.
DBCC CHECKFILEGROUP
Checks the allocation and structural integrity of all tables and indexed views in the specified filegroup of the current database.
DBCC CHECKIDENT
Checks the current identity value for the specified table in SQL Server and, if it is needed, changes the identity value. You can also use DBCC CHECKIDENT to manually set a new current identity value for the identity column.
DBCC CHECKTABLE
Checks the integrity of all the pages and structures that make up the table or indexed view.
DBCC CLEANTABLE
Reclaims space from dropped variable-length columns in tables or indexed views.
DBCC DBREINDEX
Rebuilds one or more indexes for a table in the specified database.
Deprecated: Use ALTER INDEX
DBCC DROPCLEANBUFFERS
Removes all clean buffers from the buffer pool.
DBCC FREEPROCCACHE
Removes all elements from the plan cache, removes a specific plan from the plan cache by specifying a plan handle or SQL handle, or removes all cache entries associated with a specified resource pool.
DBCC INDEXDEFRAG
Defragments indexes of the specified table or view.
Deprecated: Use ALTER INDEX
DBCC SHRINKDATABASE
Shrinks the size of the data and log files in the specified database.
DBCC SHRINKFILE
Shrinks the size of the specified data or log file for the current database, or empties a file by moving the data from the specified file to other files in the same filegroup, allowing the file to be removed from the database. You can shrink a file to a size that is less than the size specified when it was created. This resets the minimum file size to the new value.
DBCC UPDATEUSAGE
Reports and corrects pages and row count inaccuracies in the catalog views. These inaccuracies may cause incorrect space usage reports returned by the sp_spaceused system stored procedure.
DBCC dllname (FREE)
Unloads the specified extended stored procedure DLL from memory.
DBCC FREESESSIONCACHE
Flushes the distributed query connection cache used by distributed queries against an instance of Microsoft SQL Server.
DBCC FREESYSTEMCACHE
Releases all unused cache entries from all caches. The SQL Server Database Engine proactively cleans up unused cache entries in the background to make memory available for current entries. However, you can use this command to manually remove unused entries from all caches or from a specified Resource Governor pool cache.
DBCC HELP
Returns syntax information for the specified DBCC command.
DBCC TRACEOFF
Disables the specified trace flags.
DBCC TRACEON
Enables the specified trace flags.
DBCC MEMORYSTATUS
The DBCC MEMORYSTATUS command provides a snapshot of the current memory status.