TempDB is part of MS SQL Server. It's a system database that functions as a storage area for temporary tables, internal objects and row versions.

learn more… | top users | synonyms

1
vote
1answer
57 views

SQL Server TempDB size issue

SQL Server reported that our tempdb is out of space. So I had a quick google search and found this on technet https://technet.microsoft.com/en-us/library/ms176029(v=sql.105).aspx Determining the ...
1
vote
0answers
44 views

ms/write on tempdb data files are dead slow

I don't know why writes on my tempdb data files are extremely slow. ms/write on each of the tempdb data files reaches to more than 800 ms!!! that's even after I moved the 8 equally sized (7GB) tempdb ...
2
votes
0answers
14 views

Service broker internal spid hogging tempdb

We've recently decommissioned a rather badly implemented service broker setup after a number of near outages, however while doing my morning checks I've noticed that there are 2 Service Broker ...
4
votes
1answer
95 views

Should we really turn on trace flag 1118 for every SQL instance?

It has been recommended that every SQL instance have TF 1118 turned on What is Paul’s recommendation for using trace flag 1118? Everyone should turn it on, on all instances of SQL Server, from SQL ...
3
votes
1answer
82 views

Is IFI compatible with tempdb growth?

Is IFI (Instant File Initialization) compatible with tempdb growth? Recently I needed to increase my tempdb by 40 Gb and it took 15+ minutes to complete. I verified that the user had already been ...
6
votes
3answers
148 views

Does alter column change datatype use tempdb version store?

I was running alter column from INT to BIGINT, my table size is 250 GB and after 1 hour I got the version store error because tempdb was full. As far as I know it only takes your memory pages and log ...
0
votes
0answers
32 views

Error while accessing TempDB Properties from SSMS

While trying to access TempDB's properties from SSMS (2014 SP1 SSMS) the following error comes up. Any ideas how to fix this? TempDB is owned by 'sa' and I am logged in with the 'sa' account. TITLE:...
0
votes
1answer
45 views

Increasing the number of tempdb files question about initial size

I am planning on increasing the number of tempdbs we have on our sql cluster. I do have one question that I can't seem to find a clear cut answer to... I have one tempdb that is over 50GB and I want ...
3
votes
1answer
81 views

TempDB uses a lot of space in buffer pool

I'm running a SQL Server 2014 with 2 cores and a max memory of 6GB. When I'm checking what's in the buffer pool, I see that TempDB uses 1GB of memory. That's the query I used: SELECT COUNT(*) AS ...
2
votes
1answer
65 views

Difference size DBCC Page and DBCC Fileheader

I'm trying to read the current database size using dbcc command. In my test I execute following commands: DBCC Fileheader('tempdb',1) => size = 988152 DBCC Page('tempdb',1,0,3) => size = 5112 ...
2
votes
0answers
31 views

SAN Admin vs. DB Admin free allocated tempdb

I really want to understand. My SAN-Admin told me I have to make sure my TempDB does not grow to max hard disk space. I have 380 Gig on a dedicated disk, on a dedicated LUN, on a dedicated machine. My ...
4
votes
4answers
172 views

tempdb growth and shrinking tempdb

I’m a DBA that is fairly new to SQL Server coming over from a UNIX/Informix. I have a question about tempdb growth: From what I can see on regular databases if I start with a database that is 10 GB ...
2
votes
1answer
52 views

Temp DB space allocated- will it be reclaimed ever?

I have observed that the tempdb in the production environment has grown over to 100 GB after initializing it. I understand that due to server load and some expensive queries have resulted to the ...
13
votes
1answer
230 views

TempDB contentions

We have an active OLTP 40GB database on SQL Server 2014 SP1. Queries are found to be slow with IO_Completion waits, Disk Queue Length rising to 900, and SQL Server stops responding. What we tried: ...
2
votes
0answers
30 views

Very high avg_write_stall_ms for tempdb [duplicate]

What could be causing (and how to fix) my tempdb files (8 equal size) to have [avg_write_stall_ms] of 7300ms and the next highest data file is 47ms. System is Hyper-V fail-over cluster, SQL 2012 ...
6
votes
1answer
119 views

How to solve blocking on tempdb

I am having tempdb contention (I guess, at least) on one of the servers (SQL Server 2008 R2). Both the blocker and the waiters (10 of them) has PAGELATCH_EX wait type on database tempdb and all ...
10
votes
1answer
182 views

Does CREATE TABLE SomeSchema.#TempTableName have a bug?

Simple test-bed: USE tempdb; GO /* This DROP TABLE should not be necessary, since the DROP SCHEMA should drop the table if it is contained within the schema, as I'd expect it to be. */ ...
1
vote
1answer
213 views

'Logical file name “MyDB” is already in use' Even though the database doesn't exist [closed]

I recently was given a SAN with a couple of RAID arrays to apply to my database server to increase performance. I have (and will only ever have) one user database called DDAS, in addition to the ...
2
votes
1answer
67 views

Removing Tempdb .ndfs

Tempdb is configured with 8 files and we are reducing them to 4. I read many blogs where SQL Server will allow you to remove excess .ndf's if you run the 4 dbcc drop and free statements, then run the ...
1
vote
2answers
77 views

Locked TempDB Log

So we're running into an issues where TempDB's log is currently locked up. After checking log_reuse_wait_desc, we see that it is locked from an active transaction. Now the weird part is that when we ...
6
votes
2answers
191 views

sys.dm_sql_referenced_entities fails to provide used columns list when joining with temp table

I think I need some help as I run out of ideas. In my database I have a simple table like this: CREATE TABLE dbo.Invoices ( CashDiscounts MONEY, Cost MONEY ) GO and a stored ...
5
votes
1answer
117 views

How can I minimize impact of expensive queries in Database A on Databases B, C, D

How can I configure SQL Server so that activity in 'Database A" has minimal impact on users in 'Database B' The Context Our (very large) production SQL Servers have a lot of databases on them ...
8
votes
1answer
1k views

Very high transactions per second

Our production server runs on average 4,000 transactions per second. In the past few days the average has jumped to 175,000 transactions per second. That is not a typo, it's 175K per sec. Looking at ...
2
votes
1answer
1k views

The connection is broken and recovery is not possible - sql server error

I am having the following sql server error, while creating tempDB files. Any ideas? The connection is broken and recovery is not possible. The client driver attempted to recover the ...
2
votes
0answers
134 views

How to use variables in a PL/pgSQL function with dynamic queries?

...and when must I use EXECUTE ... quote_ident(variable)? Taking an input to the function as text and storing part as a variable: wtype := split_part(message, ' ', 4); realval := split_part(message,...
1
vote
0answers
181 views

Moved tempdb, now File 'tempdev2' does not exist

I moved the tempdb first locating the files: use master select name, physical_name from sys.master_files where database_id = DB_ID('tempdb'); GO then I moved each file: use master go alter ...
1
vote
2answers
471 views

Understanding the usage of version store in tempdb

We are trying to analyze the growth of tempdb on one of our SQL server 2005 Ent SP4. I know tempdb would need the space depending upon the transactions, and how queries are designed to use it. We ...
0
votes
1answer
141 views

Moving TempDB data and log files

I had to move tempDB files around. Both data and log file were originally on c:\ drive. I moved the mdf file to E:\ drive and log file to F:\ drive. This was successful and I was able to get SQL ...
8
votes
3answers
254 views

IF statement not skipping TempDB when Looping through Databases with sp_MSForEachDB

[SQL Server 2012 SP2 EE] Why does the following script gives me an error relating to tempdb? exec sp_MSForEachDB ' IF ( (select database_id from sys.databases where name = ''?'') > 4) ...
2
votes
1answer
135 views

Controlling how tempdb activity is split across drives (tempdb on both solid state and spinning drives)

I'm seeing the following tempdb I/O behavior over a one hour period: There is a fair amount of disk I/O generated by multiple DW workloads executing on the machine, some of which cannot fit in the ~...
3
votes
1answer
95 views

DBCC CHECKDB Estimation Alternative

I am in the process of rolling out DBCC CHECKDB across our instances. Each database will eventually either have a DBCC CHECKDB or DBCC CHECKDB PHYSICAL_ONLY. The way I have been gauging whether a ...
1
vote
2answers
417 views

TempDB default number of files in SQL Server 2016

Noticed the docs for SQL Server 2016 CTP2 state "by default, setup adds as many tempdb files as the CPU count or 8, whichever is lower." https://msdn.microsoft.com/en-us/library/bb510411(v=sql.130)....
0
votes
1answer
246 views

LDF files vs. TRN files vs. Tempdb.MDF+LDF files.:

We have a dilemma… We have all of our MDF and LDF files in the same…\192.168.6.22\d$\Program Files\Microsoft SQL Server\DATA\Production...folder. We have all of our TRN and BAK files on the…\192.168.6....
0
votes
2answers
158 views

Chaning tempdb settings on production database

I have to change the initial size and autogrowth of my tempdb on production. Along, with that I have to add new files to tempdb. What is the right way to do it? As it is production and I don't want to ...
3
votes
1answer
63 views

When are the unnecessary row versions being removed from the version store

Sorry for my bad English :) I need a help with understanding version store`s cleaning. I have the following situation. 12:00 Start a select statement under the snapshot isolation level and not ...
4
votes
1answer
244 views

Tempdb change settings and recommendation

In my production database I have below configuration in TempDb and needless to say I am facing a lot of IO issues on the drive . So, as per recommendation I am planning to change it Change #1 ...
0
votes
1answer
101 views

Why temdb and log file size is not reduced by SQL Server

With a series of question Part1, Part2 and Part3. With the answers and research on internet I came to know that TemDb is use for holding different values (ex.: Temp variable, Temp table, CTE, Hash ...
4
votes
1answer
247 views

IO request time and less write latency

I am facing issues related to constantly growing log file due to which I am getting error. When I checked SQL Log I found below messages (error log is filled of these messages almost 90%) SQL ...
6
votes
1answer
422 views

MS SQL high tempdb disk I/O during merge replication of BLOBs

Having a merge publication for replicating BLOBs (sql type - image), got very high tempdb disk I/O for my size of data. Publication is download-only and has no filters. High disk I/O is caused by ...
1
vote
0answers
49 views

tempdb contention issue and excessive pagewrites/s

Still removing the rust from my SQL Server skills, so please bear with some stupid questions here and there... Customer has a SQL Server 2008 R2 running in an Azure VM with 8 cores and 14GB RAM. ...
0
votes
0answers
44 views

Temp db increasing size

Is awaiting/sleeping commands shown while executing 'sys.dm_tran_locks' a reason for the increasing size of temp db? I have already tried of changing the backing up temp db in an external disk .
7
votes
1answer
323 views

Sudden increase in Page Writes/s after patching / rebooting

I was given a SQL Server 2008R2 to run, but my DBA skills are rusty after some years away from the day-to-day ops, so please bear with my (somewhat) silly questions. This SQL Server is running in ...
1
vote
1answer
151 views

TempDB Best Practices For Shared Storage [closed]

Microsoft recommends separating the SQL Data Files from the Temp Files to limit device contention but what about cases involving shared storage. I have a shared environment where the data and temp ...
1
vote
1answer
454 views

Tempdb growing, however it has a lot of free space

On a sql server dedicated to a Dynamics CRM database, I've been seeing some odd behavior. While monitoring growth using the following query as basis, I've noticed tempdb has grown quite frequently ...
3
votes
1answer
562 views

PAGELATCH_EX on 2:1:128

We are having problems on SQL Server 2012 with contention on tempdb page 2:1:128, which seems to be related with system table sysobjvalues. We have about 400 sessions waiting on this resourse 2:1:...
1
vote
1answer
126 views

Tempdb files don't exist

I have a strange behaviour on one of my SQL Server's tempdb. It has six tempdb files, according to SSMS and queries, all pointing to S directory. Each of them have ~5gb of initial size. The weird ...
3
votes
1answer
101 views

Suspect (Torn) Pages recorded in TEMPDB? (SQL Server 2005 SP3)

I have a virtualised SQL Server 2005 (SP3) server that reported the following msg: Database_Name, Database_Id, File_Id, Event_Type, Event_Type_Desc, Error_Count, Last_Update_Date tempdb, 2, 1, 3, ...
1
vote
2answers
309 views

How are these tempdb tables automatically created after each SQL Server restart?

I have a session state management implementation using SQL Server. There is an ASPState database, and ASPStateTempApplications & ASPStateTempSessions tables in the tempdb database. When I restart ...
0
votes
1answer
50 views

Tempdb tables, table in database or even cte for usp for reporting

I am about to start a project for SSRs report base on a USP. The procedure will have to use two cursors to compare orders v stock position (similar to a mrp run ): I am thinking of storing the data ...
2
votes
1answer
322 views

Moving a SQL Server TempDB of AlwaysOn members [closed]

We have two SQL Server instances on Azure Windows virtual machines. Always on availability group is configured between them. We need to move TempDB on both instances, is there a risk that something ...