Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

telerik -- supercharge your DNN websites
  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  What I Learned About Database Work inside DNN
Previous Previous
 
Next Next
New Post 9/11/2007 2:15 PM
User is offline vollerworld
195 posts
www.vollersolutions.com
9th Ranked


What I Learned About Database Work inside DNN 
Modified By vollerworld  on 9/11/2007 9:24:17 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
http://www.vollersolutions.com
Get the latest DNN Modules and Skins
View my View Chad Voller's profile on LinkedIn
I host my sites at 3Essentials
 
New Post 9/11/2007 5:15 PM
User is offline Sebastian Leupold
15045 posts
www.deutschnetnuke.de
1st Ranked












Re: What I Learned About Database Work inside DNN 

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!


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 9/11/2007 6:20 PM
User is offline Terp
482 posts
www.bidlesstravel.com
8th Ranked


Re: What I Learned About Database Work inside DNN 

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.  :)

 


GoDaddy Coupons| GoDaddy Codes
American Idol Fan Club
Stop the Political Attacks
 
New Post 9/11/2007 6:26 PM
User is offline Terp
482 posts
www.bidlesstravel.com
8th Ranked


Re: What I Learned About Database Work inside DNN 

 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....


GoDaddy Coupons| GoDaddy Codes
American Idol Fan Club
Stop the Political Attacks
 
New Post 9/11/2007 7:16 PM
User is offline vollerworld
195 posts
www.vollersolutions.com
9th Ranked


Re: What I Learned About Database Work inside DNN 
Modified By vollerworld  on 9/11/2007 9:24:52 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
http://www.vollersolutions.com
Get the latest DNN Modules and Skins
View my View Chad Voller's profile on LinkedIn
I host my sites at 3Essentials
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  What I Learned About Database Work inside DNN
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Dnaxp.Net
Dnaxp.Net offers a comprehensive base of information, resources, and support for DotNetNuke.
www.dnaxp.net
DNNMasters - modules, consulting, development
DNNMasters developers are involved in DNN development since DNN 1.0.9 and today we offer a broad range of DNN related products and services including custom development of modules, help with ing third party modules for specific needs, general DNN technical support and administrative services.
www.dnnmasters.com
Cygnusoft Custom Software
Cygnusoft has been providing cutting-edge custom software solutions for 20 years. Cygnusoft is also a leading start-up incubator, helping our partners build successful new businesses.
www.cygnusoft.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP