Hi NG,
I have made copies of the MDF- and LDF-files of several databases. for some
reason I couldn't restore the databases in the usual way, because MSSQL
Enterprise Manager told me, that the database was "currently in use". well,
I deleted those databases. now I would like to restore the databases from
the MDF- and corresponding LDF-files.
1) how is that possible?
2) the MDF-file for three databases have the names
<databasename>_Data.MDF - but one MDF-file has only the name
<databasename>.MDF without the "_Data" - what could be the reason for this?
any help is highly appreciated!
best regards, jens
Backup and restore is generally performed using the TSQL BACKUP and RESTORE command. Not by copying
the database files for a database.
However, you might be able to attach this database using sp_attach_db. This is documented in Books
Online. Note that this is only documented to work if you first actually detached the database. If
you didn't (only copied the files), it *might* work.
> 2) the MDF-file for three databases have the names <databasename>_Data.MDF - but one MDF-file has
> only the name <databasename>.MDF without the "_Data" - what could be the reason for this?
Because the person who created the database decided to name the files this way.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jens Mertens" <no@.no.com> wrote in message news:OnA$S6ZHGHA.3200@.tk2msftngp13.phx.gbl...
> Hi NG,
> I have made copies of the MDF- and LDF-files of several databases. for some reason I couldn't
> restore the databases in the usual way, because MSSQL Enterprise Manager told me, that the
> database was "currently in use". well, I deleted those databases. now I would like to restore the
> databases from the MDF- and corresponding LDF-files.
> 1) how is that possible?
> 2) the MDF-file for three databases have the names <databasename>_Data.MDF - but one MDF-file has
> only the name <databasename>.MDF without the "_Data" - what could be the reason for this?
> any help is highly appreciated!
> best regards, jens
>
>
|||Thanks, I'll try the re-attach thing!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> schrieb
im Newsbeitrag news:eMYdkDaHGHA.1388@.TK2MSFTNGP11.phx.gbl...
> Backup and restore is generally performed using the TSQL BACKUP and
> RESTORE command. Not by copying the database files for a database.
> However, you might be able to attach this database using sp_attach_db.
> This is documented in Books Online. Note that this is only documented to
> work if you first actually detached the database. If you didn't (only
> copied the files), it *might* work.
>
> Because the person who created the database decided to name the files this
> way.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Jens Mertens" <no@.no.com> wrote in message
> news:OnA$S6ZHGHA.3200@.tk2msftngp13.phx.gbl...
>
No comments:
Post a Comment