Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...What I Learned About Database Work inside DNNWhat I Learned About Database Work inside DNN
Previous
 
Next
New Post
9/11/2007 4:15 PM
 

For my fellow DNN Enthusiasts out there, who know enough to be dangerous, but don't know enough to be smart, I thought I would post what I learned today about working with your database from within DNN in a hosted environment.  

First of all, I happen to host my sites at 3Essentials, and I'm sure your hosting provider probably has something to do with whether or not all of these things will work for you as a solution.  I highly recommend 3Essentials, as I had tried several hosters before them, including GoDaddy and IHostAsp.Net, and found myself disappointed with service at both places.  Support at 3Essentials is unrivaled on all levels.

Second of all, this information is very basic, but I thought it might be helpful for others like me (basic!).  So, by all means, consider this free for coming, and realize that you get what you pay for.

Third of all, thanks to Mitchel Sellers who helped me through much of this.

NOTE* Every command below can be performed in your HOST > SQL page inside your portal 
(at least if you host at 3Essentials, but I assume this would be fairly universal)  I am NOT sure how this would work in a locally hosted environment, such as an Intranet portal.

Problem: Database out of Control

Why would I have a 630MB database on a 1 page website?  
The most likely cause for this type of BLOAT in a database is caused by the EventLog.  The problem can also be caused by a growing SiteLog, if you have that enabled.  SiteLOg is found under HOST > Host Settings > Advanced Settings > Other Settings > Site Log History (I set it to 0 days)

Where do I go in DNN to 1) assess the problem, and 2) fix the problem?

Solution(s): How to Assess / Potential Fixes

Assessing the problem and looking at potential fixes.  I had read about EventLog and SiteLog issues creating a bloated database.  But how do you figure out if they are actually the problem?  While this is not a comprehensive answer, it is a start.

  • Login and go to HOST > SQL
    • Paste this into your SQL screen: sp_spaceused
    • Click Execute
    • This generates a small table showing you how much space is used by your database (note the results)
    • Note the database size, and the unallocated space (this is my database size AFTER all the steps I took)
    • Note the name of the database (below I have substituted database_dnn), as you will use it for the SHRINKDATABASE command below

database_name database_size unallocated space
database_dnn 39.63 MB 0.81 MB

  • Is the problem with your database tables? (read this from Mitchel Sellers)
    • Look at that post from Mitchel on his DNN blog, and you'll be able to generate a report right inside HOST > SQL on your DNN portal.
    • If you have a "problem" table, you'll need to figure out how to reduce the size of that table, if necessary.
  • Truncate your EventLog -- A more common problem
    • At HOST > SQL, enter this text: TRUNCATE TABLE eventlog
    • Do not need to check the "Run as Script" box
    • Click Execute (it may not appear that anything is happening, but this trims your EventLog file)
    • Run the sp_spaceused again and see if there is a difference between the first time you ran it and this time (If so, there was likely a problem with your EventLog) 
  • Truncate your SiteLog -- A more common problem
    • At HOST > SQL enter this text: TRUNCATE TABLE sitelog
    • Do not need to check the "Run as Script" box
    • Click Execute (it may not appear that anything is happening, but this trims your SiteLog file)
    • Run the sp_spaceused again and see if there is a difference between the first time you ran it and this time (If so, there was likely a problem with your SiteLog)
  • Shrink Your Database
    • disclaimer: i don't know the full consequences of shrinking your database, but it can be done through HOST > SQL
    • At HOST > SQL, enter this text: DBCC SHRINKDATABASE (MyDatabase);
    • Include the semicolon at the end of the previous line
    • Do not need to check the "Run as Script" box
    • Click Execute
    • Run the sp_spaceused again and see what the database_size is, compared to the unallocated space (both may decrease significantly)
    • Read more about this SQL command here

this was my sp_spaceused BEFORE i ran the TRUNCATE commands and the SHRINK command

database_name database_size unallocated space
database_dnn 665.25 MB 65.30 MB

this was my sp_spaceused AFTER i ran the TRUNCATE commands and the SHRINK command

AFTER TRUNCATE sitelog and TRUNCATE eventlog (note the HUGE difference in unallocated--free-space)

database_name database_size unallocated space
database_dnn 665.25 MB 626.30 MB


AFTER DBCC SHRINKDATABASE (MyDatabase); (note the HUGE difference in database_size -- all the way down to under 40MB!!)


database_name database_size unallocated space
database_dnn 39.63 MB 0.81 MB
 

Well, maybe this will help some basic folks, like me, out there.

Regards,

Chad Voller

EDIT:
As leupold has pointed out, there is a Scheduler built-in to DotNetNuke to provide some regular maintenance of these items.  If you read up here:
http://www.dotnetnuke.com/default.aspx?tabid=787&helpculture=en-us&helpmodule=Schedule you can learn more about how to use the scheduling functionality.  Thanks, Sebastian!


Chad Voller -- MCP, DNN Aficionado
Leapwise Media
View my View Chad Voller's profile on LinkedIn
 
New Post
9/11/2007 7:15 PM
 

Just a few hints on this:

  • there are scheduler jobs to clean up scheduler history, event and site log - make sure they are activated
  • if your site is visited intensively, you should switch to file based logging and use a 3rd party tool (e.g. smarterstats from www.smartertools.com) for analysis
  • to shrink  database - and especially event log - make sure, database is regularly backed up with option TruncateLog  enabled

Note: I will cover database maintanance in my session "TroubleShooting DotNetNuke" at OpenForce '07 Europe. Hope to see you!


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
9/11/2007 8:20 PM
 

Great post, sir.  Thanks.  I've been asking about a few of these commands in other threads, and this is exactly what I was looking for.

So there is a difference between the sitelog, the eventlog, AND the transaction log? I am still trying to figure out the jargon, but know it was my transaction log that got quite large last time, as I never had it backed-up and truncated previously...

I could use some serious training on db maintenance and SQL...think I'll get our Uncle Sam to pay for a few beginner SQL courses in the not-too-distant future.  :)

 

 
New Post
9/11/2007 8:26 PM
 

leupold wrote

Note: I will cover database maintanance in my session "TroubleShooting DotNetNuke" at OpenForce '07 Europe. Hope to see you!

..just read this.  How about moving the date forward about 3 weeks to accommodate Terp? I'll be in Germany throughout the month of October, so will be a little late. This is exactly what I need. :)

I can taste the Rahm Schnitzel mit Pommes, Spätzle, und Hefe Weizen now....

 
New Post
9/11/2007 9:16 PM
 

Sebastian, thanks for the added input.  Your advice always brings something beneficial to the discussion.

Terp.  I believe the EventLog is the same thing as the TransactionLog.  Sebastian or Mitchel, could you please confirm that for the sake of this thread?

Thank you,
Chad

As leupold has pointed out, there is a Scheduler built-in to DotNetNuke to provide some regular maintenance of these items.  If you read up here: http://www.dotnetnuke.com/default.aspx?tabid=787&helpculture=en-us&helpmodule=Schedule you can learn more about how to use the scheduling functionality.  Thanks, Sebastian!


Chad Voller -- MCP, DNN Aficionado
Leapwise Media
View my View Chad Voller's profile on LinkedIn
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...What I Learned About Database Work inside DNNWhat I Learned About Database Work inside DNN


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out