select * from sys.dm_db_file_space_usage
We can use the sys.dm_db_file_space_usage dynamic management view to monitor the spaced used by tempdb for storing user/internal objects and version store.
sys.dm_db_file_space_usage has following columns:
1. database_id – will always be 2, database id of tempdb.
2. unallocated_extent_page_count – total number of free extents in the database file
3. version_store_reserved_page_count – pages allocated for version store
4. user_object_reserved_page_count – pages allocated for user objects, these are the permanent object you create explicitly in tempdb, system tables, temporary tables, table variables…
5. internal_object_reserved_page_count – pages allocated for internal objects
for details about other columns returned refer BOL.
No comments:
Post a Comment