SQL SERVER定时备份数据库两种方法
Jun 07, 2016 pm 05:49 PM今天我们来总结两种关于SQL SERVER定时备份数据库方法,有需要对SQL SERVER定时备份数据的朋友可参考本教程。
维护计划
1,新建维护计划,命名'DB_Bak',并从工具栏选择‘备份数据库’任务,
2,属性页面,选择数据库,过期时间,和备份目录,这里我选择了网络存储器上的一个分区,提高容灾能力,当然你备份在本地目录也可以
3,保存后,就可以在'SQL代理'中的'作业'看到,一项新建的'DB_Bak.subpan_1'的作业了,它是按你的维护计划的名字命名的,所有很容易找到
4,点作业右键'属性'弹开详细设置,选择左侧'计划',新建-名称-执行(每天/每周/每月自选)-执行时间-持续时间
5,确定再确定就完成
方法二利用命令模式
点击 "管理"--"sql server代理"--"作业"
新建作业:
常规选项卡里,"名称"填写"定时备份数据库","启用"前面选"对勾","以本地服务器为目标",
"分类"选择"数据库服务",
步骤选项卡里,新建步骤,步骤名:备份数据库;类型:Transact-SQL脚本(TSQL);
数据库:要备份的数据库;
命令:
代码如下 | 复制代码 |
declare @filename varchar (1000) set @filename='E:数据库备份book'+convert(char(10),getdate(),112) print @filename |

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How does Go language implement the addition, deletion, modification and query operations of the database?

Detailed tutorial on establishing a database connection using MySQLi in PHP

How does Hibernate implement polymorphic mapping?

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos

Comparison of similarities and differences between MySQL and PL/SQL

An in-depth analysis of how HTML reads the database

Analysis of the basic principles of MySQL database management system

How does Go WebSocket integrate with databases?
