:: 数据库备份文件放置跟路径
@set backupPath=C:\test\sqlbak
@set cacheDatasFileName=cacheDatas_sqlbak_2011-12-23.bak
@set powerDBFileName=powerDB_sqlbak_2011-12-23.bak
@set bamdbFileName=bamdb_sqlbak_2011-12-23.bak
:: 需要恢复的数据库文件名
:: set backFiles=cacheDatas_sqldb_2011-11-26.bak powerDB_sqldb_2011-11-26.bak
:: for %%a in (%backFiles%) do (
@osql -s localhost -d master -E -Q "restore database cacheDatas from disk = '%backupPath%\%cacheDatasFileName%' WITH REPLACE"
@osql -s localhost -d master -E -Q "restore database powerDB from disk = '%backupPath%\%powerDBFileName%' WITH REPLACE"
@osql -s localhost -d master -E -Q "restore database bamdb from disk = '%backupPath%\%bamdbFileName%' WITH REPLACE"
:: )
@echo 完整数据库备份恢复完成!!!!
pause
@set backupPath=C:\test\sqlbak
@set cacheDatasFileName=cacheDatas_sqlbak_2011-12-23.bak
@set powerDBFileName=powerDB_sqlbak_2011-12-23.bak
@set bamdbFileName=bamdb_sqlbak_2011-12-23.bak
:: 需要恢复的数据库文件名
:: set backFiles=cacheDatas_sqldb_2011-11-26.bak powerDB_sqldb_2011-11-26.bak
:: for %%a in (%backFiles%) do (
@osql -s localhost -d master -E -Q "restore database cacheDatas from disk = '%backupPath%\%cacheDatasFileName%' WITH REPLACE"
@osql -s localhost -d master -E -Q "restore database powerDB from disk = '%backupPath%\%powerDBFileName%' WITH REPLACE"
@osql -s localhost -d master -E -Q "restore database bamdb from disk = '%backupPath%\%bamdbFileName%' WITH REPLACE"
:: )
@echo 完整数据库备份恢复完成!!!!
pause