Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

Identify the queries that are using the most space in tempdb / Export tempdb table data?

$
0
0
We have SQL Server 2014 EE SP1 running on Windows Server 2012 R2 Standard O/S. First Item:I had a tempdb with eight data files to grow all of a sudden by 8 GBs each. When I checked the actual used space of each data file, it showed only 11-12 MBs. I narrowed this spike in growth down and determined that it occurred in the month of November. I did this by tracking the database growth. I restarted the sql server service and it recreated the tempdb with the last configured (by ALTER command) file sizes which was 4 GBs per data file.I am currently setting up alerts to notify me when the data files rises above a certain threshold. However, I would like to be able to determine what process or query or maintenance activity is causing this spike. This has occurred only once so far. This is a new system that has been running about 8 months. I am researching this issue and currently reading: Troubleshooting Insufficient Disk Space in tempdbhttps://msdn.microsoft.com/en-us/library/ms176029.aspxIs there a simpler way, to identify the queries that are using the most space in tempdb? Say, if an alert is sent that indicates the tempdb data files sizes have spiked, I would like to run a simple query to see what queries are currently in tempdb? Or, I could get the alert to fire off this query.Second Item:Is there a way to export tempdb data? I attempted to export data out of several of the TempDB tables via right click database, select Tasks, and select Export Data. I have tried the Microsoft OLE DB Provider for SQL Server and the SQL Server Native Client 10.0 and 11.0 Data Sources. I received the following error:TITLE: SQL Server Import and Export Wizard------------------------------Could not connect source component.Error 0xc0202009: Source - #A1D806E5 [1]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.Error 0xc02020e8: Source - #A1D806E5 [1]: Opening a rowset for "[dbo].[#A1D806E5]" failed. Check that the object exists in the database.I read this article below but it is focused on using BCP.Exporting Data from or Importing Data to a Temporary Tablehttps://technet.microsoft.com/en-us/library/ms191503(v=sql.105).aspxThanks in advance for any help or suggestions.

Viewing all articles
Browse latest Browse all 6525

Trending Articles