Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
14 views

Stored Procedure call from Web App creates Very Large File on C drive [on hold]

We have a SP that is a Select that is creating a very large file (7GB+) on our C drive. Our Databases are stored on a separate drive. I've searched to determine the location of these files without ...
3
votes
1answer
145 views

Log for database tempdb is not available

I have been struggling with this issue from so many months now, I am saying its not a database issue and assigning this case to Storage and Operating system team and they are assigning it to me ...
1
vote
1answer
81 views

In memory table vs temporary table - benefits if temdb in already on ram disk

In the docs, we have example of how temporary tables can be replaced with in-memory tables and because a memory-optimized table: is stored only in memory, and has no component on disk involves no IO ...
0
votes
0answers
33 views

My Temp db is full [duplicate]

What to do when tempdb is full ? I would like to know if tempdb has become full and what to do if you can't truncate the log? I want to understand the process why you can't truncate it.
1
vote
3answers
39 views

When I connect to DB, always connects as tempdb

I am trying to run a sybase DB query from a jsp session. I can connect to the DB fine, but when I run my query, by default it always runs against tempdb. Is there a way I can make a connection to ...
1
vote
0answers
89 views

How we can clear tempdb without restart MSSQL service [duplicate]

While checking my tempdb details, its showing that almost 90 GB is consumed. So I tried clearing all caches and perform shrinking, but still it's consuming 90 GB of space. My drive became full where ...
2
votes
0answers
97 views

Aggressive Tempdb spill process

We are having an issue with aggressive tempdb spills that significantly effect overall server performance and, in rare cases, cause AlwaysOn failures. Tested on SQL2016 and SQL2017 Enterprise (recent ...
0
votes
1answer
68 views

Should TempDB SSD Drive be formatted with 64 Kb Allocation Unit Size?

We have installed dedicated SSD drives for TempDB First question - should these drives be formatted with 64 Kb allocation size ? Currently it shows 4 Kb (Bytes per Cluster = 4096) Does TempDB ...
1
vote
1answer
69 views

Understanding the TempDB growth

Need to understand below behavior of tempdb:- Due to some poor running queries which caused Tempdb bloating, we had shrink and tried to adjust the sizes of each tempdb file: Before issue: no of ...
2
votes
1answer
198 views

How to clear temp database content in SQL Server?

As the title implies, I am going to clear the content of my temp database in SQL Server. SolarWinds is generating a critical alert and I want to clear the tempdb workfiles and worktables. How can I ...
4
votes
1answer
64 views

SQL Server 2016 still uses mixed_extent_allocation in TempDB

Today I was troubleshooting a problem on TempDB on SQL Server 2016 SP2 using extended events and added the mixed_extent_allocation and transaction_log event to my trace. I expected ...
5
votes
3answers
551 views

How to inspect global temp table from outside the transaction it is created in

To help debugging a batch of SQL (that is run inside a transaction), inside the transaction I dump some data into a global temporary table. The global temporary table is created inside the transaction ...
3
votes
1answer
111 views

SQL Server 2016 with high tempdb usage and low RAM usage

I've got a small instance of SQL Server Standard that I'm running HammerDB TPC-H (1 GB) benchmarks on. It's got some configuration issue though where it's writing everything into tempdb on disk, and ...
1
vote
1answer
105 views

Tempdb ndf files on different drives

So I inherited a server that has serious write latency issues according to a script provided by glen berry, I also noticed that the tempdb files are spread across multiple drives. What could be the ...
14
votes
1answer
354 views

Sort spills to tempdb but estimated rows equals to actual rows

On a SQL Server 2016 SP2 with max memory set to 25GB we have a query that executes about 80 times in a minute. The query spills about 4000 pages to tempdb. This causes for a lot of IO on the disk of ...
10
votes
3answers
475 views

Sort spills to tempdb due to varchar(max)

On a server with 32GB we are running SQL Server 2014 SP2 with a max memory of 25GB we have two tables, here you find a simplified structure of both tables: CREATE TABLE [dbo].[Settings]( [id] [...
7
votes
4answers
626 views

Does LocalDB support temporary tables?

Are SQL Server temporary tables (prefixed with #) supported in LocalDB instances?
0
votes
0answers
230 views

Unexplainable write latency tempdb

I have a virtual SQL Server 2016 SP2 CU2 with SAN storage. TempDB has 8 files. I know it is recommended to put TempDB on SSD but TempDB is hardly used so spinning disks are cheaper. I've noticed that ...
2
votes
2answers
304 views

Memory issues: Tempdb using Almost all of the buffer cache

On one of the servers I am working on today, i see that almost all of the buffer cache is filled by tempdb. As a result memory is very low on the server. CPU Tempdb: Version: Microsoft SQL ...
0
votes
1answer
40 views

What happen when a transaction is committed and SNAPSHOT isolation is enabled?

I am actually considering using SNAPSHOT isolation for one WCF service. Before doing so, I would like to know how it works. AFAIK, when it's enabled, updated rows are maintained in tempDB (instead of ...
1
vote
1answer
829 views

“The transaction log for database 'tempdb' is full due to 'ACTIVE_TRANSACTION'.” after adding indexes to temp tables

Recently, I added some indexes on temp tables to procedures which prepare data for data warehouse. On a testing db, tests of these procedures worked fine but when running on client's server it failed ...
0
votes
0answers
72 views

Moving tempdb from shared to local drive in a failover cluster

We have an existing failover cluster that I would like to have the tempdb in local drive. I'm not sure how to proceed. My thought process is below: Create two drives on each node one for tempdb and ...
0
votes
1answer
100 views

SQL Server Version Store Performance differences between RCS and ASI

I understand that Read Committed Snapshot (RCS) operates at statement level, and Allow Snapshot Isolation (ASI) operates at transaction level, and both store row versions in tempdb. I also understand ...
1
vote
1answer
202 views

Why do LocalTemp table showing with lengthy underscore under Temporary Tables of tempdb in SSMS 2017 Express Edition? [duplicate]

In my Microsoft SQL Server 2017 Express Edition, I have created a local temp table using below create statement, create table #localtemptable (tempid int,tempname varchar(20) ) After creating #table,...
0
votes
0answers
51 views

Does splitting 1 tempdb file into 4 require a SQL Server restart? [duplicate]

please can anyone help? I have a SQL 2008R2 instance with 4 cores, configured with 1 tempdb data file and 1 logfile. I want to change this setup as per best practices by adding 3 additional euqally ...
1
vote
0answers
34 views

Restricting users to execute queries that bloat up tempdb

we have many a times faced a scenario where bad queries using tempdb just bloats up this system database filling 700 GB of tempdb in like couple of hours. I know there is a scope to tune them up. But ...
3
votes
2answers
156 views

Tempdb with Multiple mdf and Renaming

We just inherited a legacy Tempdb database with Multiple MDF files. Tempdb1 is the primary. Example: Tempdb1.MDF Tempdb2.MDF Tempdb3.MDF (1) Was tempdb2.mdf and tempdb3.MDF being ignored the whole ...
0
votes
1answer
156 views

Tempdb Configuration best practices

I've been asked to provide my input on best practices to improve tempdb performance. I realise that this is a case by case basis and tempdb in one estate may have different requirements to another due ...
0
votes
0answers
55 views

TempDB log file bloated suddenly [duplicate]

I am trying to understand what could be the possible reason which would have caused tempdb ldf file grow full and went out of space on the drive it resides. Compared the pattern for last month and ...
3
votes
1answer
1k views

Tempdb Add files require Restart

Does adding Tempdb files require a restart? We would like to Add files on the same drive, Not Delete and Not modify. We tested in Dev and QA environment, restart was not required. However for ...
0
votes
2answers
227 views

Tempdb files Solid state on Same drive?

We currently have tempdb (8 files) on solid state drive. We know that primary mdf and transaction log ndf are recommended to be on different drives, to reduce contention. Should tempdb files be on ...
2
votes
1answer
683 views

How can I track down what's filling my 'tempdb' transaction log?

We have a large and fairly well tuned SQL Server 2016 Enterprise Edition. Given the number of cores we have, our tempdb is currently comprised of 16 2,950 MB files running on a ram disk with a 16 GB ...
4
votes
1answer
72 views

CONVERT_IMPLICIT when inserting a Geography datatype into a Geography datatype column on Temp Table

@@Version Microsoft SQL Server 2008 R2 (SP3) - 10.50.6220.0 (X64) If I try to insert data into a geography datatype in a temp table I get a CONVERT_IMPLICIT, converting a Geography datatype to a ...
4
votes
2answers
493 views

Contention on tempdb due to high concurrency temp table creation from multiple databases?

I have an environment with ~100 databases, all with the same schema. There is a stored procedure on each database that creates a #temp table and drops it, and is running very often (every 30 seconds ...
3
votes
1answer
315 views

Disk sizing considerations for 'tempdb' - Growing substantially two times a year

I have an HR software on which an employee of the HR department runs long and complex analyses and calculations about two times in a year. Because of this the tempdb is growing to 500GB and even more. ...
1
vote
2answers
906 views

Temp DB is growing continuously in SQL server

I have used temp tables and drop the same in the every stored procedure in my database. When I try to check my tempdb data using Select * from tempdb.sys.tables, I am getting many tables with names ...
5
votes
1answer
828 views

dbo.SORT temporary run storage: 148643705716736' What does this number means?

I totally understand what this error means and how to resolve. My question is what does this number (148643705716736) referring to? Date 5/7/2018 1:36:58 AM Log SQL Server (...
7
votes
2answers
423 views

SQL Server tempdb on SSD showing IO

We recently separated out our tempdb files to a new SSD and have started seeing: 5348 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [T:\tempdb\tempdb4.ndf] . We ...
1
vote
2answers
1k views

Can multiple instance of procedure create same #Temp simultaneously?

I have a procedure which is inserting data into #temp table. After performing certain manipulations to the data, it store data from #temp table to some other table. I cannot run multiple instance of ...
3
votes
1answer
139 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
1answer
48 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
1answer
120 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
1answer
274 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
0answers
673 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
0answers
82 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
1answer
92 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
2answers
163 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?...
0
votes
1answer
251 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
1answer
75 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
2answers
4k 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 ...