Detaching/Attaching database question

  • I have a general question about detaching/attaching a database with transaction log shipping enabled.

    We have set up on our production database server a database with transaction log shipping.

    I need to do some testing of data migration.

    So I am trying to find out if there are any issues with detaching a database on our testing server and reattaching on the production box and the transaction logs picking up the new tables/data from the dev box.

    If more information is needed let me know.

    Thanks in advance.

    ______________________________
    AJ Mendo | @SQLAJ

  • Have you tested it out?  Let us know.  I would think that it may work since you make sure that the job that backs up the log file and moves it to location on other server and the job that applies the log on the second server will restore the log file.  You should be able to test it with detach the database copy the database files and attach it to your test server.  But make sure that the jobs are is place.  I am curios whether it works or not.  Let us knw AJ.

    Good day,

    Bulent

  • What was done and found.

    Database was created and transaction log shipping was enabled.

    The database is empty as of now.

    We detached our database on the DEV box and attached on the production box.

    Waited the 15 mins for the logs to catch up and the tables did not replicate.

    If you make changes to a "live" database with log shipping enabled the chages will replicate.

    On the other hand if you do as we did the logs do not replicate. This is due to the fact that when you enable log shipping

    it will take a backup of the entire database to run the logs from. If you add new tables in the manner we did SQL Server, or the monitoring engine, does not know what to do witht the new tables and will actually fail and through errors.

    I hope I explained this well enough. If you have questions let me know.

    I will answer them the best I can.

    r/

    AJ

    ______________________________
    AJ Mendo | @SQLAJ

  • Well explained.  Thanks for posting back and let us know.

    Good day,

    Bulent

Viewing 4 posts - 1 through 3 (of 3 total)

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