SQL Server backup solution

Source: Internet
Author: User
Tags rewind
SQL Server backup solution

In order to reduce data loss caused by database server problems, the database is generally backed up, depending on the importance of data and performance compromise using different backup solutions.
The general backup solution is:
Global backup (once a week) + Incremental Backup (once a day) + transaction log backup (once every two hours, depending on the importance of data)
In this case, even if a problem occurs, the data loss range is two hours.

Global backup:
Declare @ Backpath Nvarchar ( 1000 )
Set @ Backpath = N ' C: \ Program Files \ Microsoft SQL Server \ mssql.4 \ MSSQL \ backup \ testdb \ testdb_backup_200907281015.bak '
Declare @ Backname Nvarchar ( 200 )
Set @ Backname = N ' Testdb_backup_20090728101556 '

Backup Database [Testdb] ToDisk = @ Backpath 
WithNoformat, noinit, name=, Skip, rewind, nounload, stats= 10

Incremental Backup:
Declare @ Backpath Nvarchar ( 1000 )
Set @ Backpath = N ' C: \ Program Files \ Microsoft SQL Server \ mssql.4 \ MSSQL \ backup \ testdb \ testdb_backup_200907281017.bak '
Declare @ Backname Nvarchar ( 200 )
Set @ Backname = N ' Testdb_backup_20090728101729 '

Backup database [ testdb ] to disk = @ backpath
with differential, noformat, noinit, name = @ backname , Skip, rewind, nounload, stats = 10

Truncate logs during Incremental backup to prevent excessive logs.--Transaction Log truncation:

Backup LogNorthwind
WithNo_log

--Shrink log files:

DBCCShrinkdatabase (northwind)

Back up transaction logsBackup LogNorthwindcs
To Disk='G: \ backup \ northwindcs_log_20070908.bak' 
WithNo_truncate

Perform operations on different frequencies.

If there are different databases on the same server, it is obviously inappropriate to perform the above jobs on each data. In this way, you can use the SQL server2005 maintenance plan to maintain all databases.

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.