• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 564
  • Last Modified:

The tempdB of MS SQL server

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
marrowyung
Asked:
marrowyung
  • 3
  • 2
2 Solutions
 
marrowyungSenior Technical architecture (Data)Author Commented:
do we have any method to know what is the temp DB size during peak hour?
0
 
RimvisCommented:
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
 
marrowyungSenior Technical architecture (Data)Author Commented:
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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Mark WillsTopic AdvisorCommented:
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
 
marrowyungSenior Technical architecture (Data)Author Commented:
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
 
Mark WillsTopic AdvisorCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now