eventlog purge errors

Last post 12-31-2005 10:44 AM by cathal. 9 replies.

Sort Posts:

  • eventlog purge errors

    11-28-2005, 10:34 AM
    My DB seems to be very large for very little data.  It seems that most of the data is in the events table.  I tried to schedule the DotNetNuke.Services.Log.EventLog.PurgeLogBuffer, DOTNETNUKE hopeing it would keep that table size in check, but when I check the history I get this

    EXCEPTION: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)
       at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)
       at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText)
       at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, String spName, Object[] parameterValues)
       at DotNetNuke.Services.Log.EventLog.DBLoggingProvider.Data.SqlDataProvider.PurgeLog()
       at DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.PurgeLogBuffer()
       at DotNetNuke.Services.Log.EventLog.PurgeLogBuffer.DoWork()


    Why does this fail?  If there a way to turn off event logging? 
  • Re: eventlog purge errors

    11-29-2005, 5:23 PM
    • Star
      13,648 point Star
    • cathal
    • Member since 06-18-2002, 12:02 PM
    • Belfast, Northern Ireland
    • Posts 2,702
    • TrustedFriends-MVPs
    the timeout will occur if you've a lot of records to delete, or your sql server is slow. It simply call's the PurgeEventLog sproc, but if you're having problems you can clear out the eventlog table manually, or by running "truncate table eventlog"

    Cathal
  • Re: eventlog purge errors

    12-30-2005, 1:10 PM
    • Participant
      1,214 point Participant
    • portvista
    • Member since 03-30-2004, 8:24 PM
    • Florida
    • Posts 248
    I have a site with 700,000+ records in the EventLog. When we access the Event Log on our DNN web site, it times out.

    When I run: delete from dnn_EventLog

    from Enterprise Manager Query Analyzer, it hangs on Execute Query Batch forever. When you attempt to stop it, it also hangs until you end the Windows process.



    Edited: that's 700,000 records not 70,000

  • Re: eventlog purge errors

    12-30-2005, 5:40 PM
    • Contributor
      4,620 point Contributor
    • IcthusTech
    • Member since 03-26-2004, 3:53 PM
    • Germantown, WI
    • Posts 924
    I have the same problem and would appreciate some detailed instruction on how to delete, or trunciate all of these records.
    Icthus Technologies

    Building Faith on the Internet
  • Re: eventlog purge errors

    12-30-2005, 6:35 PM
    • Star
      8,010 point Star
    • cjsmitty
    • Member since 06-29-2002, 3:35 PM
    • Rockford, IL
    • Posts 1,600
    To truncate the EventLog table:

    • Login as Host (or SuperUser)
    • Got to; Host\Sql
    • Type; truncate table EventLog
    • Click 'execute'
    That's it...

    ~Chris

    Net Data Design
    706Horsman.us
  • Re: eventlog purge errors

    12-30-2005, 7:17 PM
    • Contributor
      4,620 point Contributor
    • IcthusTech
    • Member since 03-26-2004, 3:53 PM
    • Germantown, WI
    • Posts 924

    LOL, Can't you make it harder than that!

    Thank you!

    Icthus Technologies

    Building Faith on the Internet
  • Re: eventlog purge errors

    12-30-2005, 7:53 PM
    • Participant
      1,214 point Participant
    • portvista
    • Member since 03-30-2004, 8:24 PM
    • Florida
    • Posts 248
    I was trying to salvage the last month of events, but this is better than not having any logs. Strange though, I thought I had it set to only keep 100 entries, so we'll see if this balloons to 700,000 again!
  • Re: eventlog purge errors

    12-31-2005, 4:18 AM
    • Star
      8,010 point Star
    • cjsmitty
    • Member since 06-29-2002, 3:35 PM
    • Rockford, IL
    • Posts 1,600
    Portvista,

    To delete all but the last months events, run something like this (will retain Decembers events):

    Delete     FROM         EventLog
    WHERE     LogCreateDate < '12/01/2005'
    ~Chris

    Net Data Design
    706Horsman.us
  • Re: eventlog purge errors

    12-31-2005, 10:16 AM
    • Participant
      1,214 point Participant
    • portvista
    • Member since 03-30-2004, 8:24 PM
    • Florida
    • Posts 248
    When I tried to delete more than 10,000 records at a time, it hung or timed out. The TRUNCATE worked instantly -- which always seemed like a redundant SQL statement until now. lol. My guess is it has something to do with the table relationship INSERT, UPDATE, and replication enforcements slowing it down.
  • Re: eventlog purge errors

    12-31-2005, 10:44 AM
    • Star
      13,648 point Star
    • cathal
    • Member since 06-18-2002, 12:02 PM
    • Belfast, Northern Ireland
    • Posts 2,702
    • TrustedFriends-MVPs

    FYI: From SQL books online

    "TRUNCATE TABLE is functionally identical to DELETE statement with no WHERE clause: both remove all rows in the table. But TRUNCATE TABLE is faster and uses fewer system and transaction log resources than DELETE.

    The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row. TRUNCATE TABLE removes the data by deallocating the data pages used to store the table's data, and only the page deallocations are recorded in the transaction log.

    TRUNCATE TABLE removes all rows from a table, but the table structure and its columns, constraints, indexes and so on remain. The counter used by an identity for new rows is reset to the seed for the column. If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement"

Page 1 of 1 (10 items)