Project

General

Profile

Создание резервной копии медиабазы данных » SQLTractBackup_All.cmd

Oksana Ishutina, 01/11/2022 15:37

 
@CLS
@ECHO OFF

SQLCMD -E -S YOUR_SERVER -Q "ALTER DATABASE [YOUR_DB] SET AUTO_SHRINK ON, RECOVERY SIMPLE;"
SQLCMD -E -S YOUR_SERVER -Q "BACKUP DATABASE [YOUR_DB] TO DISK='Your_disc:\the_path_to_the_file\Сustom_name_%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%.bak' WITH FORMAT, STATS=25, STOP_ON_ERROR;"

MOVE /Y Your_disc:\the_path_to_the_file\Сustom_name_%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%.bak \\FILESERVER\the_path_to_the_file\Сustom_name_%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%.bak
(7-7/7)
Add picture from clipboard (Maximum size: 742 MB)