Archive

Posts Tagged ‘SQLServer’

MS SQL Server Backup File Size Requirement

January 2, 2019 Leave a comment

In SQLServer 2012, using below backup command, I started taking a backup and  it first created a 130G BAK file. I was expecting around 60G file and my disk space was around 150G. Because of that I started monitoring, the only information I have was it will be a compressed file, and the current percentage of completion.  Fortunately, it finished with 60G file when it was 100 percent.

0201

:Setvar DB MYDB
:Setvar date 20190102

BACKUP DATABASE [$(DB)] TO DISK = N’C:\SQLBCK\$(DB)_prod_$(date).bak’ WITH NOFORMAT, INIT, NAME = N’$(DB) prod-Full Database Backup $(date)’, SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
GO

In the support note it says creating a file with an estimated file size is for performance benefit. “This size is calculated directly from the number of allocated extents in the data files that are specified for the backup. ” Not surprisingly, instead of incrementally allocating disk space, it first creates a target estimate size file, and fills it, and releases unused space at the end.

https://support.microsoft.com/en-us/help/2001026/inf-space-requirements-for-backup-devices-in-sql-server

So, for less space environments, is there a way of opting out performance?

The answer is yes. Not to allocate a big target space, you may enable trace flag 3042 for incremental sizing. For details please look into below article. https://www.mssqltips.com/sqlservertip/2531/sql-server-compressed-backups-disk-space-needs/

Lessons learnt from this experience is just be cautious about the disk space in bigger size databases. It will not be greater than the database.

Julian Dontcheff's Database Blog

Distinguished Product Manager - PL/SQL and JSON at Oracle

Bobby Durrett's DBA Blog

Oracle database performance

flashdba

Database Performance in the Cloud

Don Charisma

because anything is possible with Charisma

Carol no Mundo!

Aventuras de uma intercambista a trabalho pelo mundo!

nimaidba

Welcome to the world of Oracle with me....

Tech

News and reviews from the world of gadgets, gear, apps and the web

WordPress.com

WordPress.com is the best place for your personal blog or business site.

Gurcan Orhan's ODI and DWH Blog

Some words about Oracle Data Integrator and Data Warehousing.