144 questions
0
votes
0
answers
24
views
SQL Server 2019 (v15) : tempdb related files eat up about 80 GB on C disk, how to make it small and free up some space in C [migrated]
On Windows Server 2016 and with SQL Server 2019 (v15.0), the tempdb file size is huge at about 80GB and it is divided into many files such as:
tempdb.mdf,
tempdb_mssql_2.ndf
tempdb_mssql_3.ndf
...
...
3
votes
1
answer
218
views
Why is Query Optimizer Underestimating and Causing Data Spill to tempdb?
I have a very simple query that I am testing by running ad-hoc.
The execution plan indicates that data is spilling into tempdb because of poor estimates.
I have been unable to resolve any of the three ...
0
votes
1
answer
379
views
Finding usage of Tempdb by user databases
In my SQL Server, I have 9 user databases and I would like to find out which user database is using how much resources in tempdb, which database is using more and which less, and furthermore, I would ...
6
votes
4
answers
10k
views
Azure VM SQL Server Tempdb on Temporary Storage
We're setting up SQL servers in the Azure cloud using VMs. When we were determining the best setup for our data/logs/tempdb we ran into many blog posts that recommend placing the tempdb on the ...
1
vote
1
answer
189
views
Can a page be anything other than allocated or deallocated?
The documentation for sp_WhoIsActive states
The most confusing of these columns are those related to tempdb. Each of the columns reports a number of 8 KB pages. The [tempdb_allocations] column is ...
2
votes
0
answers
759
views
Utilizing the temp db (#-tables) in dbt instead of CTEs
We are using dbt in combination with SQL Server 2019 and the usage of CTEs are a huge performance drag for us.
The main issue with the CTEs is, that they are deeply nested over several levels. E.g. ...
0
votes
1
answer
393
views
Warning in execution plan about using tempdb in a Sort node
Checking my execution plan it shows a warning in a Top N Sort step
Operator used tempdb to spill data during execution with spill level 1 and 4 spilled thread(s), Sort wrote 4609 pages to and read ...
1
vote
0
answers
191
views
Is Exponential Growth for SQL Server TempDB Normal?
I am in the position of "acting" DBA since our previous DBA left. I haven't had any formal training or the like in SQL Server. I've searched on TempDB autogrowth terms and can find a lot of ...
0
votes
1
answer
279
views
SQL Server 2017 Always Encrypted issue when joining on temp table
We are currently implementing Always Encrypted for some columns in our database, but we are hitting a limitation we cannot explain when joining with temporary tables. We looked at Microsoft ...
1
vote
0
answers
566
views
Tempdb transaction log full
Unable to connect to SQL Server because:
'tempdb transaction log was full due to active transaction'.
There was no way to login to SQL Server to troubleshoot. only option was to restart SQL Server.
...
0
votes
2
answers
2k
views
Microsoft SQL Server : check constraint with generated name
In T-SQL, it's normally best to name all constraints you create, including check constraints.
alter table mytable with check
add constraint myconstraint check (mycol > 0)
If you don't provide ...
0
votes
0
answers
327
views
Direct access to tempdb
An application vendor representative asked me to grant dbowner access to tempdb for their application login; to be able to create objects in tempdb without "#" or "##" prefixes.
I ...
1
vote
0
answers
2k
views
Could not allocate space for object 'dbo.SORT temporary run storage: 142590947360768' in database 'tempdb' because the 'PRIMARY'
Could not allocate space for object 'dbo.SORT temporary run storage: 142590947360768'
in database 'tempdb' because the 'PRIMARY'.....
This error message happened 3 days ago. How can I track down ...
0
votes
1
answer
692
views
Fixed Size TempDB (800Gb), MERGE into very large table failing due to space, is this a limitation of merge?
Thanks for reading, am a bit confused by this, think it is down to the size of TempDB, but unsure why it is happening in this case:
I have a MERGE statement:
DECLARE @LastUpdate DATETIME
SELECT @...
4
votes
2
answers
33k
views
Facing Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'
Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'. Create the necessary space by dropping objects in the filegroup, adding additional files ...
0
votes
0
answers
469
views
SQL Server - Avoiding tempdb storage issues using cursors
I need to insert a very large number of rows into a table from a query, which puts me at risk of exceeding space on tempdb. I am in need of a solution that can avoid this issue, and am considering the ...
0
votes
2
answers
94
views
Alter ADD tempDB inside SELECT?
How can I alter tempdb inside a select?
I want a single query is that possible?
SELECT cust_ac_no, ord_no, ref_no, net_svc_id, job_type, ord_status, ord_status_date, ord_crt_date
INTO tempdb.....
0
votes
0
answers
135
views
TempDB drive Full - Procedure needs much performance?
following situation: We have an azure server with db and the TempDB drive ran full. At this moment we could find a process with much resources need in activity monitor. The process was not killable ...
0
votes
1
answer
231
views
How to exclude tempdb from sp_MSforeachdb?
Below I have a code to get info about t-log backups for each database in the server. I want to exclude tempdb from this list.
exec sp_MSforeachdb 'SELECT server_name, sysdb.name AS DatabaseName, bkup....
1
vote
2
answers
1k
views
How to find/see tempdb in SQL Server
Should I expect to be able to see tempdb tables in SSMS?
e.g. If I run this code, should I expect to be able to see the table in SSMS?
-- Drop the table if it already exists
IF (SELECT OBJECT_ID(...
0
votes
1
answer
7k
views
Sql Server Shrinking temp db mdf and ndf
So my question is that even after the job runs and I'm enforcing the mdf (main tempdb file) to be shrunk to about 10mb or so why is it NOT doing it?
I have tried to run this job after my most heavy ...
-1
votes
1
answer
522
views
SQL Server Masking not working - Does work on Temp DB
When I run the below code on a Temp database it does work, but not when I run it on a normal table. Very weird and not sure what I am missing.
CREATE TABLE #Test (Username VARCHAR(20))
insert into #...
0
votes
1
answer
336
views
Memory Spill in dmvs
In sql server 2014, can we find the queries which spilled into tempdb using dmvs ?
0
votes
0
answers
1k
views
TempDB running out of space for MERGE query
I am using a MERGE Query that is INSERTING over 800 Million records into a table from another table in the same database (conversion project). We run into this error below when it get's to this ...
1
vote
1
answer
952
views
While pivoting lots of rows tempDB gets full in SQL server
I have a query which retrieves around 184K rows and stores into Temporary table. Now, In second query I am first retrieving all the data from Temporary table and pivoting it. While pivoting I am ...