• anshu84onnet (9/7/2009)


    Hi i have heard that we cant restore copy only back up.because it does not make change in LSN.but we are using this command and restore is going successfully please find the error or is this method is right.

    backup database AdventureWorks

    to disk='e:\AdventureWorks.bak'

    with copy_only

    restore database replica

    from disk ='e:\adventureWorks.bak'

    with file =1,

    move 'AdventureWorks_Data' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\replica.mdf',

    move 'AdventureWorks_Log' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\replica_log.ldf',

    replace

    I have just run your commands and they backup and restore perfectly, I use copy only backups for adhoc backups for change requests and refreshes.

    BOL mentions :

    A copy-only backup is a SQL Server backup that is independent of the sequence of conventional SQL Server backups. Usually, taking a backup changes the database and affects how later backups are restored. However, occasionally, it is useful to take a backup for a special purpose without affecting the overall backup and restore procedures for the database. For this purpose, copy-only backups were introduced SQL Server 2005.

    Copy-only full backups (all recovery models)

    A copy-only full backup cannot serve as a differential base or differential backup and does not affect the differential base.

    Copy-only log backups (full recovery model and bulk-logged recovery model only)

    A copy-only log backup preserves the existing log archive point and, therefore, does not affect the sequencing of regular log backups. Copy-only log backups are typically unnecessary. Instead, you can create another routine, current log backup (using WITH NORECOVERY), and then use that backup together with all other previous log backups that are required for the restore sequence. However, a copy-only log backup can be created for performing an online restore.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]