RS First Dynamics NAV Blog


...from NAV 3.60 to NAV 2013
Archivio Posts
Anno 2015

Anno 2014

Anno 2013

Anno 2012

Anno 2011

Anno 2010

Anno 2009

Anno 2008

Anno 2007

SQL Server Compressed Backup

Activation with 2 ways:
> from console
> from sql command

//Compression backup activation
EXEC sys.sp_configure 'backup compression default', '1'
GO
RECONFIGURE WITH OVERRIDE
GO

/ * BACKUP SYSTEM DATABASE AND PRODUCTION DATABASE */
Backup Parameters
> SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
Backup Check
> with stored procedure

/* SYSTEM DATABASE */
BACKUP DATABASE [master] TO  DISK = N'W:\TSMFileBackup\master.BAK' WITH NOFORMAT, INIT,  NAME = N'master-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO

BACKUP DATABASE [model] TO  DISK = N'W:\TSMFileBackup\model.BAK' WITH NOFORMAT, INIT,  NAME = N'model-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO

BACKUP DATABASE [msdb] TO  DISK = N'W:\TSMFileBackup\msdb.BAK' WITH NOFORMAT, INIT,  NAME = N'msdb-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO

/* PRODUCTION DATABASE */
BACKUP DATABASE [CUSTOMER_PROD] TO  DISK = N'W:\TSMFileBackup\CUSTOMER_PROD.BAK' WITH NOFORMAT, INIT,  NAME = N'CUSTOMER_PROD-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION,  STATS = 10
GO

/* Check Backup Sets*/
/* SYSTEM */

/* Master */
Declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'master'
and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'master' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''master'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM DISK = N'W:\TSMFileBackup\master.BAK' WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND
GO

/* PRODUCTION DB */
/* CUSTOMER_PROD */
Declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'CUSTOMER_PROD'
and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'CUSTOMER_PROD' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''CUSTOMER_PROD'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM DISK = N'W:\TSMFileBackup\CUSTOMER_PROD.BAK' WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND
GO

Categoria: Dynamics NAV 2013
domenica, 12 mag 2013 Ore. 22.19

Messaggi collegati


Statistiche
  • Views Home Page: 469.456
  • Views Posts: 886.402
  • Views Gallerie: 0
  • n° Posts: 343
  • n° Commenti: 0
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003