截屏视频帮助

One batch file for many servers

创建时间: 15 1 月 2013 • Updated: 31 1 月 2013 | 4 条评论
此问题已解决。 请查看解决方案。

Hi, Configuring backup for SQL databases and would like to know if it is possible to modify the batch files and put all databases from 2-3 servers into one batch file and run it. Will it get successful?

NBU: 7.0.1

Windows 2008R2

Thanks! 

评论 条评论跳转至最新评论

RamNagalla 的图片

I dont think its possible.

you would need to have the batch file on the same sever where your data base is running.

based on the sever your script parameters also change.

you can use

DATABASE $ALL 

in all the scripts as a common parameter.

but you need to specify the correct parameters for below.

SQLHOST " <hostname> "

BROWSECLIENT " <hostname> "

解决方案
MKT 的图片

That is correct, the batch file is local to each server so if you use the same name:

alldatabase.bch

you use that name in a backup policy for all three servers but the local file needs to have the correct SQLHOST connection string.

Amaan 的图片

If each server has its own batch file with the smae name. they all will have their own server name in the batch file. For example:

i ahve servers: Server1, Server2 and Server3 and when i create batch files on each server sepearatly they will ahve something like:

Database $All

SQLserver - server1 for batch file which is on the server1 \dbext\MSSQL folder

SQLserver - server2 in the batch file which is on the server2 and etc

this shoudl not make any problem. Does anybody have similar configurations?

RamNagalla 的图片

Amaan,

yes, there are many servers, having more than one data base,  you can make them backup with single bch file avaliable locally.

that does not make any problems.

you can safely go ahead and test it.