March 9, 2010 at 1:46 pm
Vivek29 (3/9/2010)
Who said to run it production server? I am giving an alternative to shrink tempdb without restarting server as asked in the very first post.This will help I guess:cool:
Your suggestion will not help with reducing the size of tempdb. That will clear the cache held in memory.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 9, 2010 at 1:50 pm
It will.I witnessed it.See my post..I said after clearing cache, perform shrink operation.:smooooth:
March 9, 2010 at 2:02 pm
Vivek29 (3/9/2010)
It will.I witnessed it.See my post..I said after clearing cache, perform shrink operation.:smooooth:
But why would you need to clear the cache (RAM) to shrink tempdb (disk)? Makes no sense as far as I can see.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
March 9, 2010 at 2:35 pm
Vivek29 (3/9/2010)
It will.I witnessed it.See my post..I said after clearing cache, perform shrink operation.:smooooth:
I am somewhat skeptical about that.
Freesystemcache:
Releases all unused cache entries from all caches. The SQL Server 2005 Database Engine proactively cleans up unused cache entries in the background to make memory available for current entries. However, you can use this command to manually remove unused entries from all caches.
DBCC FREESESSIONCACHE
Flushes the distributed query connection cache used by distributed queries against an instance of Microsoft SQL Server.
I might bite on the freesessioncache if the premise is that a distributed transaction is causing the log growth. But, you must still find out what is causing the log growth. One should not run these commands in a production environment unless in a scheduled outage.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 9, 2010 at 4:14 pm
Yes, DBCC FREESESSIONCACHE can be used in case of distributed environment.Agree, not to use in Production environment unless you have a maintenance window.
March 9, 2010 at 7:24 pm
A 32GB TempDB just isn't necessary IF the code is well written. You need to find out what is using that much space. Normally, it'll be a reporting query that has the word DISTINCT or maybe GROUP BY in it that has a lot of joins and someone doesn't know their data and have caused an accidental partial cross-join. Find the bad query first before you do anything else.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 9, 2010 at 7:52 pm
gupta1282 (3/9/2010)
Hi AllOur TempDB mdf file size is 32617 MB and Unallocated Space showing 32607 MB
but size of mdf file is not reducing after shrinking.
Why This happening ? How to regain this huges amount of space
Thanks
Ghanshyam
I might bite on the freesessioncache if the premise is that a distributed transaction is causing the log growth. But, you must still find out what is causing the log growth. One should not run these commands in a production environment unless in a scheduled outage.
OP is talking about mdf not ldf file, i would just first check initial mdf file size, then
DBCC shrinkdatabase with notruncate first to compact pages
DBCC Shrinkdatabase with truncateonly option to free disk for OS
As Lynn said monitor growth of the file and go from there.
March 9, 2010 at 8:43 pm
GTR (3/9/2010)
gupta1282 (3/9/2010)
Hi AllOur TempDB mdf file size is 32617 MB and Unallocated Space showing 32607 MB
but size of mdf file is not reducing after shrinking.
Why This happening ? How to regain this huges amount of space
Thanks
Ghanshyam
I might bite on the freesessioncache if the premise is that a distributed transaction is causing the log growth. But, you must still find out what is causing the log growth. One should not run these commands in a production environment unless in a scheduled outage.
OP is talking about mdf not ldf file, i would just first check initial mdf file size, then
You're right. I meant tempdb growth and not log growth.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 10, 2010 at 12:17 am
Just one point...
http://support.microsoft.com/kb/307487
From said article:
IMPORTANT: If you run DBCC SHRINKDATABASE, no other activity can be occurring with the tempdb database.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 10, 2010 at 12:25 am
GTR (3/9/2010)
DBCC shrinkdatabase with notruncate first to compact pagesDBCC Shrinkdatabase with truncateonly option to free disk for OS
What's the reason for doing them separately when running Shrinkdatabase without options does both?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 11, 2010 at 9:01 am
Hi,
If there is huge growth in tempdb size then,i suggest rebooting the server wont help much..so i think,we should findout why tempdb is growing so much and important is to see what time it is growing..and after that we can run profiler at that particular time and analyse the trace to findout which query is causing the tempdb to grow.
To see what time the tempdb is growing,we can schedule a job to run every 10 min,that will capture the space utilisation on tempdb.
Thanks,
Deepak.:-)
March 12, 2010 at 7:21 pm
dpsahu30 (3/11/2010)
Hi,If there is huge growth in tempdb size then,i suggest rebooting the server wont help much..so i think,we should findout why tempdb is growing so much and important is to see what time it is growing..and after that we can run profiler at that particular time and analyse the trace to findout which query is causing the tempdb to grow.
To see what time the tempdb is growing,we can schedule a job to run every 10 min,that will capture the space utilisation on tempdb.
Thanks,
Deepak.:-)
I think Jason has a good post of how to do this:
http://www.sqlservercentral.com/articles/Log+growth/69476/
HTH,
\\K
______________________________________________________________________________________________________________________________________________________________________________________
HTH !
Kin
MCTS : 2005, 2008
Active SQL Server Community Contributor 🙂
March 13, 2010 at 10:44 am
SQL_Quest-825434 (3/12/2010)
I think Jason has a good post of how to do this:
http://www.sqlservercentral.com/articles/Log+growth/69476/
HTH,
\\K
Thanks, I think it is a good solution too 😉
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 13 posts - 16 through 27 (of 27 total)
You must be logged in to reply to this topic. Login to reply