SQL Server backup Acceleration

Source: Internet
Author: User
Tags management studio

For large databases, backup takes a lot of time and resources. What if I can make the backup run faster?

 

You can use the following parameters:

1. Back up the database to multiple files (multiple disks)

2. Enable the compression function (2008, after R2)

3. Use the maxtransfersize and buffercount Parameters

4. Adjust the backup side rate and back up data using files and file groups

 

Buffercount :Specifies the total number of I/O buffers used for backup operations. You can specify any positive integer. However, a large number of buffers may cause a "memory insufficiency" error due to insufficient virtual address space in the sqlservr.exe process.

The total space used by the buffer zone is determined by the following formula:Buffercount*Maxtransfersize.

Maxtransfersize :Specifies the maximum transmission unit (in bytes) to be used between the SQL server and the backup media ). The possible value is a multiple of 65536 bytes (64 KB), up to 4194304 bytes (4 MB ).

Backing up a database to multiple files and multiple disks has the following advantages:

 

1. Back up to multiple disks to make full use of disk Io and reduce backup time

 

2. In addition, if a single disk has insufficient space, backing up multiple files can reduce the size of the backup file to solve the disk space problem. In addition, it is convenient to move to other places through the network.

 

3. SQL server can use multiple backup threads to back up multiple files to provide efficiency.

 

We can back up to multiple files using management studio or T-SQL:

 

 

T-SQL:

Backup database [adventureworks] to disk = n' D: \ MSSQL \ mssql10.sql2k8 \ MSSQL \ backup \ adventureworks. Bak ',

Disk =
N'e: \ MSSQL \ mssql10.sql2k8 \ MSSQL \ backup \ advantureworks1.bak ',

Disk =
N'f: \ MSSQL \ mssql10.sql2k8 \ MSSQL \ backup \ adventureworks2.bak 'withnoformat, noinit,

Name = n' adventureworks-full database backup ', Skip, norewind, nounload, stats =
10

Go

 

Restoration is also simple:

Restore database [adventureworks] From

Disk =
N'd: \ MSSQL \ mssql10.sql2k8 \ MSSQL \ backup \ adventureworks. Bak ',

Disk =
N'e: \ MSSQL \ mssql10.sql2k8 \ MSSQL \ backup \ advantureworks1.bak ',

Disk =
N'f: \ MSSQL \ mssql10.sql2k8 \ MSSQL \ backup \ adventureworks2.bak 'withreplace

 

Note that the checksum option will increase the backup time while ensuring the backup quality. It would be terrible if the backup cannot be used during the last restoration.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.