How to create a copy only backup in SQL Server

If you have scheduled regular backups in SQL Server, there is sequence LSN for every backup you made, if you perform a temporal full backup without the copy only option that sequence will affected and you may face problems during a recover, because during a recovery you may be asked for the temporal full backup you made and if you don’t have it you will face problems during recovery. The following script creates a backup with the copy only option.

 

-- Create full backup with Copy only option enabled
BACKUP DATABASE AdventureWorks2008R2
TO DISK = 'C:\AdventureWorks.bak'
WITH COPY_ONLY
GO
 

You can use the following script to find out the LSN backup sequence number:

 
SELECT database_name, backup_start_date, is_copy_only,
first_lsn
FROM msdb..backupset
WHERE database_name = 'AdventureWorks2008R2'
ORDER BY backup_start_date DESC
GO






 


Regards,

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

http://mswindowscr.org

http://comunidadwindows.org

Costa Rica

Technorati Tags: SQL Server

LiveJournal Tags: SQL Server

del.icio.us Tags: SQL Server

http://ecastrom.blogspot.com

http://ecastrom.wordpress.com

http://ecastrom.spaces.live.com

http://universosql.blogspot.com

http://todosobresql.blogspot.com

http://todosobresqlserver.wordpress.com

http://mswindowscr.org/blogs/sql/default.aspx

http://citicr.org/blogs/noticias/default.aspx

http://sqlserverpedia.blogspot.com/

Note: Cross posted from Eduardo Castro.

Permalink

Comments

Popular posts from this blog

Cómo identificar consultas más pesadas en SQL Server

Permitiendo la administración de los jobs a usuarios que no son System Administrators en SQL Server Agent 2005 o superior

FileTable en SQL Server 2012