Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Clear partial audit history

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

My database is growing quickly because of emails sent by Quick Campaign.

The size is now 150 Gb.

Is it possible to clear "some" email (NOT ALL) from Audit History ? Because the delete only move the e-mails to the history and the database size is the same.

Thanks in advance,

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Clear partial audit history

    Thanks. I'll see for this.

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Clear partial audit history

    When you delete records, the space they take up will become available, but it may remain allocated in SQL Server. This allocation works at 2 levels:

    1. At the table and index level. If any page (8K of space) still has at least 1 record, then this is still allocated. To reclaim the space, rebuild the indexes on the table
    2. At the database level. Even if the pages have been freed up, the database size will stay the same (unless you either have Autoshrink enabled). You can shrink the database using SQL Management Studio 

    There will still be space taken up by the SQL transaction log, and deleting a record will add to the transaction log. However, it should be part of your standard database maintenance procedures to periodically truncate the log, preferably by backing it up

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Clear partial audit history

    Thanks for yours answers. But I think that when I delete emails, there are still in the log to recover these emails. So the database size is the same ? No ?

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Clear partial audit history

    To clarify across some of the previous posts:

    Audit data is a record of changes to records of all entity types enabled for audit. This data can only be cleared in bulk by deleting audit logs, which will delete all data based on the time period of the log, and you cannot only delete audit data for some records

    You're referring to clearing email, which I understand means that you want to delete the email records. This you can do with bulk delete jobs, where you can specify criteria for which records to delete. 

    Note that, once you have cleared out records, there may still be allocated space in the SQL database. If you want to reclaim this, you can shrink the database using SQL Management Studio

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,050 on at
    RE: Clear partial audit history

    No you wont be able to selectively delete audit logs.

    What do you mean by  clear email?

    audit logs only store the change history to records they do not store actual records

    You can certainly delete emails and attachments, you can decide which ones you want to keep and which ones you want to delete

    Please refer to the methods recommended by Microsoft

    docs.microsoft.com/.../free-storage-space

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Clear partial audit history

    I've a On Premise CRM 2016 install not 365

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Clear partial audit history

    Thanks but I want to clear only some emails, not an entire log file.

    Is it possible ?

  • Suggested answer
    Rajesh Chungath Profile Picture
    Rajesh Chungath 465 on at
    RE: Clear partial audit history

    Yes you can clear the audit logs from audit log

    1) Settings > Auditing > Audit Log management and delete the old logs

    To reduce the storage also check system job logs. Delete the failed and success job logs on time. Please configure a Bulk delete job to delete the old log files.

    Search for System jobs using advanced find.

    Use power admin to monitor the storage

    admin.powerplatform.microsoft.com/environments

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,050 on at
    RE: Clear partial audit history

    Hi

    Yes you can clear old audit logs, please see below

    Go to Settings Auditing and then Audit Log Management, you can delete audit logs from there

    Delete the older ones first and you may want to keep the recent ones

    [View:/cfs-file/__key/communityserver-discussions-components-files/117/ScreenClip-_5B00_359_5D00_.png]

    [View:/cfs-file/__key/communityserver-discussions-components-files/117/ScreenClip-_5B00_361_5D00_.png]

    Also, follow methods recommended by Microsoft to free up storage space from the following link

    [View:https://docs.microsoft.com/en-us/dynamics365/customer-engagement/admin/free-storage-space]

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,883 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans