Database/MS-SQL

[스크랩] ghost cleanup

99iberty 2017. 10. 24. 17:18



1. 수동으로 ghost cleanup task 수행

http://masterjoe.tistory.com/entry/%EB%A9%80%EC%A9%A1%ED%95%98%EA%B2%8C-%EB%8F%8C%EC%95%84%EA%B0%80%EB%8D%98-SQL-%EC%9D%B4-%EA%B0%91%EC%9E%90%EA%B8%B0-Lock-%EC%9D%B4-%EB%B0%9C%EC%83%9D%ED%95%98%EB%A9%B0-%EB%A9%88%EC%B6%98%EB%8B%A4%EB%A9%B41-Ghost-Cleanup


DBCC ForceGhostCleanup

---> 업무부하가 덜한 시간에 수행 필요



2. 현재 Ghost Row (ghost record) 확인 방법

http://www.sqlserver-dba.com/2013/03/how-to-check-for-sql-ghost-records.html

SELECT

db_name(database_id),
object_name(object_id),
ghost_record_count,
version_ghost_record_count
 
FROM sys.dm_db_index_physical_stats(DB_ID(N'db_name'), OBJECT_ID(N'table_name'), NULL, NULL , 'DETAILED');