什么是简单的命令行程序或脚本来备份 SQL 服务器数据库? [英] What is a simple command line program or script to backup SQL server databases?

查看:45
本文介绍了什么是简单的命令行程序或脚本来备份 SQL 服务器数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对在我们的内部服务器上执行数据库备份太松懈了.

I've been too lax with performing DB backups on our internal servers.

是否有一个简单的命令行程序可以用来备份 SQL Server 2005 中的某些数据库?或者有没有简单的VBScript?

Is there a simple command line program that I can use to backup certain databases in SQL Server 2005? Or is there a simple VBScript?

推荐答案

要从命令行备份单个数据库,请使用 osqlsqlcmd.

To backup a single database from the command line, use osql or sqlcmd.

"C:Program FilesMicrosoft SQL Server90ToolsBinnosql.exe" 
    -E -Q "BACKUP DATABASE mydatabase TO DISK='C:	mpdb.bak' WITH FORMAT"

您还需要阅读有关备份的文档和RESTORE一般程序.

You'll also want to read the documentation on BACKUP and RESTORE and general procedures.

这篇关于什么是简单的命令行程序或脚本来备份 SQL 服务器数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆