Two methods for SQL SERVER regular database backup

Source: Internet
Author: User

Maintenance plan

1. Create a maintenance plan, name it 'DB _ bak', and select the 'backup database' task from the toolbar,

2. Select the database, Expiration Time, and backup directory on the properties page. Here I select a partition on the network storage to improve the disaster tolerance capability. Of course, you can also back up the data in the local directory.

3. After saving, you can view the new 'DB _ Bak in 'job' in 'SQL agent. subpan_1, which is named after your maintenance plan, is easy to find.

4. Right-click the job and select 'Properties' to show the detailed settings. On the left-side menu bar, select Scheduler. Choose "new"> "name"> "run" (daily, weekly, or monthly)> "run time"> "duration".

5. Confirm and confirm.


Method 2 use the command mode

Click "manage" -- "SQL server proxy" -- "job"

Create a job:

On the General tab, enter "name" in "regular backup database", "enable", select "check", and "target local server ",

"Category" select "database service ",

On the "steps" tab, create a step. Step name: Backup database; type: Transact-SQL script (TSQL );

Database: the database to be backed up;

Command:

The code is as follows: Copy code

Declare @ filename varchar (1000)

Set @ filename = 'E: database backup book '+ convert (char (10), getdate (), 112)

Print @ filename

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.