Deattach or take offline the DB to copy

  • tushaar.kudalkar (7/27/2009)


    Hi

    U need to stop the server services or else u will not be able to move ur .mdf and .ldf files

    Do we really need to stop the services? i guess once u detach a db, the mdf and ldfs will not be in use by sql server and hence u can move the files without restarting the services.



    Pradeep Singh

  • Thanks,

    the suggestions helped me a lot.

    regards

    viji

  • VIJI,

    I am new to SQL but i am going to try your advice.

    1) how stop all current transaction to that DB (let my db name be Analytic)

    2) after taking it offline Just copying the Analytic.mdf and analytic.ldf to network location with click of your mouse will work? ( because I tried it doing it w/o taking it offline and gave me error: other users might be using it please stop the process and try again)

    3) if yes , then I can delete current mdf and ldf file and just create a new one with same names ?

    4) then bring it online and everything should work normal , Any idea of it not working when taking it online?

    except the fact I lose current data in production

    Please advice.

    Best

    Ash

  • tushaar.kudalkar (7/27/2009)


    Hi

    U need to stop the server services or else u will not be able to move ur .mdf and .ldf files

    This is not true. The only time you would need to do ths is if there are jobs that will access this database. And, if that is true, you will only need to stop and disable the affected jobs. Stopping the service is overkill.

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Please note: 4 year old thread.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 5 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply