|
Home > Archive > MS SQL Server > October 2006 > Need help restoring a bak file
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Need help restoring a bak file
|
|
| keithb 2006-10-24, 6:37 pm |
| I did a restore WITH MOVE on a bak file that was made on another server.
Now, the mdf and ldf files are located in the data sub-folder, but the
database is not attached. When I try to attach it, I get this error message:
"The process cannot access the file because it is being used by another
process." I would appreciate any possible help getting this resolved. The
full text of the error message is posted below.
Thanks,
Keith
TITLE: Microsoft SQL Server Management Studio
------------------------------
Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)
For help, click:
http://go.microsoft.com/fwlink? Pro...er&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
------------------------------
CREATE FILE encountered operating system error 32(The process cannot access
the file because it is being used by another process.) while attempting to
open or create the physical file 'C:\Program Files\Microsoft SQL
Server\MSSQL. 1\MSSQL\Data\db12807
9827.mdf'. (Microsoft SQL Server, Error:
5123)
For help, click:
http://go.microsoft.com/fwlink? Pro...23&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
| |
| Uri Dimant 2006-10-24, 6:37 pm |
| keithb
If you made a restore to the database , there is no need to attach the db
again
"keithb" <noreply@dslextreme.com> wrote in message
news:eGQV3BC8GHA.4708@TK2MSFTNGP05.phx.gbl...
>I did a restore WITH MOVE on a bak file that was made on another server.
>Now, the mdf and ldf files are located in the data sub-folder, but the
>database is not attached. When I try to attach it, I get this error
>message: "The process cannot access the file because it is being used by
>another process." I would appreciate any possible help getting this
>resolved. The full text of the error message is posted below.
>
> Thanks,
>
> Keith
>
> TITLE: Microsoft SQL Server Management Studio
> ------------------------------
>
> Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)
>
> For help, click:
> http://go.microsoft.com/fwlink? Pro...er&LinkId=20476
>
> ------------------------------
> ADDITIONAL INFORMATION:
>
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
>
> ------------------------------
>
> CREATE FILE encountered operating system error 32(The process cannot
> access the file because it is being used by another process.) while
> attempting to open or create the physical file 'C:\Program Files\Microsoft
> SQL Server\MSSQL. 1\MSSQL\Data\db12807
9827.mdf'. (Microsoft SQL Server,
> Error: 5123)
>
> For help, click:
> http://go.microsoft.com/fwlink? Pro...23&LinkId=20476
>
> ------------------------------
> BUTTONS:
>
> OK
> ------------------------------
>
>
| |
| John Bell 2006-10-24, 6:37 pm |
| Hi Keith
Along with Uri's advice check out http://support.microsoft.com/kb/314546 on
how to move database between computers. Make sure that you don't have
orphaned users and the logins are available.
John
"keithb" wrote:
> I did a restore WITH MOVE on a bak file that was made on another server.
> Now, the mdf and ldf files are located in the data sub-folder, but the
> database is not attached. When I try to attach it, I get this error message:
> "The process cannot access the file because it is being used by another
> process." I would appreciate any possible help getting this resolved. The
> full text of the error message is posted below.
>
> Thanks,
>
> Keith
>
> TITLE: Microsoft SQL Server Management Studio
> ------------------------------
>
> Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)
>
> For help, click:
> http://go.microsoft.com/fwlink? Pro...er&LinkId=20476
>
> ------------------------------
> ADDITIONAL INFORMATION:
>
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
>
> ------------------------------
>
> CREATE FILE encountered operating system error 32(The process cannot access
> the file because it is being used by another process.) while attempting to
> open or create the physical file 'C:\Program Files\Microsoft SQL
> Server\MSSQL. 1\MSSQL\Data\db12807
9827.mdf'. (Microsoft SQL Server, Error:
> 5123)
>
> For help, click:
> http://go.microsoft.com/fwlink? Pro...23&LinkId=20476
>
> ------------------------------
> BUTTONS:
>
> OK
> ------------------------------
>
>
>
| |
| Hari Prasad 2006-10-24, 6:37 pm |
| Hello,
No issues... While you do a restore with Move option the database is
restored. So no need to attach it again. Only thing
is resync the logins and users using the system procedure
sp_change_users_logi
n (See books online).
FYI, You could also copy the database from one location to another location
or server using detach and attach.
a. SP_detach_db to detach the database from source server
b. Copy the MDF and LDF to a new location and then execute sp_attach_db to
attach the database in source server
c. Send the file to destination server
d. Execute sp_attach_db to attach the database
See command usage in books online.
Thanks
Hari
"keithb" <noreply@dslextreme.com> wrote in message
news:eGQV3BC8GHA.4708@TK2MSFTNGP05.phx.gbl...
>I did a restore WITH MOVE on a bak file that was made on another server.
>Now, the mdf and ldf files are located in the data sub-folder, but the
>database is not attached. When I try to attach it, I get this error
>message: "The process cannot access the file because it is being used by
>another process." I would appreciate any possible help getting this
>resolved. The full text of the error message is posted below.
>
> Thanks,
>
> Keith
>
> TITLE: Microsoft SQL Server Management Studio
> ------------------------------
>
> Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)
>
> For help, click:
> http://go.microsoft.com/fwlink? Pro...er&LinkId=20476
>
> ------------------------------
> ADDITIONAL INFORMATION:
>
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
>
> ------------------------------
>
> CREATE FILE encountered operating system error 32(The process cannot
> access the file because it is being used by another process.) while
> attempting to open or create the physical file 'C:\Program Files\Microsoft
> SQL Server\MSSQL. 1\MSSQL\Data\db12807
9827.mdf'. (Microsoft SQL Server,
> Error: 5123)
>
> For help, click:
> http://go.microsoft.com/fwlink? Pro...23&LinkId=20476
>
> ------------------------------
> BUTTONS:
>
> OK
> ------------------------------
>
>
|
|
|
|
|