Home Database Mysql Tutorial SQL SERVER定时备份数据库两种方法

SQL SERVER定时备份数据库两种方法

Jun 07, 2016 pm 05:49 PM
Regular backup database

今天我们来总结两种关于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

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

Hot Article

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How does Go language implement the addition, deletion, modification and query operations of the database? How does Go language implement the addition, deletion, modification and query operations of the database? Mar 27, 2024 pm 09:39 PM

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 Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

Detailed tutorial on establishing a database connection using MySQLi in PHP

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

How does Hibernate implement polymorphic mapping?

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

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

Comparison of similarities and differences between MySQL and PL/SQL Comparison of similarities and differences between MySQL and PL/SQL Mar 16, 2024 am 11:15 AM

Comparison of similarities and differences between MySQL and PL/SQL

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

An in-depth analysis of how HTML reads the database

Analysis of the basic principles of MySQL database management system Analysis of the basic principles of MySQL database management system Mar 25, 2024 pm 12:42 PM

Analysis of the basic principles of MySQL database management system

How does Go WebSocket integrate with databases? How does Go WebSocket integrate with databases? Jun 05, 2024 pm 03:18 PM

How does Go WebSocket integrate with databases?

See all articles