RE: Database cleanup in CRM
Hey Aisha.
on https://docs.microsoft.com/en-us/power-platform/admin/free-storage-space you have the information. Basically, there are three types of storage (Database, File and Logs). Depending on what's consuming the most, you can follow the instructions on that documentation but basically, it all reduces to deleting data. Having a clear understanding and rules with business decision holders (We need to keep last 6 months of auditing, and emails+attachments from the last 2 years) is key in order to generate bulk deletion jobs that keep consistent these policies.
On the other hand, you should also avoid having too many system jobs with status "waiting" and "Waiting for resources" as they will affect tables like AsyncOperation.
You can use either the built-in functionality on Dynamics to create bulk deletion jobs or use any other tool (Kingswaysoft, SQL Server Integration Services) to perform API Calls and delete such content. All tools will use Dynamics APIs to work, as working directly over the DB (online) is not allowed.
Regards,