Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

copy only restore... Expand / Collapse
Author
Message
Posted Monday, September 7, 2009 2:37 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, June 30, 2014 9:25 AM
Points: 32, Visits: 130
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
Post #783662
Posted Monday, September 7, 2009 3:11 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, December 18, 2014 3:13 AM
Points: 2,704, Visits: 1,149
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.


--------------------------------------------------------------------------------------
Recommended Articles on How to help us help you and
solve commonly asked questions

Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden
Managing Transaction Logs by Gail Shaw
How to post Performance problems by Gail Shaw
Help, my database is corrupt. Now what? by Gail Shaw
Post #783672
Posted Sunday, September 13, 2009 5:17 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, December 10, 2014 1:32 PM
Points: 51, Visits: 898
A copy only backup can be restored.

It could be used though in situations where you want to take a full database backup to restore somewhere else but have diff backups running as part of the daily houskeeping routines.

As it doesn't reset the base point at which a diff backup refers to it can be deleted once it is no longer required without having to archive it to tape.
Post #787092
Posted Monday, September 14, 2009 4:34 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 8:08 AM
Points: 2,365, Visits: 1,846
From BOL:

Restoring a copy-only full backup is the same as restoring any full backup.


"Keep Trying"
Post #787307
Posted Monday, September 14, 2009 5:31 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: 2 days ago @ 4:18 PM
Points: 9,928, Visits: 11,206
You're both correct, but I prefer CC's answer.

The full reference starts by saying:

Books Online
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


That is an important point, as CC emphasized.

That said, it is also true that the act of restoring a copy-only full backup is identical to a normal full backup, as far as the restore operation is concerned.

Paul




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #787346
Posted Monday, September 14, 2009 6:23 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, August 27, 2013 6:00 AM
Points: 806, Visits: 413
This is a good point. A new learning for me. Thanks
Post #787378
Posted Monday, September 14, 2009 6:23 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, August 27, 2013 6:00 AM
Points: 806, Visits: 413
.
Post #787379
Posted Friday, August 10, 2012 6:40 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, February 22, 2013 12:39 AM
Points: 367, Visits: 49
Well I have another question about copy only backups. Clearly the purpose is to be able to do a backup without interferring the normal backup sequence but it looks like the GUI in SSMS can't handle it when it comes to restore. Here's the scenario :

Full backup
Differential backup

Copy only backup

I move the copy only the backup to my laptop for a later restore.

Then using the GUI in SSMS to restore it suggest to use the copy only backup to restore. This will obviously fail in my scenario. After doing another differential backup the GUI correctly list the Full backup and the last differential as the sequence. But is this expected behaviour ?
Post #1343348
Posted Sunday, June 22, 2014 10:34 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, December 3, 2014 4:53 AM
Points: 19, Visits: 182

Hi All,

Is it possible to restore a copy only backup followed by an differential backup??

Regards,
k7.
Post #1584901
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse