Product Documentation

Database Administrator's Guide

Previous Topic

Next Topic

RECYCLE_BIN

The recycle bin is configured with SUBSYSTEM CTFILE RECYCLE_BIN . This subsystem configuration option supports the following options:

  • recycle_folder_name: directory name where the recycle bin is stored and can be absolute or relative. If relative, the directory is relative to the server's LOCAL_DIRECTORY configured directory or current working directory if LOCAL_DIRECTORY is not used.
  • purge_frequency_minutes: time in minutes between checks for files that should be purged from the recycle bin.
  • max_file_age_days: maximum number of days a file is kept in the recycle bin.
  • max_folder_storage_size: maximum total byte size of the files in the recycle bin. If deleting a file causes the recycle bin to go over the limit, files are deleted until the size is below the limit.

Example

subsystem ctfile recycle_bin {

recycle_folder_name deleted_files

purge_frequency_minutes 60

max_file_age_days 30

max_folder_storage_size 1 gb

}

MONITORING

The statistic utility, ctstat supports a deleted_files option listing the total size and detail list of files currently in the recycle bin.

Example

ctstat -deleted_files -u ADMIN -p ADMIN -s FAIRCOMS -i 1 -h 1 -t

Thu Dec 9 15:01:48 2021

Total file size: 917500 for 4 file(s)

Deleted file of size 131071 deleted\1639081086.20211209\qatranrepl097.sup.992

Deleted file of size 131071 deleted\1639081086.20211209\qatranrepl097.sup.998

Deleted file of size 327679 deleted\1639081086.20211209\qatranrepl097.sup.1017

Deleted file of size 327679 deleted\1639081086.20211209\qatranrepl097.sup.1026

NEW SERVER FILES

Two new files are required for tracking inactive files in the recycle bin. RECBINDT.FCS and RECBINIX.FCS are transaction-controlled data and index files retaining data about the current recycle bin state. The data file contains a state record for each deleted file, and a state record that holds the total space in use by deleted files. The index enables the background thread to find files that were deleted from the oldest to newest timestamp.

REPLICATION AGENT CHANGES

The replication agent supports a configuration option to enable whether the agent uses the recycle bin any time it deletes a file on the target server. The ctreplagent.cfg option is delete_to_recycle_bin yes | no and is on by default.

TOCIndex