DNN-Forum

You do not need to register to post your questions or comments so fire away !!
Topics related to Dnn only please.

Database size is growing SQL 2005
Last Post 17 Jul 2009 02:12 AM by . 2 Replies.
AddThis - Bookmarking and Sharing ButtonPrinter Friendly
Sort:
PrevPrev NextNext
AuthorMessages
jane
Basic Member
Basic Member
Posts:153

--
03 Jul 2009 12:51 PM QuoteQuoteReplyReply  

 

Just received an email from hosting company saying that my database is at 80 % allowed size. What do I need to make it smaller, the website is not that big and it does not have functionality that would require anything to be written to the database - I am not sure why this is happening, is this  abug or something in the application ?

 

DNN_Design
Veteran Member
Veteran Member
Posts:43
Avatar

--
03 Jul 2009 01:18 PM QuoteQuoteReplyReply  


Here are steps as suggested by Mark Doyle
this works for us

1. Purge the Database Tables

If your DNN installation has been running for any amount of time, you will have built up log data. You will want to either purge or delete some of the data in these log tables. Consider using one of the following SQL examples.

_Example 1.A
_truncate table EventLog
go
truncate table ScheduleHistory
go
truncate table SiteLog
 

_Example 1.B_
delete from EventLog where LogCreateDate < (getdate() - 7)
go
delete from ScheduleHistory where EndDate < (getdate() - 7)
go
delete from SiteLog where [DateTime] < (getdate() - 7)
go

In Example 1.A, the truncate step clears the tables, and, because it does not have to record the transaction in SQL Server, is instantaneous. However, db_owner privileges are required.

In Example 1.B, the delete statement is used to only delete data older than 7 days. Because this operation requires transaction logging by SQL Server, running this statement will take longer than a truncate, and may timeout in a web-based SQL utility.


 2. Limit the Event Log

Whether you use the Log Viewer or not, events will be captured unless you instruct your DNN installation not to. Again, this is incredibly useful when installing a new module, or verifying your install, but, as you'll see, it borders on overkill.

Log in as the administrator or host, and navigate to Admin -> Log Viewer. One of two things will happen - either you will see many colorful rows indicating the many events, or you will get a timeout exception. If you get an exception, you will need to purge the EventLog table in the DNN database.
You will also be able to clear the event log by clicking the Clear Log button, or select the events you wish to delete, and click Delete Selected Exceptions.

To configure the event log, and reduce the amount of logging, click Edit Log Configurations at the lower left-hand corner. Here, you can edit the various Log Types. First, you may wish to disable the APPLICATION_START and APPLICATION_END events, especially if you are on a shared web hosting server, where the application can start and stop frequently.  Also, the "*" Log Type captures many events, and is enabled by default. This should be disabled or restricted.

Click the Edit button beside each Log Type you wish to configure, and either enable or disable, or configure the history for each event. The DNN Scheduler will purge older data, which will be explained next.


 3. Schedule History

The DNN Scheduler controls numerous events, including the various purge jobs by default. To view the Scheduler information, navigate to Host -> Schedule.

If the Site Log is enabled at the Host and Admin levels, the Site Log purge job should be enabled. Click the Edit button next to the Scheduler Type "DotNetNuke.Services.Log.SiteLog.PurgeSiteLog, DOTNETNUKE", and check the Schedule Enabled checkbox. The default settings will purge site logs daily, for information older than that allowed by the Host.

You can also purge the Schedule History by enabling the Scheduler Type "DotNetNuke.Services.Scheduling.PurgeScheduleHistory", or restrict the data kept.

http://www.doyleits.com/Default.asp...;EntryID=3

DNN Designs | Web Design, Skin Development, E-commerce | www.dnn-design.com
jane
Basic Member
Basic Member
Posts:153

--
17 Jul 2009 02:12 AM QuoteQuoteReplyReply  

Here is one we are using - this was posted on dnn site

replace xxxx with your database name, this script works on SQL 2005 it will nort work on sql 2008

BACKUP LOG xxxx WITH TRUNCATE_ONLY
TRUNCATE TABLE {databaseOwner}{objectQualifier}EventLog
TRUNCATE TABLE {databaseOwner}{objectQualifier}SiteLog
TRUNCATE TABLE {databaseOwner}{objectQualifier}schedulehistory
DBCC SHRINKDATABASE (xxxx);

do not forget to back up your database first


Quick Reply
toggle
 Username:
Subject:
Body:
Security Code:
CAPTCHA image
Enter the code shown above in the box below

Submit
Active Forums 4.1

DNN Forum New Posts

  SCENARIO. OS Win 2008 R2 IIS 7.5   Database  MS SQL 2008 Framework 2.0 ...
Number of replies: 1
I edited text field and now all portals are down - how do I fix? After editing 'terms of servic...
Number of replies: 0
 This is reaaally driving me nuts. I thought it had something to do with me changing the p...
Number of replies: 1
Hi, I need to find solution to replace text/html across the portal. I used a module form Iowa C...
Number of replies: 1
Hi, We are experiencing the following general issue on one of our clients website.   87...
Number of replies: 1
This one is from DNN and Mitchel Sellers http://www.dotnetnuke.com/Community...fault.aspx- than...
Number of replies: 2
 For a content management system, instead of Joomla or Sharepoint, I use Dotnetnuke from i...
Number of replies: 1
I loaded the user directory from effority and now am receiving the following error: Compiler E...
Number of replies: 1
We have an internal  DNN site up set-up and we've changed the portal alias so that we can ...
Number of replies: 1
Hello All I have set the splash page for the site and now the site is down - I get the followi...
Number of replies: 1