Questions tagged [tempdb]
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.
334 questions
1
vote
2
answers
7k
views
Can multiple instances of procedure create same #Temp simultaneously? [closed]
I have a procedure which inserts data into #temp table.
After performing certain manipulations to the data, it stores data from #temp table to some other table.
I cannot run multiple instances of this ...
3
votes
1
answer
346
views
Tempdb size strategy
I've recently started my role as a DBA and my initial task has been to take ownership and redeploy a database provided by a 3rd party to help us conform to GDPR legislation.
As a consequence, I've ...
0
votes
1
answer
329
views
Increasing tempdb data files on 2 node Availability Group
I am planning to create additional tempdb files for 2 nodes in a SQL 2012 Availability Group. Unfortunately we do not have Instant File Initialisation turned on so the growth of the tempdb data files ...
0
votes
1
answer
620
views
Secondary Tempdb filling up on AG Setup
I'm currently facing this problem in one of my Production environments.
I have an AG with around 130 DBs with readable secondaries enabled. However, there are not routing lists defined and ...
1
vote
1
answer
884
views
SQL queries to find tempdb bloating
I am trying to find out the queries which would have run and caused bloat to TempDB.
I am able to pull data like TempDB bloating on one particular day where it almost ate upto 300 GB of space, was ...
1
vote
0
answers
2k
views
SQL Server: Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'
I've just put in a request for our storage engineers to add more physical space for the LUN with tempdb. In this case, it was definitely needed. However, I'm disturbed by the SCOM report which flagged ...
1
vote
1
answer
534
views
Filestream directory exists for a partition but the corresponding partition does not exist in the database
I am investigating a high memory usage issue of tempdb on a production SQL Server 2017 Enterprise (64-bit) deployment. This is similar to an issue discussed here. The server has two production DBs ...
1
vote
1
answer
254
views
Is it a problem to have a large TempDB?
We have a vendor that has jobs set up to execute a stored procedure that builds a table in TempDB, creates indexes on it, inserts 100s of GB of data into it, does whatever it needs to with the data, ...
1
vote
2
answers
330
views
Tempdb Splitting File/Filegroups among different Databases
A common problem placing databases on one server Instance is they all share same tempdb. Is it possible to allocate tempdb file/and filegroups for separate databases. Does Resource Governor allow this?...
2
votes
1
answer
5k
views
Unable to remove additional tempdb file
In our production DB, we only have 1 tempdb file and it had ballooned to 180GB.
I ran:
Alter Database tempdb
modify file (name='tempdev', size=30gb);
to resize the primary file, and then ran ...
2
votes
1
answer
125
views
SQLServer tempdb datafiles
SQL newbie here, trying to understand how tempdb work when there is more than one datafile.
To keep this simple, let's assume the server has three tempdb datafiles, each 10GB, totaling 30GB and are ...
7
votes
2
answers
15k
views
what is the best practice for tempdb autogrowth?
I have a client's server with about 15 databases on this instance with a data total of about 100 GB. One of the databases is for a sysaid app.
his temp db files are one mdf one ndf and of course an ...
1
vote
0
answers
842
views
SQL TempDB PCI-E NVMe card - 4K or 64K
Our primary OLTP workload is tempdb heavy (both reads & writes) based on virtual_file_stats DMV, and based on SPs all of which heavily use #tmp tables.
The server has 400GB of memory, more than ...
11
votes
2
answers
11k
views
How to Move TempDB Files to a Different Drive or Folder? [duplicate]
How do I move my TempDB Data or Log File(s) from wherever they are now to a different Drive or Folder?
1
vote
1
answer
383
views
Is SQL Server's fill strategy the same for multi-file tempdb as multi-file (non-tempdb) filegroups?
Will tempdb I/O from a single query be split across multiple tempdb files? (assuming that tempdb is configured to use multiple files, of course!)
For non-tempdb databases, MDSN seems to say that yes, ...
1
vote
0
answers
525
views
Sys.dm_io_virtual_file_stats shows high latency for tempdb writes
We just got a new SAN and I was looking at sys.dm_io_virtual_file_stats to make sure we are seeing an improvement compared to our last SAN. I noticed that all the tempdb files are seeing avg write ...
13
votes
1
answer
9k
views
Why does truncating a temp table at the end of the stored procedure that creates it free tempdb space faster?
SQL Server caches temp tables created within stored procedures and merely renames them when the procedure ends and is subsequently executed. My question has to do with when the tempdb space is ...
3
votes
3
answers
691
views
Configuring physical storage for a Microsoft SQL Server installation
I'm configuring a Microsoft SQL Server installation which will use a SAN for storage. For SAN storage I have:
A small number of SSD disks
A larger number of 10K disks
My SAN supports storage ...
5
votes
1
answer
195
views
Tempdb approaching disk max: Is it OK to wait?
Today my tempdb pushed up to the edge of the disk allocated. Currently, said disk only has 10 MB left. I'm pretty sure some bad reports run by a colleague earlier in the day pushed up the tempdb to ...
2
votes
1
answer
5k
views
temp tables in tempdb are not cleaned up by the system
My question is similar to the one asked here: SQL Server tempdb rogue temporary tables
Since I don't have enough points to comment and the answer there doesn't address my concern, I can only ask a ...
-1
votes
1
answer
5k
views
What could cause tempdb to remain large after restart?
After deploying an SSIS solution I found that tempdb filled up all the remaining hardrive space (250GB). I was then able to shrink it to about 70GB, where it has stayed even after a computer restart (...
2
votes
1
answer
3k
views
DBCC CHECKDB grows tempdb to a huge size - Legacy MS SQL Server 2008 R2 Instance
I have an older Microsoft SQL Server Instance (2008 R2 SU3 GDR - Build: 10.50.6220). When I run DBCC CHECKDB via a Maintenance Plan, the TempDB grows very large.
The largest DB on the instance is ...
1
vote
1
answer
1k
views
TEMPDB File Growth with Multiple Files
There are a lot of blog postings about splitting tempdb into multiple files, and I understand the logic and reasoning behind this, but there is one question that never seems to get asked about a multi-...
2
votes
3
answers
1k
views
Possibility to implement time to execute / TempDB usage restrictions on some role groups in SQL Server?
I have a SQL Environment of which I am sysadmin. This Environment includes the Company data warehouse. I conduct many different jobs from this Environment, and it is also Another sysadmin which has ...
1
vote
0
answers
894
views
Time-out tempdb
When the job is running, it takes a time-out error. Usually it works, sometimes get any errors.
Job schedule : Occurs every day 3 minute
Time-out occurred while waiting for buffer latch type 3 for ...
4
votes
0
answers
619
views
Adding more tempdb data files gives more write latency
I am facing problems with tempdb please help and provide your suggestions.
Initially, I have found tempdb contention problem in my server (Sql server) by using Simple talk Script. By using that ...
0
votes
2
answers
121
views
SQL Server - What taks/queries should I need to execute when there is a lack of space in TempDB?
I am having some troubles loading data to my fact table. Every time that I want to insert, I'm getting the following issue:
Could not allocate space for object 'dbo.SORT temporary run storage: ...
1
vote
1
answer
69
views
IDERA suggests to alter procedures in tempdb
Idera analysis is suggesting I:
USE [tempdb]
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC ##zDP_235302...
Is this really a good idea? Most of the "fixes" their diagnostic software ...
0
votes
1
answer
2k
views
Risks associated with automatically shrinking TempDB as a SQL agent job?
I have a situation where I have a constraint on TempDB to not exceed 350 GB in size. I'm using autogrowth 10 (percent) on TempDB, as I've read that it is supposed to be best practice on databases ...
1
vote
1
answer
664
views
SQL server Stored Procedure temp variable value mismatching sometime
I have created one stored procedure (sp) in SQL server and that sp contains temporary Variables for holding calculated values. Later in my code I am inserting those values to one of the permanent ...
1
vote
1
answer
300
views
Howto recover SQL 2016 cluster instance with bad tempdb path setting?
Today I have changed the tempdb's file locations using the ALTER DATABASE MODIFY command and I have accidentaly set it to use the root of the volume. The SQL Server service failed to restart and came ...
0
votes
1
answer
3k
views
Getting PAGELATCH_UP:tempdb:1(PFS) with so many waiting queue [closed]
Getting PAGELATCH_UP:tempdb:1(PFS) with so many waiting queue. What can be solution?
We have two hexacore processors. Ideally how much tempdb can we create to handle this issue?
1
vote
1
answer
199
views
Remove Local RAID Drive from MS SQL Windows Cluster
We recently stood up a production SQL Server 2014 Enterprise on a two-node Windows Failover cluster (Active/Passive). We had some SSD's laying around and decided to use them for the tempdb for one of ...
0
votes
1
answer
153
views
TempDB on Shared VHDX
Multiple nodes within a cluster. Using HyperV as the virtualisation layer. VMs use Fibre Channel SAN for storage but trying to explore the possibility of using Local SSDs for the TempDB. Issue is when ...
0
votes
1
answer
2k
views
SQL Server TempDB transaction log Issue
I've worked with SQL Server for some time and I understand the various issues that one can run into with TempDB. But, with this latest issue, if I have my issue figured out correctly, is it possible ...
1
vote
1
answer
2k
views
Shrinking TEMPDB
Is it necessary to restart SQL Server after DBCC SHRINKFILE on tempdb.mdf and tempdb.ldf or is there any other method to reduce the size of tempdb.mdf and tempdb.ldf without restarting SQL Server?
Is ...
1
vote
1
answer
261
views
SQL Server TempDB on Local SSDs with VMs
Two physical Servers in a Cluster. Multiple SQL 2016 Virtual Machines. Fibre Channel SAN Storage used for the Virtual Machine Operating System and Database Data Files. I've seen multiple sources claim ...
13
votes
4
answers
68k
views
Allocate space for object 'dbo.SORT temporary run storage
DBCC CHECKDB returns:
Could not allocate space for object 'dbo.SORT temporary run storage:
140737951236096' in database 'tempdb' because the 'PRIMARY' filegroup
is full.
Create disk space ...
9
votes
2
answers
13k
views
Database collation different from tempdb collation
I just received the source code and database of an application from my client (it was developed by another company, from a different country) and the application is throwing some exceptions related to ...
15
votes
2
answers
13k
views
SQL Server tempdb on RAM Disk?
Our vendor application database is very TempDB intensive.
The server is virtual (VMWare) with 40 cores and 768GB RAM, running SQL 2012 Enterprise SP3.
All databases including TempDB are on Tier 1 ...
7
votes
3
answers
5k
views
Recommendations for more than one tempdb file
I would like to split tempdb into two files with same size, to improve performance of the database.
I wonder if these two data files can be on the same disk, separately from the logs and users data ...
9
votes
2
answers
3k
views
Query memory grant and tempdb spill
I have a long running query (fact table with 100 million rows joining a number of small dim tables then group by) that's spilling to tempdb, even though (after some tweaking) the CE is very close to ...
1
vote
0
answers
110
views
Using TempDB in SP causes to compile plan PER CONNECTION
uses sp_blitzcache by Brent Ozar
SQL SERVER 2012 (11.0.6020.0)
Steps to reproduce:
create table b (b int)
create table #b (b int)
create procedure Y as
begin
insert into b select 1
select * from b
...
3
votes
1
answer
7k
views
Why does FREEPROCCACHE let you shrink tempdb?
Somebody did something stupid and tempdb exploded in size. Alerts are firing because the drive is full. I tried shrinking it, and it would not shrink (even though shrink queries said they worked).
...
2
votes
1
answer
1k
views
AUTO_CREATE_STATISTICS set to OFF in tempdb
It has come to my attention that a number of my databases (2008 & 2012) do not have the setting AUTO_CREATE_STATISTICS set to ON for the tempDB.
In the Microsoft documentation it is set to ON as ...
2
votes
1
answer
3k
views
High write latancy in temp db
I'm in a sort of "accidental dba" role at the moment. I'm attempted to monitor and improve a db. I've been using a script from a Udemy course (I could post but it might be a bit long). I've been ...
7
votes
1
answer
897
views
TempDB internal space usage slowly growing from service broker
Am running SQL Server 2012 (11.0.6540.0) in a AO high availability group with one other server.
tempDB usage usually sits around 819MB (averaged over a week from 2 weeks ago) but since we did a fail-...
2
votes
1
answer
7k
views
How to find which query is causing tempdb growing? [duplicate]
Good day.
I'm trying to discover which query is causing tempdb growing too much (around 100gbyte).
In my new company, people is using a lot of dynamic Excel files with various query.
I'm pretty ...
3
votes
2
answers
3k
views
How can I tell if my tempdb database has a performance issue/need to add more data files?
SQL Server works in database called tempdb to handle a lot of tasks. Query operations like joins and aggregations happen there. Online index rebuilds, order by, aggregate function, triggers are also ...
1
vote
3
answers
1k
views
tempdb log file usage huge by sleeping status sessions but not relased the space
We have a alert threshold of tempdb usage on drive level at 90% and getting lot of alerts. But the first problematic point is the tempdb usage occupied whole drive of 500GB among Log file only ...