Solved

How to allow SQL Server 2005 and/or TempDB to use multiple disk drives for storage space?

Posted on 2006-11-17
5
6,094 Views
Last Modified: 2008-01-09
I am running SQL Server 2005 Developer edition on my home machine and i'm trying to execute a query that takes up most of the available space when I try to run it.  I have some other drives other than C on the computer that have 250+ GB available.  Is there any way to tell SQL Server it can use that space to expand into?

Msg 1105, Level 17, State 2, Line 1
Could not allocate space for object 'dbo.SORT temporary run storage:  172560247422976' 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 1
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

If it helps the log_reuse_wait_desc column says nothing.
0
Comment
Question by:endrec
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:drydenhogg
ID: 17964992
In the SQL Management Studio, open the databases folder, system Databases, right click on tempdb and bring up properties.

go to the files option shown on the left and that will display the current files held for tempdb.

hit add, a new line will appear, name the file (logical name) type data, filegroup primary (this will be the default) initial size (what you wish to allocate to it) and the growth options.

hit ok and you should be set.
0
 
LVL 8

Expert Comment

by:drydenhogg
ID: 17964994
Oh, missed out, the obvious bit doh, set the path of the new file in the filegroup to the appropriate drive that has the space.
0
 

Author Comment

by:endrec
ID: 17965035
I am new to this.  Do you have an example of how to set multiple file(s) filegroups?  Do I need to do this through SQL Server Management Studio, through Alter statements to the DB?
0
 
LVL 8

Accepted Solution

by:
drydenhogg earned 500 total points
ID: 17965075
The SQL Server Management Studio can do it , using the guide above, or in TSQL as follows.

USE [master]
GO
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'YourPreferredName', FILENAME = N'C:\PathToStoreTheFileOn\YourFileName.ndf' , SIZE = 102400KB , FILEGROWTH = 10240KB )
GO

The size / filegrowth you would alter, additional options on that are easier to see / configure via management studio.
0
 

Author Comment

by:endrec
ID: 17974543
Is there anything  I can do about the following error.  I have added an additional file for both the log and the PRIMARY file group (with the method described above).  I reduced the table i'm trying to run a query on to 1/10 of it's original size and I have alloted for over 300GB of disk space but I am still getting the error below.

Msg 1105, Level 17, State 2, Line 1
Could not allocate space for object 'dbo.SORT temporary run storage:  190272201031680' 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.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question