+ Post New Thread
Results 1 to 7 of 7
Home Access Plus+ Thread, Logon Tracker Pruning in Projects:; Hey everyone, Is there a SQL query that I can execute to remove logon tracker entries over a certain age ...
  1. #1

    Join Date
    Sep 2009
    Posts
    138
    Thank Post
    0
    Thanked 5 Times in 5 Posts
    Rep Power
    11

    Logon Tracker Pruning

    Hey everyone,

    Is there a SQL query that I can execute to remove logon tracker entries over a certain age from the SQL logon tracker? Need to prevent my database filling up over time...

    Thanks!

    Moby

  2. #2

    Join Date
    Sep 2009
    Posts
    138
    Thank Post
    0
    Thanked 5 Times in 5 Posts
    Rep Power
    11
    Hi,

    Any ideas at all? Does anyone fancy writing a quick SQL script to truncate the log to say, the last 1000 entries? Or is no-one else worried about their log DB/disk drive filling up eventually?

    Ta
    Moby!

  3. #3

    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,690
    Thank Post
    43
    Thanked 560 Times in 468 Posts
    Rep Power
    124
    If your log file is filling up try this: Recover from a full transaction log in a SQL Server database

  4. #4

    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,690
    Thank Post
    43
    Thanked 560 Times in 468 Posts
    Rep Power
    124
    I always set the recovery mode to simple, which stops the log from getting too full

  5. #5

    Join Date
    Sep 2009
    Posts
    138
    Thank Post
    0
    Thanked 5 Times in 5 Posts
    Rep Power
    11
    Hi Nick,

    I don't mean the SQL transaction logs.... I meant the database holding the web log. If using the free version of SQL Express, then this is limited to a certain size.

    How to prune?
    Thanks
    Moby

  6. #6

    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,690
    Thank Post
    43
    Thanked 560 Times in 468 Posts
    Rep Power
    124
    My HAP Database has been running for 3 years now and it's still only 163.00 MB big

  7. #7

    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,690
    Thank Post
    43
    Thanked 560 Times in 468 Posts
    Rep Power
    124
    Here's the SQL Scripts, sorry for the delay:

    Code:
    USE [hap]
    GO
    
    DELETE FROM [dbo].[TrackerEvents]
          WHERE [dbo].TrackerEvents.LogonDateTime <= '1/1/12'
    GO
    and to just clear any empty logoffs

    Code:
    UPDATE [dbo].[TrackerEvents]
       SET [LogoffDateTime] = GETDATE()
     WHERE [dbo].TrackerEvents.LogonDateTime <= '1/1/12' AND [dbo].TrackerEvents.LogoffDateTime is null
    GO



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 29th February 2012, 04:30 PM
  2. HAP - Logon Tracker
    By Davit2005 in forum Windows
    Replies: 0
    Last Post: 28th February 2012, 01:07 PM
  3. Help with Quotas and Logon Tracker
    By Mr_Jolly in forum Home Access Plus+
    Replies: 16
    Last Post: 17th February 2012, 08:24 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •