SQL Server – distrb.exe & Logread.exe Using Large SQL.txt Files

replicationsql serversql-server-2008-r2transactional-replication

I have the following situation:
SQL server 2008 R2 SP2
I have both the Distribution and Subscription database in this server.
LogReader agent and Distribution agent are running in continuous mode

the following file is growing currently (103GB) with readable data
C:\Users\svc-20121\AppData\Local\Temp\SQL.LOG

sample content extracted from the file opened with emeditor:

distrib         2780-768    ENTER SQLAllocEnv 
        HENV *              0x000000000019AA00

distrib         2780-768    EXIT  SQLAllocEnv  with return code 0 (SQL_SUCCESS)
        HENV *              0x000000000019AA00 ( 0x00000000006CFE00)

distrib         2780-768    ENTER SQLFreeEnv 
        HENV                0x00000000006CFE00


.....
SQLAGENT        2af0-1e24   ENTER SQLGetDiagFieldW 
        SQLSMALLINT                  3 
        SQLHANDLE           0x00000000040DAE80
        SQLSMALLINT                  1 
        SQLSMALLINT              -1150 
        SQLPOINTER         0x000000001EBBDDFC
        SQLSMALLINT                 -6 
        SQLSMALLINT *       0x000000001EBBDDF0

SQLAGENT        2af0-1e24   EXIT  SQLGetDiagFieldW  with return code 100 (SQL_NO_DATA_FOUND)
        SQLSMALLINT                  3 
        SQLHANDLE           0x00000000040DAE80
        SQLSMALLINT                  1 
        SQLSMALLINT              -1150 
        SQLPOINTER         0x000000001EBBDDFC
        SQLSMALLINT                 -6 
        SQLSMALLINT *       0x000000001EBBDDF0

When i tried to delete it windows will say it is used by LogRead.exe and Distrib.exe and when i stop them it says another unrelated instance on that machine is using it

any help appreciated?

Best Answer

the tracing was enabled for ODBC and it was reponsile for this file. I do not know why after Stoppin tracing from below screenshot all instances and agents was using this file and we have to stop them one by one until deleting was possible.

enter image description here