SQL Server 2008 r2 log file in C:\USERS\Local\Temp\sql.log grown upto 10GB

  • Hello All,

    I have SQL Server 2008 r2 installed on the D:\ on our development server. In C:\USERS\Local\Temp\sql.log there is an SQL Log file that has grown up to 10GB. I'm unable to open the file due to its size, when I try to delete it, I get the following message

    " The action can't be completed because the file is open in SQL Server Agent"

    I have checked the properties on SQL Server Agent and can confirm the error log file is pointing to another drive.

    All the other SQL Server 2008 instances have the same installation and configuration but sql.log does not exist in C:\USERS\Local\Temp\sql.log.

    I can stop the sql agent and delete the log file, but need to stop this file from growing, SQL error logs are recycled on a monthly bases.

    Any ideas ?

    thank you

  • If the agent has a lock on it, see what is actually logging to the file, is it the actual SQL Agent Log file or is it a job which is logging to the file. If its a job, find out if you can switch the logging off and delete the file or write to a new file instead.

  • Hi

    Thanks for the reply

    I managed to get into the Log file and found the following information

    SQLAGENT 11c0-11e4ENTER SQLAllocHandle

    SQLSMALLINT 1 <SQL_HANDLE_ENV>

    SQLHANDLE 0x0000000000000000

    SQLHANDLE * 0x0000000000D7EC88

    SQLAGENT 11c0-11e4EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)

    SQLSMALLINT 1 <SQL_HANDLE_ENV>

    SQLHANDLE 0x0000000000000000

    SQLHANDLE * 0x0000000000D7EC88 ( 0x00000000005DB250)

    SQLAGENT 11c0-11e4ENTER SQLSetEnvAttr

    SQLHENV 0x00000000005DB250

    SQLINTEGER 200 <SQL_ATTR_ODBC_VERSION>

    SQLPOINTER 3 <SQL_OV_ODBC3>

    SQLINTEGER -5

    I got this information by stopping the SQL Agent and deleting the log file. When the agent restarted the log file was recreated.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply