Maybe you don't want to shrink them
A reader, February 19, 2023 - 6:37 pm UTC
Hi Ashta,
You say you will do this at a regular basis, as part of an archiving process.
To me that sounds like you actually don't want to do it.
1. Table A at 100G
2. Your archiving runs, deletes 20G
3. You shrink table to 80G
4. Time goes, table A is back at 100G
5. Your archiving runs...
And so on
Just keep the table as is, the new rows will populate space from rows deleted.
Do not shrink it (Unless you have done some very special, one-off delete, and really need that space)
Else, and not knowing anything about your archiving process, but if you can - Partition your tables by some timestamp, drop oldest instead.
BR
Peter
February 20, 2023 - 4:16 am UTC
excellent points