We have deleted a large part of the data from a two-digit terabyte sized database, and would now like to release some of the space back to the operating system. The database is currently about 80 % unused space. It will never reach its former size again (the load has been transferred elsewhere).
We have tried running SHRINKDATABASE on a copy of the database on a separate server (non-production). Running for 2 days (on our hardware) it was able to release the space.
I'm assuming it will take much longer on the database in production, as this is heavily used (mostly for querying now though, less so inserts).
Only hours of downtime (at a time) is acceptable on the production system. Some performance degrade over extended periods would be acceptable too.
Any ideas on how to release this amount of unused space, without having excessive downtime, or introduce severe performance degrade during the process?