Today we will summarize two methods for backing up SQL Server databases on a regular basis. If you need to back up SQL server data on a regular basis, refer to this tutorial.
Today we will summarize two methods for SQL server timed backup of the database. If you need to regularly back up data on SQL SERVER, please refer to this tutorial.
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: |
|
Declare @ filename varchar (1000) Set @ filename = 'e: Database Backup book '+ convert (char (10), getdate (), 112) Print @ filename |