Tempdb Move

  • I have been give a server which is in an active/passive cluster. The tempdb db is on the same drive with the mdf files. The log files are on a separate drive set. I was considering moving the files (there are no other drives available) to the log file drives. Any thoughts on this move (this is an oltp server) I have the script below to move them, but I was know I need to restart the server (which I don;t want to happen). Other than that any gotchas for this.

    Thanks

    USE master;

    GO

    ALTER DATABASE tempdb

    MODIFY FILE (NAME = tempdev, FILENAME = 'D:\SqlServer\Data\tempdb.mdf');

    GO

    ALTER DATABASE tempdb

    MODIFY FILE (NAME = templog, FILENAME = 'D:\SqlServer\Data\templog.ldf');

    GO

  • Script looks fine. The SQL service has to be restarted for this to take effect. Until it is, the change is only made in the database metadata.

    Edit: I would strongly recommend against moving TempDB to the log drive on an OLTP server. A lot of tempDB activity will slow down writes to the tran log and will slow the entire system down. If you have no where to move it to, rather leave it with the data files for now and see if you can get more drives for it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply