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
 General SQL Server Forums
 New to SQL Server Administration
 SQL server 2005 file shrink

Author  Topic 

vojinb
Starting Member

9 Posts

Posted - 2011-05-10 : 10:15:52
Hi,
I have DB with replication established to another server. Considering the DB size I was deleting some old snapshots from DB and now I have more than 50% space available. Can I leave DB in full recovery mode and do the shrinking file to release space, bu NOT to lose transaction logs from that DB?
Thanks

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-05-10 : 10:21:30
Shrinking a file does not affect transaction log integrity, you will not lose anything. You should avoid shrinking any database files unless it's a dire emergency, i.e. no disk space left and files are full and cannot grow. Shrinking causes data to fragment and can cause serious performance issues.
Go to Top of Page

Jahanzaib
Posting Yak Master

115 Posts

Posted - 2011-05-10 : 12:03:56
do shrink action in free or least activity work hours

Regards,

Syed Jahanzaib Bin Hassan
MCTS,MCITP,OCA,OCP,OCE,SCJP,IBMCDBA

My Blog
www.aureus-salah.com
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-05-10 : 12:25:22
Jahanzaib-

Do you always give bad advice about shrinking files without explaining why?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=160335
Go to Top of Page

Jahanzaib
Posting Yak Master

115 Posts

Posted - 2011-05-11 : 02:55:26
you people are always do only these stuff which those are written online or paper ,you people didnt give any practical advice,do you have any practical idea what the dinakar say in the mentioned link ,did you read it or not,if not read then read it on this link

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=160335

Regards,

Syed Jahanzaib Bin Hassan
MCTS,MCITP,OCA,OCP,OCE,SCJP,IBMCDBA

My Blog
www.aureus-salah.com
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-11 : 04:10:44
What dinakar said in that thread was about log shrink, and he's only half correct (he neglects to mention the log fragmentation that will be caused by repeated shrink/grow cycles or the consequences of the log growing again). The question here is about data shrink and nothing dinakar says applies to data file shrinks.

Data shrinks do cause massive fragmentation (and that's confirmed by personal experience and investigations, not just the many respected articles on the subject) and are strongly not recommended in most cases.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-11 : 04:13:55
quote:
Originally posted by Jahanzaib

you people are always do only these stuff which those are written online or paper


So are you recommending ignoring documented best practices, other people's personal experience and guidelines from experts in the field?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2011-05-11 : 04:33:26
robvolk and Gila are most prominent SQL Server Experts not only at SQLTeam but through out SQL Server community. Jahanzaib, you must show respect for these guys IF YOU NEED TO LEARN SOMTHING BETTER.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-05-11 : 07:58:23
quote:
robvolk and Gila are most prominent SQL Server Experts not only SQLTeam but through out SQL Server community. You must show respect for these guys IF YOU NEED TO LEARN SOMTHING BETTER.


Well, thank you for that. But seriously, I'm not carving "THOU SHALT NOT SHRINK DATABASES" on stone tablets and promising death and misery to all who do, but I agree completely with Gail: it's documented as a bad practice...BY THE GUY WHO WROTE THE SOFTWARE: http://blogs.msdn.com/b/sqlserverstorageengine/archive/2006/06/13/629059.aspx

Please don't mistake common sense and practical experience as the word of god or something like that. I can be wrong too. Gimmee five minutes.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-11 : 08:25:27
quote:
Originally posted by robvolk

Please don't mistake common sense and practical experience as the word of god or something like that. I can be wrong too. Gimmee five minutes.


We all can be, and are.

It's one reason why I like to learn from other people's experiences and advice. Why make the mistakes myself when someone's already made the mistake, documented it and explained how not to make it? It leaves me time to go off and make mistakes no one else has yet.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2011-05-11 : 13:11:15
quote:
Originally posted by GilaMonster

What dinakar said in that thread was about log shrink, and he's only half correct (he neglects to mention the log fragmentation that will be caused by repeated shrink/grow cycles or the consequences of the log growing again). The question here is about data shrink and nothing dinakar says applies to data file shrinks.

Data shrinks do cause massive fragmentation (and that's confirmed by personal experience and investigations, not just the many respected articles on the subject) and are strongly not recommended in most cases.

--
Gail Shaw
SQL Server MVP



I did not want to repeat what has already been said.. I just wanted to make it clear that shrinking log files is okay once in a while and not a terrible thing as shrinking data files. log files do tend to blow up every now and then for various reasons.. so its okay to shrink the log to reclaim some of the space..
And yes, as you said if the log needs to grow back it will.. I am not recommending the OP to keep shrinking regularly. my point was if your log files are <b>normally</b> X GB and they grew to X+Y you can shrink them back to X..

there is only so much you can explain in a post

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-11 : 14:44:26
quote:
Originally posted by dinakar

I did not want to repeat what has already been said.....

there is only so much you can explain in a post


Indeed, and I wouldn't have belaboured the point had it not been for someone misunderstanding what you said and applying it in the wrong place.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Jahanzaib
Posting Yak Master

115 Posts

Posted - 2011-05-13 : 07:21:43
Respect each other,Every one has it own respect.do respect then take respect.No body is perfect note it,Everyone have own expirence,if you convey your message respectfully then I always welcome

Regards,

Syed Jahanzaib Bin Hassan
MCTS,MCITP,OCA,OCP,OCE,SCJP,IBMCDBA

My Blog
www.aureus-salah.com
Go to Top of Page

stipen4
Starting Member

3 Posts

Posted - 2011-05-17 : 07:46:16

Hi friend
Servers are often dedicated, meaning that they perform no other tasks besides their server tasks. On multiprocessing operating systems, however, a single computer can execute several programs at once. A server in this case could refer to the program that is managing resources rather than the entire computer.


unspammed

stipen4
Go to Top of Page
   

- Advertisement -