Forum


HomeHomePremiumPremiumAdministrationAdministrationDatabase SizeDatabase Size
Previous
 
Next
New Post
8/25/2013 12:22 AM
 

I have a DNN 7.0.3 with 2 portals (same site, different languages).
Launched in Feb 2013, the database has swollen to 4.6 GB !!
Going to Host >>Dashboard...Database Server, it shows 

databasename = 21 .00 MB

databasename_log = 4,604 MB

I am familiar with the concept of purging out the log files, and thought I was set up for that.
Any idea how I can resolve this?

Thanks in advance!

Bruce

 
New Post
8/26/2013 3:54 AM
 

Hi Bruce,

I have a suggestion for you to try, but before anything, BACKUP! :)

1 - First identify the table that has grown crazy over this period. My guess is that you have all event logs been logged. Try to run the following script under Host/SQL:

SELECT
   Coalesce(8 * Sum(CASE WHEN si.indid     IN (255)  THEN si.reserved END), 0) AS blob_kb
,  8 * Sum(CASE WHEN si.indid              IN (0, 1) THEN si.reserved END) AS data_kb
,  Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS index_kb
,  so.name
   FROM dbo.sysobjects AS so
   JOIN dbo.sysindexes AS si
      ON (si.id = so.id)
   WHERE  'U' = so.type
   GROUP BY so.name
   ORDER BY 8 * Sum(CASE WHEN si.indid              IN (0, 1) THEN si.reserved END) Desc

It should show at the very top which table has grown most.

My bet is that it was either EventLog or ScheduleHistory (or both)

IF it is one of those two, you can safely run the following to delete all records from them:

TRUNCATE TABLE EventLog
go
TRUNCATE TABLE ScheduleHistory
go

If it is another table that has grown, then you can post its name here so I can have a look.

2 - Now we need to clean up the big log file. To do that you can run this SQL statement:

dbcc shrinkfile([DB FILE NAME] ,1)
go

dbcc shrinkfile([LOG FILE NAME],1)
go

backup log [NAME] with truncate_only
go


You should find and replace [DB FILE NAME], [LOG FILE NAME] and  [NAME] with the correct information you have gotten from the Dashboard regarding your database.

3 - That this script fails, try running the following one and then run them again:

Alter database [NAME] SET Recovery simple

4 - If the cause was the event log, now you should disable the event log from your site by going to Admin/Event Viewer. You should go to each event and disable them.

I hope this will be able to drop the big log file you have. This is the process I personally use whenever I come across this scenario.

Cheers,

Aderson

 
New Post
8/26/2013 6:21 AM
 

Thanks (as always) Aderson!

Silly question...maybe :)

Do you think it is safe to run Step 1 before deciding to do a backup?
That is just reading from the DB, right?

Another silly one...
When it comes down to running these scripts, do I exclude the [ ] around the database name?
For example, if the database is mickey_mouse, do I write (mickey_mouse,1 ) or ([mickey_mouse],1) ?

Thanks,
Bruce

 
New Post
8/26/2013 6:47 AM
 

Hi Bruce,

1 - You don't need a backup to run script #1 - That is just selecting records from the DB;

2 - For the "shrinkfile" you should remove [ ] - for the "backup log" you should keep [ ]

Cheers!

Aderson

 
New Post
8/26/2013 7:16 AM
 

Thanks again!

Not what I was expecting when I ran step 1.
ScheduleHistory is on the top, but doesn't seem as big as expected, 1.8 MB
EventLog is down the list at only 48 kb.

Here is a screenshot:
http://www.coatofarms.jp/xHero/logs.gif

Does this change your recommendation at all?

When I run the script (Host>>SQL):

sp_spaceused

I still get the 4.x GB value.

Regards,
Bruce

 
Previous
 
Next
HomeHomePremiumPremiumAdministrationAdministrationDatabase SizeDatabase Size



Try FREE
30 days money back guaranteed