Home > database >  Tempdb for size problem
Tempdb for size problem

Time:02-23

In the great god, why dm_db_session_space_usage (user_objects_alloc_page_count + internal_objects_alloc_page_count) is greater than the tempdb for file size?

CodePudding user response:

In addition to the assigned number of pages, may also need to consider is to release the number of pages, the corresponding field: user_objects_dealloc_page_count, internal_objects_dealloc_page_count.
Tempdb for the use of dynamic allocation and release process.

CodePudding user response:

reference 1/f, started the first response:
in addition to the assigned number of pages, may also need to consider the release of the number of pages, corresponding field: user_objects_dealloc_page_count, internal_objects_dealloc_page_count.
Tempdb for the use of dynamic allocation and release process.
released field [user_objects_dealloc_page_count, internal_objects_dealloc_page_count] more

CodePudding user response:

reference 1/f, started the first response:
in addition to the assigned number of pages, may also need to consider the release of the number of pages, corresponding field: user_objects_dealloc_page_count, internal_objects_dealloc_page_count.
Tempdb for the use of dynamic allocation and release process.
file size 7-8 G, but [user_objects_alloc_page_count + internal_objects_alloc_page_count] more than 300 G

CodePudding user response:

SQL is wrote
 select session_id, user_objects_alloc_page_count=sum (user_objects_alloc_page_count * 8.0/1024/1024), internal_objects_alloc_page_count=sum (internal_objects_alloc_page_count * 8.0/1024/1024) 
The from (
The select session_id, user_objects_alloc_page_count internal_objects_alloc_page_count
The from tempdb for. Sys. Dm_db_task_space_usage (nolock)
Where database_id=2
Union all
The select session_id, user_objects_alloc_page_count internal_objects_alloc_page_count
The from tempdb for. Sys. Dm_db_session_space_usage (nolock)
Where database_id=2
) a
Group by session_id

CodePudding user response:

Assigned the number of pages - released the number of pages=the actual distribution of the number of pages?

CodePudding user response:

refer to fifth floor started the first response:
assigned the number of pages - released the number of pages=the actual distribution of the number of pages?
wrong, also has some negative and 67 g
  • Related