Wednesday, March 28, 2012

Moving Tranaction Logs for existing DBs

Hi,
Just wondering if anyone knows if it's possible to change
locations of a tranaction log of an exisiting database? It
seems whenever I try to detach, move the log and attach it
always looks for the transaction log in the original
location and won't let me specify the new one.
Any help appreciated. Thanks.
-BrianBrian,
While attaching it , mention the new path for the .ldf file explicitly, as
in:
EXEC sp_attach_db @.dbname = N'pubs',
@.filename1 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs.mdf',
@.filename2 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs_log.ldf'
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Brian R." <reaburn.brian@.colteng.com> wrote in message
news:05b201c36017$ab486ab0$a001280a@.phx.gbl...
> Hi,
> Just wondering if anyone knows if it's possible to change
> locations of a tranaction log of an exisiting database? It
> seems whenever I try to detach, move the log and attach it
> always looks for the transaction log in the original
> location and won't let me specify the new one.
> Any help appreciated. Thanks.
> -Brian

No comments:

Post a Comment