Professional Web Applications Themes

Attaching and Detaching databases. - Microsoft SQL / MS SQL Server

2)It will not work when you just copy. There are not just people working on your database. You have threads and agents [Lions and Tigers and Bears.] (just who is doing auto statistics anyway) People have tried it against my advice and failed. 2) you may want to detach it to know it is not being monkeyed with, or spend resources looking to make a connection. I sometimes will attach a copy to add the latest definitions, then detach it. "Sender" <userdomain.com> wrote in message news:eJ1xmuJSDHA.2228tk2msftngp13.phx.gbl... > I use to attach and detach the database when I have to move ...

  1. #1

    Default Re: Attaching and Detaching databases.

    2)It will not work when you just copy. There are not just people working
    on your database. You have threads and agents [Lions and Tigers and Bears.]
    (just who is doing auto statistics anyway)
    People have tried it against my advice and failed.

    2) you may want to detach it to know it is not being monkeyed with, or
    spend resources looking to make a connection. I sometimes will attach a
    copy to add the latest definitions, then detach it.

    "Sender" <userdomain.com> wrote in message
    news:eJ1xmuJSDHA.2228tk2msftngp13.phx.gbl...
    > I use to attach and detach the database when I have to move my SQL Server
    > database from one SQL Server machine (source machine) to another SQL
    Server
    > machine (destination machine). On the source machine I detach the database
    > (not through T-SQL but) through Enterprise Manager. Then I copy the .mdf
    and
    > .ldf files in a disk and copy them to destination machine and attach them
    to
    > this machines SQL Server.
    >
    > My questions is:
    >
    > (1) What would happen if we don't detach the database and just copy the
    ..mdf
    > and .ldf files and attach it to destination machine? Is detachment of
    > database is done just to make sure that no body is connected to your
    > database while you are copying the .mdf and .ldf files?
    >
    > (2) What are the other reason for which we detach the databases? Is it
    just
    > done for one application that is to move (copy) database to another
    > location (destination machine)?
    >
    > Thanks in advance.
    >
    >

    Jay Schmitendorf Guest

  2. #2

    Default Re: Attaching and Detaching databases.

    It's not even an option and should not be considered if you want to ensure
    the integrity of your database. Even if you did get it to reattach you
    could not be guaranteed the data was in a consistent state.

    --

    Andrew J. Kelly
    SQL Server MVP


    "Sender" <userdomain.com> wrote in message
    news:eJ1xmuJSDHA.2228tk2msftngp13.phx.gbl...
    > I use to attach and detach the database when I have to move my SQL Server
    > database from one SQL Server machine (source machine) to another SQL
    Server
    > machine (destination machine). On the source machine I detach the database
    > (not through T-SQL but) through Enterprise Manager. Then I copy the .mdf
    and
    > .ldf files in a disk and copy them to destination machine and attach them
    to
    > this machines SQL Server.
    >
    > My questions is:
    >
    > (1) What would happen if we don't detach the database and just copy the
    ..mdf
    > and .ldf files and attach it to destination machine? Is detachment of
    > database is done just to make sure that no body is connected to your
    > database while you are copying the .mdf and .ldf files?
    >
    > (2) What are the other reason for which we detach the databases? Is it
    just
    > done for one application that is to move (copy) database to another
    > location (destination machine)?
    >
    > Thanks in advance.
    >
    >

    Andrew J. Kelly Guest

Similar Threads

  1. Attaching to an email
    By cylurian@gmail.com in forum PERL Modules
    Replies: 1
    Last Post: May 18th, 10:59 PM
  2. robust-iterator; detaching observers automaticly ?
    By Simon Strandgaard in forum Ruby
    Replies: 2
    Last Post: October 4th, 09:31 PM
  3. Federated Databases, joins across databases etc
    By Benjamin Stewart in forum IBM DB2
    Replies: 2
    Last Post: August 1st, 03:05 PM
  4. Detaching templates
    By DeaconMike webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 7
    Last Post: July 28th, 03:38 PM
  5. detaching
    By Uros Gruber in forum PHP Development
    Replies: 0
    Last Post: July 8th, 08:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139