sys.sp_xtp_checkpoint_force_garbage_collection (Transact-SQL)


Updated: August 2, 2016

Marks source files used in the merge operation with the log sequence number (LSN) after which they are not needed and can be garbage collected. Also, it moves the files whose associated LSN is lower than the log truncation point to filestream garbage collection.

Topic link icon Transact-SQL Syntax Conventions

sys.sp_xtp_checkpoint_force_garbage_collection [[ @dbname=database_name]  

The database to run garbage collection on. The default is the current database.

0 for success. Nonzero for failure.

A returned row contains the following information:

num_collected_itemsIndicates the number of files that have been moved to filestream garbage collection. These are the files whose log sequence number (LSN) is less than the LSN of log truncation point
num_marked_for_collection_itemsIndicates the number of data/delta files whose LSN has been updated with the log blockID of the end-of-log LSN.
last_collected_xact_seqnoReturns the last corresponding LSN up to which the files have been moved to filestream garbage collection.

Requires database owner permission.

exec [sys].[sp_xtp_checkpoint_force_garbage_collection] hkdb1  

System Stored Procedures (Transact-SQL)
In-Memory OLTP (In-Memory Optimization)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2014)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Community Additions