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

推荐订阅源

雷峰网
雷峰网
宝玉的分享
宝玉的分享
I
InfoQ
P
Privacy International News Feed
V
V2EX
IT之家
IT之家
S
SegmentFault 最新的问题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V2EX - 技术
V2EX - 技术
C
CERT Recently Published Vulnerability Notes
C
Check Point Blog
The Register - Security
The Register - Security
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
AWS News Blog
AWS News Blog
M
MIT News - Artificial intelligence
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
B
Blog
N
Netflix TechBlog - Medium
B
Blog RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
T
Threatpost
Forbes - Security
Forbes - Security
U
Unit 42
A
Arctic Wolf
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recorded Future
Recorded Future
L
Lohrmann on Cybersecurity
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
月光博客
月光博客
Spread Privacy
Spread Privacy
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
I
Intezer
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
The Hacker News
The Hacker News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
MyScale Blog
MyScale Blog
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
量子位

博客园 - 天龙

ASP.NET 中关于 Async 和 Await 的概述 WIN2003的IIS6调试ASP出现HTTP 500 - 内部服务器错误 SEO 工具集合 去除网页FLASH"单击并激活此控件"解决办法 - 天龙 - 博客园 Web Service测试工具小汇 [转]用一个JS代码实现页面刷新后保持页面滚动条的位置 - 天龙 - 博客园 删除SQL 日志 纯HTML也能访问数据库 - 天龙 - 博客园 关于net2.0里面新出现的类backgroundworker的应用 使用CHARINDEX函数提高查询速度 如果为网站生成自签名SSL证书 利用html设计滚动的文字 - 天龙 - 博客园 使IIS支持HTTPS/SSL A scrollable panel retaining its scroll position across postbacks. - 天龙 google搜索参数 SQL2分查找法通用分页存储过程算法 五种提高SQL Server性能的方法 解析Atlas—微软的Ajax工具包 在ASP.NET 2.0工程中加入Atlas
SQL远程备份 - 天龙 - 博客园
天龙 · 2007-09-15 · via 博客园 - 天龙

--备份环境:把数据库服务器(192.168.1.8)的数据库(TEST)备份到(192.168.1.145)的C$下

--首先,做一个与客户端的映射
exec master..xp_cmdshell
'net use z: \\192.168.1.145\c$ "密码" /user:192.168.1.145\administrator'
/*--说明:
z:是映射网络路径对应本机的盘符,与下面的备份对应
\\192.168.1.145\c$是要映射的网络路径
192.168.1.145\administrator
192.168.1.145是远程的计算机名,administrator是登陆的用户名
密码                        上面指定的administrator用户的密码
--*/

--其次,进行数据库备份
backup database TEST to disk='z:\Test.bak'

--最后.备份完成后删除映射
exec master..xp_cmdshell 'net use z: /delete'

将以上放到sqlserver的job  就可以达到自动备份效果了

进一步可以把备份名字自动生成


exec master..xp_cmdshell
'net use z: \\10.1.1.197\d$\dbback "123456" /user:10.1.1.197\administrator'

declare @a char(80)
select @a ='z:\' + replace(replace(convert(varchar(19),getDate(),120),' ','-'),':','-') + '-service_korea.bak'


backup database pubs to disk= @a

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