The procedure you described should work fine. But I suspect your .ldf file is
not really from that database.
Linchi
"caperneus@.gmail.com" wrote:
> I am trying to move a log file to a non-RAID drive. I have detached
> the database and made a copy of the .ldf file. I have taken this copy
> of the .ldf file and placed it where I want it to be. I would like to
> keep the .mdf file where it is located on the RAID drive, but for some
> reason I can only reattach if the .ldf file is in the same location as
> the .mdf file.
> I have then run:
> USE MASTER
> GO
> EXEC sp_attach_db @.dbname = N'Corporate',
> @.filename1 = N'F:\Web\MSSQL$WEB\Data\Corporate_Data.mdf',
> @.filename2 = N'E:\Web\Corporate\Corporate_Log.ldf'
> And it returns:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
> Is this possible?
>
Instead of detached and attached try backup and restore ...
BACKUP DATABASE Corporate
TO DISK = 'E:\backup_corporate.bak'
WITH INIT
Drop the database, and delete the mdf and ldf file (or just back it up)
Then the Restore:
RESTORE DATABASE Corporate
FROM DISK = 'E:\backup_corporate.bak'
WITH RECOVERY,
MOVE '[datafilelogicalname]' TO 'F:\Web\MSSQL$WEB\Data\Corporate_Data.mdf',
MOVE '[loglogicalname]' TO 'E:\Web\Corporate\Corporate_Log.ldf'
Hope that works.
Lucas
<caperneus@.gmail.com> wrote in message
news:1181852163.020692.243720@.a26g2000pre.googlegr oups.com...
> On Jun 14, 2:44 pm, Linchi Shea <LinchiS...@.discussions.microsoft.com>
> wrote:
> It is really from that database. I can attach it back with no problems
> if the files are in the same directory.
>
Showing posts with label suspect. Show all posts
Showing posts with label suspect. Show all posts
Friday, March 23, 2012
Monday, March 12, 2012
Move SQL 7 DB to Another SQL 7 Server
Hello,
I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
easy task. However, I'm having troble finding how to do it.
I want to move a database off of one SQL 7 server and onto another existing
SQL 7 server. How can I go about doing this?
Thanks for your help, it's very much appreciated!
BHave a look at these. While some may be specific to 2000 it should note when
it is.
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scr...sp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues
Andrew J. Kelly SQL MVP
"Brian" <bhanley72@.yahoo.com> wrote in message
news:OPGr1az$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
> easy task. However, I'm having troble finding how to do it.
> I want to move a database off of one SQL 7 server and onto another
> existing
> SQL 7 server. How can I go about doing this?
> Thanks for your help, it's very much appreciated!
> B
>
I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
easy task. However, I'm having troble finding how to do it.
I want to move a database off of one SQL 7 server and onto another existing
SQL 7 server. How can I go about doing this?
Thanks for your help, it's very much appreciated!
BHave a look at these. While some may be specific to 2000 it should note when
it is.
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scr...sp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues
Andrew J. Kelly SQL MVP
"Brian" <bhanley72@.yahoo.com> wrote in message
news:OPGr1az$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
> easy task. However, I'm having troble finding how to do it.
> I want to move a database off of one SQL 7 server and onto another
> existing
> SQL 7 server. How can I go about doing this?
> Thanks for your help, it's very much appreciated!
> B
>
Move SQL 7 DB to Another SQL 7 Server
Hello,
I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
easy task. However, I'm having troble finding how to do it.
I want to move a database off of one SQL 7 server and onto another existing
SQL 7 server. How can I go about doing this?
Thanks for your help, it's very much appreciated!
B
Have a look at these. While some may be specific to 2000 it should note when
it is.
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scri...p?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues
Andrew J. Kelly SQL MVP
"Brian" <bhanley72@.yahoo.com> wrote in message
news:OPGr1az$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
> easy task. However, I'm having troble finding how to do it.
> I want to move a database off of one SQL 7 server and onto another
> existing
> SQL 7 server. How can I go about doing this?
> Thanks for your help, it's very much appreciated!
> B
>
I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
easy task. However, I'm having troble finding how to do it.
I want to move a database off of one SQL 7 server and onto another existing
SQL 7 server. How can I go about doing this?
Thanks for your help, it's very much appreciated!
B
Have a look at these. While some may be specific to 2000 it should note when
it is.
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scri...p?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues
Andrew J. Kelly SQL MVP
"Brian" <bhanley72@.yahoo.com> wrote in message
news:OPGr1az$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
> easy task. However, I'm having troble finding how to do it.
> I want to move a database off of one SQL 7 server and onto another
> existing
> SQL 7 server. How can I go about doing this?
> Thanks for your help, it's very much appreciated!
> B
>
Move SQL 7 DB to Another SQL 7 Server
Hello,
I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
easy task. However, I'm having troble finding how to do it.
I want to move a database off of one SQL 7 server and onto another existing
SQL 7 server. How can I go about doing this?
Thanks for your help, it's very much appreciated!
BHave a look at these. While some may be specific to 2000 it should note when
it is.
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues
Andrew J. Kelly SQL MVP
"Brian" <bhanley72@.yahoo.com> wrote in message
news:OPGr1az$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
> easy task. However, I'm having troble finding how to do it.
> I want to move a database off of one SQL 7 server and onto another
> existing
> SQL 7 server. How can I go about doing this?
> Thanks for your help, it's very much appreciated!
> B
>
I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
easy task. However, I'm having troble finding how to do it.
I want to move a database off of one SQL 7 server and onto another existing
SQL 7 server. How can I go about doing this?
Thanks for your help, it's very much appreciated!
BHave a look at these. While some may be specific to 2000 it should note when
it is.
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
Restoring a .mdf
http://www.support.microsoft.com/?id=307775 Disaster Recovery Articles
for SQL Server
http://www.support.microsoft.com/?id=274463 Copy DB Wizard issues
Andrew J. Kelly SQL MVP
"Brian" <bhanley72@.yahoo.com> wrote in message
news:OPGr1az$EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I'm not a DBA (obviously!) and want to perform what I suspect is a fairly
> easy task. However, I'm having troble finding how to do it.
> I want to move a database off of one SQL 7 server and onto another
> existing
> SQL 7 server. How can I go about doing this?
> Thanks for your help, it's very much appreciated!
> B
>
Subscribe to:
Posts (Atom)