SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

The Automated DBA: Space Usage Snapshotter Lite (non-sysadmin dbo)

By Jesse Roberge,

By Jesse Roberge - YeshuaAgapao@Yahoo.com

The SpaceLog builder
Records database space usage and buffer cache usage statistics into the SpaceLog_* tables.
Keeps a record of database and table growth for reporting of growth trends.
Stats include Reserved, Used, Data, and buffer cache page counts for row, lob (VarChar-Max, text etc), and overflow data (data rows with varchar columns going over 8000 bytes).
Stats also include some computed columns such as BTree (Used-Data), unused (Reserved-Used), and sums of row+lob+overflow for each of reserved, used, data, and buffer.
The database, dataspace, schema, and table levels give stats for the nonclustered index and the table itself (heap or clustered index).
The lite version does not require VIEW_SERVER_STATE permission and can be used in environments where the user has only dbo access. The columns for buffer cache stats will be all zeroes.
It does require the VIEW_DATABASE_STATE permission, which a user in the db_owner database role automatically has.

Required Input Parameters

Optional Input Parameters
@UpdateUsage tinyint=0 Default and recommended to be off. Use only if you must have the most accurate and up to date numbers. Will run DBCC UpdateUsage to scan every table in the database to re-count all allocations and rows, which can hog disk IO for serveral hours.

EXECUTE Admin.Util_BuildSpaceLogLite @UpdateUsage=0


Total article views: 1231 | Views in the last 30 days: 1
Related Articles

Limit buffer pool memory amount by database

Limit buffer pool memory amount by database


The Automated DBA: Space Usage Snapshotter (sysadmin; central DB)

Records snapshots of space usage & buffer cache usage stats by partition, index, table, schema, file...


Urgent Requirement

Database cleaning... Help required....


Problem with column name

using reserved word


Frech Buffer size

Frech Buffer size