Solved

SQL 2008 database growing to fast after SQL 2005 migration

Posted on 2011-03-18
10
265 Views
Last Modified: 2012-05-11
I migrated from SQL 2005 to SQL 2008 a couple of weeks ago and my database has gone from 78gigs to 270gigs. Please help!!
0
Comment
Question by:boxer327
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 14

Expert Comment

by:Daniel_PL
ID: 35165237
Can you run this query:

USE <your db name>
SELECT	mf.name,mf.file_id AS fileid,FILEPROPERTY(mf.name,'Spaceused')*8/1024 AS size_MB,
        mf.size * 8 AS [Initial SIZE IN KB],CASE mf.max_size WHEN -1 THEN 'Unlimited' END AS maxsize, (mf.growth *8) AS growth_KB,
        ((mf.size * 8)-(FILEPROPERTY(mf.name,'Spaceused')*8))/1024 AS Free_Space_MB
        FROM	sys.master_files AS mf
JOIN  sys.database_files AS df ON mf.name=df.name
WHERE	mf.database_id = DB_ID()

Open in new window

0
 

Author Comment

by:boxer327
ID: 35165273
The database is currently in production. I ran the query and got the following message back:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '<'.

 I'm a SQL beginner. Please provide more details. Thanks
0
 
LVL 14

Expert Comment

by:Daniel_PL
ID: 35165298
Please don't use < > brackets, just use your database name instead.
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 2

Expert Comment

by:Umesh_Madap
ID: 35166376
Hi
please verify what is the t-log file sizes

use the below code

dbcc sqlperf(logspace)

this query gives the t-log file size if it is grown you need to shrink the t-log file

dbcc shrinkfile(2,1)

please let me know if you need any more clarifications

0
 

Author Comment

by:boxer327
ID: 35166523
The database is actually only 41gigs, but the full backup for the Database is now over 310gigs. How do i fix this?
0
 
LVL 14

Expert Comment

by:Daniel_PL
ID: 35166540
You are probably backing up your database with no init clause - it means each new backup is appended to your backup file. Change it to WITH INIT and every new backup will overwrite existing.
0
 
LVL 14

Expert Comment

by:Daniel_PL
ID: 35166591
Run following query to view contents of your backup file:
RESTORE HEADERONLY FROM DISK='path to your backup file'  
0
 

Author Comment

by:boxer327
ID: 35166697
Your correct how do I fix the backups?
0
 
LVL 14

Accepted Solution

by:
Daniel_PL earned 500 total points
ID: 35166733
Why do you mean by fixing backups?
You can backup to the same file using WITH INIT clause, e.g.:
BACKUP DATABASE some_db_name_here TO DISK='D:\BACKUP\some_db_name_here.bak'

You can backup to new file each time by adding date stamp at the and of file, next deleting old backup file:

Finally you can use already created scripts for backup, and even more - by Ola Hallegren:
http://ola.hallengren.com/
0
 

Author Closing Comment

by:boxer327
ID: 35166760
You've corrected my backup problem. Thank you
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question