web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Tracing File/LDF file/SQL Log File - Too Big

(0) ShareShare
ReportReport
Posted on by 65

The disk space on my server is limited and the system is running slow, I've discovered that there is a Tracing File which currently stands at 50gb, additionally there's a SQL log file at 12gb and a Reports File [LDF] at 13gb.
I only have 6gb of available disk space remaining.

Are these large files the cause of my problem and how can i clear them down?

 

thanks

*This post is locked for comments

I have the same question (0)
  • Baris KANLICA Profile Picture
    User Group Leader on at

    You can take your log settings to simple mode.

    After this process you can run this script in crm database. This script reduce your crm database and log file. And you don't trace the system all time. This is not recommended.

    --1st step // run this after backup database

    CREATE NONCLUSTERED INDEX CRM_AsyncOperation_CleanupCompleted

    ON [dbo].[AsyncOperationBase] ([StatusCode],[StateCode],[OperationType])

    GO

    CREATE NONCLUSTERED INDEX CRM_WorkflowLog_AsyncOperationID ON [dbo].[WorkflowLogBase] ([AsyncOperationID])

    GO

    CREATE NONCLUSTERED INDEX CRM_DuplicateRecord_AsyncOperationID ON [dbo].[DuplicateRecordBase] ([AsyncOperationID])

    GO

    CREATE NONCLUSTERED INDEX CRM_BulkDeleteOperation_AsyncOperationID ON [dbo].[BulkDeleteOperationBase]

    (AsyncOperationID)

    GO

    --2nd step // run after stop Crm async

    -- Rebuild Indexes & Update Statistics on AsyncOperationBase Table

    ALTER INDEX ALL ON AsyncOperationBase REBUILD WITH (FILLFACTOR = 80, ONLINE = OFF,SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = OFF)

    GO

    -- Rebuild Indexes & Update Statistics on WorkflowLogBase Table

    ALTER INDEX ALL ON WorkflowLogBase REBUILD WITH (FILLFACTOR = 80, ONLINE = OFF,SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = OFF)

    GO

    declare @DeleteRowCount int

    Select @DeleteRowCount = 1000

    declare @DeletedAsyncRowsTable table (AsyncOperationId uniqueidentifier not null)

    declare @continue int, @rowCount int

    select @continue = 1

    while (@continue = 1)

    begin

         begin tran

         insert into @DeletedAsyncRowsTable(AsyncOperationId)

         Select top (@DeleteRowCount) AsyncOperationId

         from AsyncOperationBase

         where OperationType in (1, 9, 12, 25, 27, 10) AND StateCode = 3 AND StatusCode in (30, 32)

         Select @rowCount = 0

         Select @rowCount = count(*) from @DeletedAsyncRowsTable

         select @continue = case when @rowCount <= 0 then 0 else 1 end

           if (@continue = 1)

           begin

               delete WorkflowLogBase from WorkflowLogBase W, @DeletedAsyncRowsTable d

               where W.AsyncOperationId = d.AsyncOperationId

    delete BulkDeleteFailureBase From BulkDeleteFailureBase B, @DeletedAsyncRowsTable d

               where B.AsyncOperationId = d.AsyncOperationId

               delete AsyncOperationBase From AsyncOperationBase A, @DeletedAsyncRowsTable d

               where A.AsyncOperationId = d.AsyncOperationId

               delete @DeletedAsyncRowsTable

         end

         commit

    end

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans