Delete historical partitions¶
This page describes the safe procedure for removing historical database partitions from HDB and IDB.
The safest way of removing historical partitions is to adjust the hdbRetPrtns configuration parameter to your desired partition retention period (see Dynamic parameters). However, if there is a portion of the database that you wish to target for deletion immediately, you can delete specific historical partitions by following these steps:
Warning
You should never attempt to write separate processes to delete tables; this contravenes the expectation that DBW is in charge of all writes and could cause major problems.
-
Stop KX Sensors.
kxsctl stop <node> -
Go to the HDB directory.
- Go to HDB link directory (could be
hdb.0orhdb.1). - Delete the required partitions using the appropriate O/S remove command.
- Go to the HDB data directory.
- Delete the same partitions that were deleted from the HDB link directory in step 4.
-
Start KX Sensors.
kxsctl start <node>
Delete partitions from IDB¶
The same process defined for deleting historical partitions from HDB can be applied to IDB, with two critical exceptions:
- Do not delete the "0" directory because this contains the MRU tables.
- Do not delete the most recent partition (partition with the highest number) because it contains the master data tables.
Next steps¶
- HDB files and IDB files — the directory structures these deletion steps operate on.
- Recover your data — restore partitions from backup if a deletion goes wrong.
- Row-level retention — remove rows within a partition on a schedule, instead of deleting the whole partition.