General discussion

Locked

Ditto~! I need a bit of SQL help

By email ·
The sql db is way too large.
The mdf is 14.5GB and the ldf is 314GB.
I need to reduce the size of this before I run out of space.
There's no space gained in Shrink so now what?
Thank you

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

If you want to truncate the log...

by puppybreath In reply to Ditto~! I need a bit of S ...

the commands are:

backup log db1 with truncate_only

note: db1 is the database name **** Run this first ****

dbcc shrinkfile (db1_log,1)

note: db1_log is the name of the log file - the 1 tells it to shrink the log file to 1 MB

Collapse -

folow up

by email In reply to If you want to truncate t ...

Do I want to execute the commands in MSSQL Man. Studio inside a query window or just build a task up Maintenance Plan?

Collapse -

Start with a query window

by puppybreath In reply to folow up

If you get the expected results, you can always build an automated task later.

BTW, make sure you have a current backup before trying this. I've never had it fail or corrupt anything but I'd rather be safe than sorry.

Collapse -

sql file sizes

by email In reply to Start with a query window

The log file is now 1024 but the data file is still at 45gb. Can that be truncated?

Collapse -

No

by puppybreath In reply to sql file sizes

Not without losing records in the database.

Collapse -

Ok. old data

by email In reply to No

So I need a way(some method) to delete old data in the dd, yes?

Collapse -

Yes

by puppybreath In reply to Ok. old data

You would have to determine which records you want to delete and then remove them using a SQL query.

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums