Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncating out of control DB's 1

Status
Not open for further replies.

Wyldcard9

Programmer
Feb 5, 2004
82
US
We had a salesman set up our SQL server a few years ago. He set up our production databases to unrestricted growth at 10% increase each time. The drive is almost full, and we have one DB that is 3 gig, and another that is 6 gig (on a 12 gig drive). There are a few other smaller DB's as well. Our data entry department is shut down because no more new records can be added. The people who sold us the product told me to truncate the DB's that are so large. I honestly have no idea how to do that. Can anyone point me in the right direction please?
 
First, you probably aren't backing up your database and/or transaction logs. You need to start doing that. Make sure you have a full backup before you do anything else.

To truncate the log file......run...
BACKUP LOG db_name WITH TRUNCATE_ONLY

Of course, once you do that you won't be able to restore to a point in time and must do a full backup again.

Here's some reading material...

FAQ183-1534
FAQ183-345
FAQ962-5722
FAQ962-5742

Also, check out the BOL.

-SQLBill

BOL=Books OnLine=Microsoft SQL Server's HELP
Installed as part of the Client Tools
Found at Start>Programs>Microsoft SQL Server>Books OnLine
or online at:


Posting advice: FAQ481-4875
 
Thank you sir.

Our network guys have a program they bought that does the back ups, and is supposed to do the truncation, however it is not truncating properly.
 
Ahhhh, third-party backup software. Have you ever tried to restore from that software? Does it use a SQL Server agent of some kind? If not, then it probably backs up the .mdf 'flat' file and that type of backup can not be used for restoring - unless the database was 'offline' (services stopped or database detached) when the backup was done.

-SQLBill

Posting advice: FAQ481-4875
 
SQLBill,

We are all good now. Thanks for your assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top