SQL Server 2005 database and transaction log location

  • Hi. Can anyone tell me what selections I should make in SQL Server 2005 setup to specify that SQL databases should reside on my D: drive and transaction logs on my E: drive, while leaving the application files in the default path under C:\Program Files?

    I'm guessing I change the installation path for 'Data Files' at the Feature Selection stage, in order to point databases at D:, but what about transaction logs? I can't see any component that explicitly mentions them at this point in setup.

    I don't know if I haven't gone far enough through the install, but I don't really want to install without the selections I'm after and then have to uninstall and start again. Any advice much appreciated.

  • You could always move the files. I use the below script to move tempdb to a diffrent drive other than C:

    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

  • setup is only specifying where system db files go, application database files you can put anywhere SQL has access to on the server later. Just specify data file location and leave system db data and log files in the same location. there is no point seperating system db log files and it can cause problems later on with upgrades.

    one exception to this is tempdb, these files you would move after the install using alter database statement as suggested above. with only a d and e drive start off leaving them with other system dbs though.

    ---------------------------------------------------------------------

  • to specify locations for user databases go into SSMS and right click the registered\connected SQL instance and select properties.

    Under database settings you specify the default folder for data files and for log files

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 4 posts - 1 through 3 (of 3 total)

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