Friday, March 30, 2012

moving transaction logs?

I tried to move the transaction log file of all our db's to a different driv
e
to increase performance.
I tried to do this by detaching the database, copy the *.ldf file to the new
drive an attach the database with the following command:
EXEC sp_attach_db 'Formula1Bingo',
'D:\SQL_DATA\MSSQL\Data\Formula1Bingo.mdf', 'E:\SQL_LOG\Formula1Bingo_log.LD
F'
i got the following error:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name
'E:\SQL_LOG\Formula1Bingo_log.LDF' may be incorrect.
Device activation error. The physical file name
'E:\SQL_LOG\Formula1Bingo_log.LDF' may be incorrect.
New log file 'D:\SQL_DATA\MSSQL\Data\Formula1Bingo_lo
g.LDF' was created.
The database was detached but with a new log file on the D: drive.
The File 'E:\SQL_LOG\Formula1Bingo_log.LDF' definitly exists and the E:
drive is a
native drive not amapped drive.
I configured SQL-Server to use the D: drive as data drive an the E: drive as
transactionlog drive as default. If i create a new database with enterprise
manager, the *.mdb file is on the D: drive and the *.ldf file is on the E:
drive.
The account, the SQL-Server is running with, is also local admin on that
server. This fact and the fact the a new database is working correct let me
conclude that it's not a permission problem.
Thanks for your help
PaulPaul
EXEC sp_attach_db @.dbname = N'Formula1Bingo',
@.filename1 = N'D:\SQL_DATA\MSSQL\Data\Formula1Bingo.mdf',
@.filename2 = N'E:\SQL_LOG\Formula1Bingo_log.LDF'
"Paul Wessiack" <PaulWessiack@.discussions.microsoft.com> wrote in message
news:7A08CB57-69F2-4FD1-A737-1830F0928D28@.microsoft.com...
>I tried to move the transaction log file of all our db's to a different
>drive
> to increase performance.
> I tried to do this by detaching the database, copy the *.ldf file to the
> new
> drive an attach the database with the following command:
> EXEC sp_attach_db 'Formula1Bingo',
> 'D:\SQL_DATA\MSSQL\Data\Formula1Bingo.mdf',
> 'E:\SQL_LOG\Formula1Bingo_log.LDF'
> i got the following error:
> Server: Msg 5105, Level 16, State 4, Line 1
> Device activation error. The physical file name
> 'E:\SQL_LOG\Formula1Bingo_log.LDF' may be incorrect.
> Device activation error. The physical file name
> 'E:\SQL_LOG\Formula1Bingo_log.LDF' may be incorrect.
> New log file 'D:\SQL_DATA\MSSQL\Data\Formula1Bingo_lo
g.LDF' was created.
>
> The database was detached but with a new log file on the D: drive.
> The File 'E:\SQL_LOG\Formula1Bingo_log.LDF' definitly exists and the E:
> drive is a
> native drive not amapped drive.
> I configured SQL-Server to use the D: drive as data drive an the E: drive
> as
> transactionlog drive as default. If i create a new database with
> enterprise
> manager, the *.mdb file is on the D: drive and the *.ldf file is on the E:
> drive.
> The account, the SQL-Server is running with, is also local admin on that
> server. This fact and the fact the a new database is working correct let
> me
> conclude that it's not a permission problem.
> Thanks for your help
> Paul|||Hi Uri,
thanks for your replay, but your command resulted in the same error :-(
... Paul
"Uri Dimant" wrote:

> Paul
> EXEC sp_attach_db @.dbname = N'Formula1Bingo',
> @.filename1 = N'D:\SQL_DATA\MSSQL\Data\Formula1Bingo.mdf',
> @.filename2 = N'E:\SQL_LOG\Formula1Bingo_log.LDF'
> "Paul Wessiack" <PaulWessiack@.discussions.microsoft.com> wrote in message
> news:7A08CB57-69F2-4FD1-A737-1830F0928D28@.microsoft.com...
>
>

No comments:

Post a Comment