Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Moving TempDb transaction log to a new Hard Drive.

Author  Topic 

mdelgado
Posting Yak Master

141 Posts

Posted - 2002-07-11 : 14:35:55
Hello all.

I currently have the log and data file for TempDB on the C drive.

When I run big queries I get the following error message:

Server: Msg 9002, Level 17, State 6, Line 4
The log file for database 'tempdb' is full. Back up the transaction log for the database to free up some log space.
Server: Msg 1105, Level 17, State 1, Line 4
Could not allocate space for object '(SYSTEM table id: -1036114597)' in database 'TEMPDB' because the 'DEFAULT' filegroup is full.


When I see this I notice that the C drive is out of room and and the Transaction Log for TempDb has grown significantly.

I would like to move the Transaction log for TempDb to a new drive but the 'Detach Dbase' option is grayed out in Enterprise manager.

Any Ideas??

thanks


setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-07-11 : 14:41:27
You can't move it in one fell swoop, unfortunately, but you can fix the maximum file size of the log on C: and define a new file on another drive to make room.

Jonathan Boott, MCDBA
Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-07-11 : 16:22:27
Just use alter database e.g.

use master
go
Alter database tempdb modify file (name = tempdev, filename = 'E:\Sqldata\tempdb.mdf')
go
Alter database tempdb modify file (name = templog, filename = 'E:\Sqldata\templog.ldf')
go

Then stop and start sql service and hey presto its done. Don't forget to delete the old tempdb file(s). Bookmark this very useful KB article
[url]http://support.microsoft.com/default.aspx?scid=kb;EN-US;q224071[/url]

HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -