briangriffin
Programmer
I'm no DBA, but since we don't have one here it falls on me - I'm hoping for a quick lesson in database maintenance.
SQL Server 2008, very little data actually is stored on the server. All files reside on the C: drive, which is 32 gigs with 7 gigs currently free. I have 50+ gigs free on another local drive.
The problem surfaced when running a linked server query against an Oracle database. I have to park data in three temp tables, then query against them to return the dataset.
Error messages:
Code:
Msg 1105, Level 17, State 2, Line 98
Could not allocate space for object 'dbo.SORT temporary run storage: 140737496023040' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Msg 9002, Level 17, State 4, Line 98
The transaction log for database 'tempdb' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
I looked on the C: drive and it was full, so I did dbcc shrinkdatabase on tempdb and it freed up 7 gigs. However, when running the query the drive filled up again and I got the same message. The data being stored in the temp tables is minimal, perhaps 40,000 rows total.
Log_reuse_wait_desc value is 'NOTHING'.
Various articles recommend setting tempdb to autogrow, which I did. So my questions are:
1. I'm sure it would be appropriate to move the tempdb files to another drive with more space - what is the best way to accomplish this?
2. Why would relatively small temp tables immediately eat up 7 gigs of storage?
3. If I can't set autoshrink to true on tempdb, do I need to manually shrink it at regular intervals?
As well as any additional information or recommendations you may have.
TIA.