Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 DBCC SHRINKFILE

Author  Topic 

wkm1925
Posting Yak Master

207 Posts

Posted - 2011-01-25 : 03:55:27
Hi,

I've no experience to shrink log files. Based on reading, I would like to perform shrink command as following

DBCC SHRINKFILE (ST3DB_log, 1) WITH NO_INFOMSGS


My question as following
1. Did my shrink command is correct?
2. Once Command(s) completed successfully, is that a guaranteed no any data is missing?

Really looking for help

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-25 : 11:38:30
1. yes
2. yes
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-01-25 : 15:50:30
Why do you want to shrink your log file? It is just going to grow again.

Jeff
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-01-25 : 17:19:11
quote:
Originally posted by jeffw8713

Why do you want to shrink your log file? It is just going to grow again.

Jeff



Because they haven't done maint in 30,000 years?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

wkm1925
Posting Yak Master

207 Posts

Posted - 2011-01-25 : 22:54:22
Is that true, shrinking over & over is a very bad practice that leads to serious issues

Some people said, let alone just being a waste of processing time
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-01-26 : 00:29:50
well, how big is the file? Do you do regular maintenance?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

wkm1925
Posting Yak Master

207 Posts

Posted - 2011-01-26 : 01:01:35
My MDF files is 22GB. My log files is 25GB.

No regular maintenance at this moment
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-01-26 : 01:11:15
Have comprehensive log backup strategy which will keep the log file size in check.

PBUH

Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-01-26 : 01:20:18
Also have a look here

http://simplesqldeveloper.blogspot.com/2011/01/today-i-am-going-to-post-why-you-should.html

That's my blog actually :)

PBUH

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-26 : 01:47:01
quote:
Originally posted by wkm1925

Is that true, shrinking over & over is a very bad practice that leads to serious issues

Some people said, let alone just being a waste of processing time



Yes it's true that shrinking over and over is a very bad practice. It leads to file fragmentation, which affects performance. It's a waste of time to shrink if your database needs that space. But it does sound like your system isn't properly configured.

What recovery model are you using? If it's not SIMPLE, then how often are you running transaction log backups?

I have a feeling that the answer is going to be: FULL and none.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -