惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cyberwarzone
Cyberwarzone
V
Vulnerabilities – Threatpost
T
Tenable Blog
Forbes - Security
Forbes - Security
Simon Willison's Weblog
Simon Willison's Weblog
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
S
Securelist
C
Cybersecurity and Infrastructure Security Agency CISA
Project Zero
Project Zero
C
CXSECURITY Database RSS Feed - CXSecurity.com
V
Visual Studio Blog
WordPress大学
WordPress大学
Latest news
Latest news
K
Kaspersky official blog
T
Tailwind CSS Blog
T
Threat Research - Cisco Blogs
B
Blog RSS Feed
C
Cisco Blogs
博客园 - 聂微东
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
小众软件
小众软件
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
S
SegmentFault 最新的问题
Security Latest
Security Latest
Y
Y Combinator Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
P
Privacy & Cybersecurity Law Blog
L
LINUX DO - 最新话题
月光博客
月光博客
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
S
Security Affairs
P
Proofpoint News Feed
D
DataBreaches.Net
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG

博客园 - 大鱼

使用XML文件来动态配置ASP.NET MVC的Route规则 发送HTML表单数据:URL编码的表单数据 MVC核心功能组件和简介 emulator-5554 disconnected! Cancelling '*** activity launch'! 安卓模拟器启动报错 AJAX 调用 WEBSERVICE的例子,包括对XML数据的处理,包含源码下载 类似ipone的滑动开锁功能--拖动后能自动回滚到起始位置--BackgroundWorker 批处理文件BAT安装WINDOWS服务带参数和设置目录 正则表达式30分钟入门教程(第二版) 【转载】 gridview 在列表中对信息进行增删改,通过VIEWSTATE进行缓存,然后一次性将数据提交到服务器端。 Excel VBA 应用 --批量修改选中区域单元格的时间数据,自动为时间值加1月 CELL值=CELL值 + DateAdd(“m”,1,date) - 大鱼 基于Windows下的Web性能测试和压力测试-zhuan team foundation server 安装 图片上传控件 SQL Server 2005 镜像功能实现 - 转 -已验证 如何在VS 2005 SP1中使用VS的web服务器运行一个相对于根目录“/”的网站 xmlhttp-JS-实现用户是否注册无刷新验证 VS项目模板(项模板)制作--针对ASP.NET站点页面使用 安装用于 Team Foundation Server(单服务器部署)的 Microsoft Windows SharePoint Services ---TFS安装问题集 Aspect inside castle 实现 AOP
SQL Server 2005异地备份 - 转-已验证
大鱼 · 2009-03-15 · via 博客园 - 大鱼

本方案采用备份至本地然后copy到文件服务器的方法。

SQL server 2005打了sp2的补丁后好像存储过程xp_cmdshell是不能直接用的

  1. 显示高级选项(仅需执行一次)

EXEC sp_configure 'show advanced options', 1

GO

RECONFIGURE

GO*

  1. 允许执行xp_cmdshell

EXEC sp_configure 'xp_cmdshell', 1

GO

RECONFIGURE

GO

  1. 添加映射驱动器

declare @string nvarchar(200)

set @string = 'net use z: \\192.168.1.2\D$\db_backup "123456" /user:fileserver\administrator'

exec master..xp_cmdshell @string

其中192.168.1.2为文件服务器的地址,db_backup为该服务器的共享文件夹,fileserver为机器名,administrator 123456 分别为共享时设置的用户名密码。

  1. 备份数据库至本地

declare @date datetime

set @date = GetDate()

declare @str nvarchar(100)

set @str = 'd:\mydb'+ convert(nvarchar(12), @date, 112) +'.bak'

backup database mydb to disk=@str with init

With init为覆盖同名文件(本例设计为1天执行一次,不会出现覆盖的情况)。

  1. 拷贝到文件服务器

declare @str1 nvarchar(100)

set @str1 = 'copy '+ @str +' z:'

exec master..xp_cmdshell @str1

  1. 删除映射以及本地备份

exec master..xp_cmdshell 'net use z: /delete'

declare @str2 nvarchar(100)

set @str2 = 'del '+@str+''

exec master..xp_cmdshell @str2

7关闭允许执行cmdshell

EXEC sp_configure 'xp_cmdshell', 0

GO

RECONFIGURE

GO

建立sql server 作业执行步骤2-7,成功备份