Tuesday, March 27, 2012

attach databases without detaching

If i have all the mdf and ldf files that comprise of a database, is it
guaranteed that i can always attach the db even if they are not successfully
detached
The only ways i know of a successful attach are if the databases are
detached successfully and if SQL is gracefully shut down.
There are so many 3rd party tools that replicate these files asynchronously
or have these files mirrored on a bit level,etc... and then they just stop
the replication or mirroring and claim they can attach it... Will this work
all the time ?
Or lets put it this way... Under what conditions will attach not work even
if i have all the relevant data and log filesIf SQL Server has been shut down and the files copied or they were dettached
properly there shouldn't be too much of a problem. But if they simply
attempt to copy the files while SQL Server is running there is not telling
what they will get.
Andrew J. Kelly SQL MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:O1NLrfIkEHA.384@.TK2MSFTNGP10.phx.gbl...
> If i have all the mdf and ldf files that comprise of a database, is it
> guaranteed that i can always attach the db even if they are not
successfully
> detached
> The only ways i know of a successful attach are if the databases are
> detached successfully and if SQL is gracefully shut down.
> There are so many 3rd party tools that replicate these files
asynchronously
> or have these files mirrored on a bit level,etc... and then they just stop
> the replication or mirroring and claim they can attach it... Will this
work
> all the time ?
> Or lets put it this way... Under what conditions will attach not work even
> if i have all the relevant data and log files
>|||If you did not detach the database, there is no guarantee that an attach
will always work, even if you shut down the database and copy the data and
log files.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:O1NLrfIkEHA.384@.TK2MSFTNGP10.phx.gbl...
> If i have all the mdf and ldf files that comprise of a database, is it
> guaranteed that i can always attach the db even if they are not
successfully
> detached
> The only ways i know of a successful attach are if the databases are
> detached successfully and if SQL is gracefully shut down.
> There are so many 3rd party tools that replicate these files
asynchronously
> or have these files mirrored on a bit level,etc... and then they just stop
> the replication or mirroring and claim they can attach it... Will this
work
> all the time ?
> Or lets put it this way... Under what conditions will attach not work even
> if i have all the relevant data and log files
>|||echoing Andy and Peter, if you have multiple log files for a single DB it is
almost guranteed that an attach will not work without a prior detach.
"Peter Yeoh" wrote:

> If you did not detach the database, there is no guarantee that an attach
> will always work, even if you shut down the database and copy the data and
> log files.
> Peter Yeoh
> http://www.yohz.com
> Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
>
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:O1NLrfIkEHA.384@.TK2MSFTNGP10.phx.gbl...
> successfully
> asynchronously
> work
>
>

No comments:

Post a Comment