Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Audit partition anomaly

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I've noticed there is a rogue partition that can only be viewed from SQL. Anyone have any ideas how to remove it safely?

0268.crm-audit.PNG

sql-audit.PNG

I've used the following query to view it within SQL

IF (CONVERT(int, (SELECT SERVERPROPERTY('EngineEdition'))) = 3) 
        BEGIN 
                SELECT  partition_number AS 'PartitionNumber' 
                                , prv.value AS 'End Date' 
                                , used_page_count*8 AS 'Size in KB' 
                FROM sys.dm_db_partition_stats pst LEFT OUTER JOIN sys.partition_range_values prv ON prv.boundary_id = pst.partition_number 
                WHERE object_id = object_id('AuditBase') 
                AND index_id in (0,1) 
        END 
ELSE 
        BEGIN 
                SELECT  DATENAME(qq, CreatedOn) AS 'Quarter' 
                                , YEAR(CreatedOn) AS 'Year' 
                                , COUNT(*) AS 'Rows' 
                FROM AuditBase 
                GROUP BY DATENAME(qq, CreatedOn), YEAR(CreatedOn) 
                ORDER BY 'Year','Quarter' 
        END


*This post is locked for comments

  • G.Vetere Profile Picture
    G.Vetere 2 on at
    RE: Audit partition anomaly

    No, you cannot delete the last partition log, there has to be at least one

  • Clem Profile Picture
    Clem 2,541 on at
    RE: Audit partition anomaly

    What about the delete button ?

    You can only delete the oldest log anyway :-)

    Clément

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans