Solved

SHRINK DATA FILE(mdf and log files)

Posted on 2003-11-22
4
976 Views
Last Modified: 2007-12-19
I am shrinking the temp_db file from 30GB. I want to know what effect it can make to my performance. Bascally i need to know why temp_db is used and  why so much space was alloctated to it initalliy. Some ex-dba has done that.

0
Comment
Question by:pg_india
  • 2
4 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 9803801
Temp_Db is used whenever temporary tables are created or whenever someone does large sorts.  Everytime you restart SQL Server tempdb is recreated, but it doesn't hurt to shrink it once in a while if you don't restart the server that often.

Of course, any time you shrink ANY database, it does have an affect on the server because of the extra IO that's involved.

Brett
0
 
LVL 1

Expert Comment

by:yuniar
ID: 9805021
TempDB database size is usually set base on how much space is needed for processing using temporary table. it seems that your setting is too big. you can decrease your tempdb database from SHRINK database option and set file growth to 10% for tempdb database setting
0
 
LVL 3

Author Comment

by:pg_india
ID: 9805361
Thanks you all for your views and experts comments.

I want to know what effect it can make to my performance???
Now that temporary tables are used to store in temp_db shrinking it will make it slower? I mean suppose i have shrinked it After shriking it will reduce the speed of temp_db file??


0
 
LVL 34

Accepted Solution

by:
arbert earned 30 total points
ID: 9806203
You're only going to take a "hit" while the shrink is happening.  You could experience a little bit of lock contention and IO waits.  After the shrink there should be no bad affects (unless for some reason the tempdb has to grow again and then you can get bad performance because of the auto grow and any fragmentation that ocurrs because of it).

Brett
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

861 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