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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to truncate Sitelog and Eventlog files from DB?How to truncate Sitelog and Eventlog files from DB?
Previous
 
Next
New Post
4/7/2008 3:22 AM
 
SQL Commands -- Run from HOST > SQL    
   

 

Two Commands here (to be run separately): 
SELECT * 
FROM DesktopModules 
WHERE SupportedFeatures = -1

(2nd command) 
UPDATE DesktopModules 
SET SupportedFeatures = 0 
WHERE SupportedFeatures = -1

Why Run This:  

You're getting an error that is like one of these:

1) InnerException: Could not load type ''.
 
Message: System.Web.HttpException: Could not load type ''. ---> System.ArgumentException: String cannot have zero length. at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) --- End of inner exception stack trace --- at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at DotNetNuke.Framework.Reflection.CreateType(String TypeName, String CacheKey, Boolean UseCache, Boolean IgnoreErrors)
 
2) InnerException: Value cannot be null. Parameter name: type
 
Message: System.ArgumentNullException: Value cannot be null. Parameter name: type at System.Activator.CreateInstance(Type type, Boolean nonPublic) at DotNetNuke.Framework.Reflection.CreateObject(String TypeName, String CacheKey) at DotNetNuke.Services.Search.ModuleIndexer.GetModuleList(Int32 PortalID)
What It Does:  

The first command simply shows you which records in your DesktopModules table have a SupportedFeatures value that is -1.  This value can cause the errors listed.

The second command updates the values in the DesktopModules table in order to remove this error from your database/portal.

Run As Script:  
After Execute:   If you run the first command after you excecute the second command, the query should return no results.
   

 

DBCC SHRINKDATABASE (MyDatabase) ;
Why Run This:  

You may have had a bloated database because of the eventlog, or sitelog, or a combination of things.

What It Does:  

Removes the unallocated space from the database, so your database is down to a smaller size.

Run As Script:  
After Execute:   Do the sp_spaceused before and after to verify that you have indeed reduced the size of the database.
   

 

select * from sysobjects where type = 'u'
Why Run This:  

You want to list all the tables in your database

What It Does:  

Displays a list of all your tables in a grid.

Run As Script:  
After Execute:   You will see a table showing you all the tables in your database.
   

 

select * from tablename
Why Run This:  

You want to view all records in a specific table in your DNN database.  Replace "tablename" with the name of your table and click Execute.

What It Does:  

Will display all the rows of the tablename specified in the command syntax and all fields for each row.

Run As Script:  
After Execute:   The list will appear on the page.
   

 

sp_spaceused
Why Run This:   You want to know how much physical disk space your database is taking up on your web server.
What It Does:  

Displays a simple table showing you: 
1. Database Name 
2. Database Size 
3. Database Unallocated Space

Run As Script:  
After Execute:   You'll see the table displayed below the HOST > SQL box.
   

 

TRUNCATE TABLE eventlog
Why Run This:   Event logs in particular can fill up the transaction log in your database.
What It Does:   Clears the records from the event log. If you view Admin > Event Viewer prior to running this command, and then run this command and return to Admin > Event Viewer, there will be no records.
Run As Script:  
After Execute:   Nothing will appear in your window after you press Execute.
   

 

TRUNCATE TABLE sitelog
Why Run This:   Site logs can sometimes fill up the database.
What It Does:  

Clears the table sitelog.

Run As Script:  
After Execute:   Your screen won't change in HOST > SQL, but the sitelog table will be cleared.
   

 

UPDATE {databaseOwner}{objectQualifier}DesktopModules SET SupportedFeatures = 0 WHERE SupportedFeatures < 0
Why Run This:  

You may be received errors in Admin > Event Viewer that are something like this: 
A) "System.Web.HttpException: Could not load type ''. ---> System.ArgumentException: String cannot have zero length..." 
B) Or like this: "System.ArgumentNullException: Value cannot be null. Parameter name: type at System.Activator.CreateInstance"

What It Does:  

Makes sure all entries in table DesktopModules have valid values for "SupportedFeatures" field

Run As Script:  
After Execute:   You can monitor your site for exceptions in the Admin > Event Viewer page. After you run this command, if the problem was caused by the values in the SupportedFeatures field from the DesktopModules table, you will then no longer see the exception come up.
 
New Post
12/11/2008 2:03 AM
 

 

I don't know exactly what versions of DNN this affects but I know it was around for quite awhile. Various things were done to improve it and I'm really not sure if it's been fully fixed but I do know it was at its worst in the 4.3.x versions.

It's been awhile since I dug into the exact specifics but the basics are... There's a table called, ScheduleHistory. Normally, that table is cleared by the scheduler on a regular basis so that it never gets bigger than a few hundred records. But sometimes, something causes the Scheduler to not clear out the table for a bit. In the 4.3.x versions, there was some SQL that was run by the Scheduler which, for every record in the table it would would check that record against every other record in the table. The number of sql call increases exponentially as the table grows. So, if there were 500 records on the table, 250,000 sql calls were made. everytime this function was fired off by the scheduler, which was fairly frequent.  This isn't a problem as long as the table stays small, but once it gets to a certain size, the scheduler can no longer clear the table and the problem gets continually worse.

The fix: run the following SQL Statement (you can do this in the Host/SQL tab)
SELECT COUNT(*) FROM ScheduleHistory

If this returns a number greater than 500. Run this:
truncate table schedulehistory

Then monitor things for a few days to ensure the ScheduleHistory table is getting cleaned up on a regular basis.

Is your DotNetNuke site running ridiculously slowly and consuming massive amounts of your processor? It might be stuck in a bit of a catch 22... The scheduler is trying to clear the ScheduleHistory table, but it can't because the ScheduleHistory table is too full.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to truncate Sitelog and Eventlog files from DB?How to truncate Sitelog and Eventlog files from DB?


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