Solved

The tempdB of MS SQL server

Posted on 2013-01-01
6
514 Views
Last Modified: 2013-01-16
Dear all,

right now we consider to place Tempdb in SSD, but the size the SSD is not always large enought.

If we place mulitple tempdB file cross different type of hard disk, like SSD + SAS, can MS SQL still operational if only the tempdB in SSD failed but not SAS?

DBA100.
0
Comment
Question by:marrowyung
  • 3
  • 2
6 Comments
 
LVL 1

Author Comment

by:marrowyung
ID: 38735685
do we have any method to know what is the temp DB size during peak hour?
0
 
LVL 19

Assisted Solution

by:Rimvis
Rimvis earned 200 total points
ID: 38736336
Hi marrowyung,

You can split tempdb to multiple files. So yes, you can put one file on SSD, and another on SAS. But both files should be available. If one of them is inaccessible, you will not be able to start your server.

You can monitor tempdb file size, but this database is recreated every time server restarts. If your server is running long enough, just take a look at file size, this should give you  general understanding.
0
 
LVL 1

Author Comment

by:marrowyung
ID: 38738800
Rimvis,

"If one of them is inaccessible, you will not be able to start your server."

Exactly what I am thinking, I didn't do that before as I don't have a good reason to do this. But if SQL server alwasy like to use file in a round robin manner, and if one of the file is missing and MS SQL is accessing it, MS SQL should return error.

"You can monitor tempdb file size, but this database is recreated every time server restarts. If your server is running long enough, just take a look at file size, this should give you  general understanding. "

Exactly what I told my staff and we should reserve around 40% of buffer in total for the aim of safty.

DBA100.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 51

Accepted Solution

by:
Mark Wills earned 300 total points
ID: 38762821
Short answer is "NO". If your tempdb failed on SSD, the only way it would keep working if there was some kind of hardware (RAID) mirroring and it was a hardware failure.

So, having multiple tempdb's does not mean that any one of them can fail and automatically locked out.

Just how big does your tempdb get ? You can setup SSD's in a mirror (might lose out on the TRIM functionality, but that doesnt really impact all that much in the scheme of things).

For size you can run a script or simple SQL,
USE TEMPDB
go

SELECT name
,type_desc
,physical_name
,size /128.0 size_allocated_MB
,fileproperty(name,'SpaceUsed') / 128.0 size_being_used_MB
,(size-fileproperty(name,'SpaceUsed'))/128.0 size_available_MB
,(fileproperty(name,'SpaceUsed')*1.0 / size) * 100.0 percent_used_MB
,((size - fileproperty(name,'SpaceUsed'))*1.0/size)*100 percent_available_MB
FROM sys.database_files
go

Open in new window

but tempdb is quite erratic in size and usage so best to really get to know and plan for your tempdb : http://technet.microsoft.com/en-US/library/ms345368(v=sql.100).aspx
0
 
LVL 1

Author Comment

by:marrowyung
ID: 38765796
mark_wills,

yeah, we will use the montioring tools to check the peak size of the tempdB file.

But did you frequently see the size change dynamically? except the user/progamming do the 'select * From xxxx', which can kill the tempdB volume as the tempdB keep expanding to the unlimited size.

In 'http://technet.microsoft.com/en-US/library/ms345368(v=sql.100).aspx', what is 'space-use values'?  I can't see how I can use this information to project the real figure.

"Short answer is "NO". If your tempdb failed on SSD, the only way it would keep working if there was some kind of hardware (RAID) mirroring and it was a hardware failure.

So, having multiple tempdb's does not mean that any one of them can fail and automatically locked out."

so this means you agree that setup muitiple tempDB file don't help but hardware mirror on SSD volume can ?

DBA100.
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 38765917
multiple tempdb can help, but not in terms of automatic failover or redundancy. It can help in size and performance. Hardware mirroring does offer that automatic failover, so, any of the RAID versions offering high redundancy is what you want.

yes, you can see tempdb changing size - normally growth (on disk) and any deleted space (within the db) quickly gets reused once released, so dont always see erratic shrinkage (unless you have autoshrink on - not advised).

Probably the "space-use values" you mention is looking at the different consumers / uses for tempdb and mentions the different aspects in both the capacity planning and that troubleshooting links, that troubleshooting link in possibly not the best discussion on tempdb, but, it does show how to identify the different use (albeit not explaining what that is).

There is also : http://technet.microsoft.com/en-US/library/ms175527(v=sql.100).aspx which talks about optimising tempdb. I think all three together should give you the best possible views of tempdb.

If plain size is a problem, then run the query to show the size and available space, and monitor that. If the size is really getting out of hand, then you need to start looking at what is "wasting" the tempdb resource and thats when you need some of the queries from the troubleshooting link.
.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now