编写脚本自动备份SQL数据库
<P>问题:<BR>SQL 2008 Express版本不能自动备份怎么办?</P><P>解决方案:<BR>通过Windows的计划去实现SQL的备份,做成Backup.BAT文件被调用即可。代码如下:</P><P>echo ------------------------------ >>C:\backup.log</P><P>echo Backup Start at %date% %time% >>C:\backup.log</P><P>reg add "HKEY_CURRENT_USER\Control Panel\International" /v sShortDate /t REG_SZ /d yyyyMMdd /f>nul</P><P>NET USE Z: /DELETE /Y</P><P>NET USE Z: <A target=_blank href="file://\\192.168.0.237\ACCPAC_bak">\\192.168.0.237\ACCPAC_bak</A> /PERSISTENT:YES</P><P>net stop "SQL Server (SQLEXPRESS)" >>C:\backup.log</P><P>md "Z:\%date%" >>C:\backup.log</P><P>xcopy C:\ACCPAC_SQL_DATA "Z:\%date%" /e /y /r >>C:\backup.log</P><P>net start "SQL Server (SQLEXPRESS)" >>C:\backup.log</P><P>echo Backup End at %date% %time% >>C:\backup.log</P><P>echo ------------------------------ >>C:\backup.log</P><P>del Z:\backup.log /f</P><P>copy C:\backup.log Z:\backup.log<BR></P> 非常高兴遇到这么好的帖子 谢谢[img]http://www.discuz.net/static/image/common/sigline.gif[/img]
[size=2][url=http://zhuishu.com/Shu/Book/24/24305/]萌娘三国演义[/url]http://zhuishu.com/Shu/Book/24/24305/[/size] 好多啊,哈哈,谢谢您
[img]http://www.discuz.net/static/image/common/sigline.gif[/img]
[size=2]
[url=http://www.xifan5.com]淘宝网购物[/url] [url=http://www.xifan5.com]时尚女装[/url] [url=http://www.xifan5.com]韩版女装[/url] [url=http://www.ttzhan.com]网络营销[/url] [url=http://wenda.baidf.com]肿瘤知识[/url] [url=http://www.admin81.com]站长工具[/url] [url=http://bbs.ttzhan.com]站长论坛[/url] [url=http://www.ladyzh.com]男人装[/url] [url=http://www.ladyzh.com]女人装[/url] [/size]
页:
[1]