SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


copy only restore...


copy only restore...

Author
Message
anshu84onnet
anshu84onnet
SSC-Enthusiastic
SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)

Group: General Forum Members
Points: 126 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
Silverfox
Silverfox
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6520 Visits: 1161
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
CC-597066
CC-597066
SSC Veteran
SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)

Group: General Forum Members
Points: 285 Visits: 1159
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.
ChiragNS
ChiragNS
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6793 Visits: 1865
From BOL:

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

"Keep Trying"
Paul White
Paul White
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: General Forum Members
Points: 36190 Visits: 11361
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
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
Atul Kumar
Atul Kumar
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1374 Visits: 617
This is a good point. A new learning for me. Thanks :-)
Atul Kumar
Atul Kumar
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1374 Visits: 617
.:-)
bobby henningsen
bobby henningsen
Old Hand
Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)

Group: General Forum Members
Points: 391 Visits: 51
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 ?
kesavan.rv
kesavan.rv
SSC-Enthusiastic
SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)

Group: General Forum Members
Points: 116 Visits: 209
Hi All,

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

Regards,
k7.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search