September 10, 2012 at 3:59 pm
I just installed sql erver 2008 server on my machine. I tried to move the model ldf and mdf files to different folder.
So, I executed
ALTER DATABASE model modify file (name = 'modeldev', filename = 'E:\SQLData\model.mdf')
ALTER DATABASE model modify file (name = 'modeldev', filename = 'F:\Log\modellog.mdf')
Then I stopped the service and moved the physical files to the appropirate folder...When i tried to
restrat the service, it wouldn't as it couldn't find 'F:\Log\modellog.mdf; it is actually F:\Log\modellog.ldf file.
Now I can't go back to the master db to change it as the service is down. Any way to get corrected?
Thanks in advance.
September 10, 2012 at 4:05 pm
Since the log and data files are in separate directories and disks. It shouldn't hurt to rename the log file to the .mdf file name and then start SQL Server. Once up, redo your alter statement for the log file, shut down SQL Server then rename the file back to .ldf.
It really doesn't matter what the extension on the file is, SQL Server will know what it is.
September 10, 2012 at 5:32 pm
Thanks a lot. That worked like a charm. One more question? How do i change the default location of creating a data file and log file? I thought changing the model db would do it but it doesn't. The databse will be created through different application (for e.g, sharepoint)....It doesn't have a way to specify where to create it. It just creates at the default location..But I like to change to create on DATA folder and LOG folder...(Two different drives).
September 10, 2012 at 5:35 pm
Never mind. Got it. It was under the database settings.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply