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 |