Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vaddi
Posting Yak Master
145 Posts |
Posted - 2006-10-20 : 11:49:03
|
Hello ,I have brought the backfiles from the Production server to the Test server using SFTP and placed the backfiles in the location D:\Testbackup\c2k_db_full.bakOn the Test server , I am trying to restore the " TestDB " Database with the backfiles I brought from the prodcution server.I am using the sql statement :RESTORE DATABASE TestDBFROM DISK = 'D:\TestBackup\c2k_db_full.bak'WITH MOVE 'TestDB_Data' TO 'D:\MSSQL\Data\TestDB_Data.mdf',MOVE 'TestDB _Log' TO 'D:\MSSQL\Data\TestDB_log.ldf' But I am getting the Error:Server: Msg 3101, Level 16, State 2, Line 1Exclusive access could not be obtained because the database is in use.Server: Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.What should I be doing now.Thanks |
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2006-10-20 : 12:01:10
|
Run sp_who2 and find any other logins using the db. Once you find them, use the kill command to end their process. Make sure you're not the guilty party and have the db open in enterprise manager.Mike"oh, that monkey is going to pay" |
 |
|
vaddi
Posting Yak Master
145 Posts |
Posted - 2006-10-20 : 12:12:21
|
The above problem was resolved and now I get the error:Server: Msg 3234, Level 16, State 2, Line 1Logical file 'TestDB_data' is not part of database 'TestDB'. Use RESTORE FILELISTONLY to list the logical file names.Server: Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.Do I need to change any logical file names.Thanks |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
|
vaddi
Posting Yak Master
145 Posts |
Posted - 2006-10-20 : 12:36:57
|
Hello VJ,Thanks for the script. I will go throught it and do the required changes.Thanks |
 |
|
|
|
|
|
|