[성현모] DBPatch Restore 네트워크 드라이브 설정 추가

This commit is contained in:
SHM
2024-07-26 15:34:56 +09:00
parent b605826c07
commit d9be94cc6b
3 changed files with 35 additions and 1 deletions

View File

@ -14,8 +14,12 @@ SET RestoreDBPath=%6
::SET UserID=Alis
::SET Passwd=Kefico!@34
::SET RestoreDBName=TestDB
::SET RestoreDBPath=D:\MSSQL\Backup\TestDB.bak
::SET RestoreDBPath=Z:\MSSQL\TestDB.bak
::MSSQL 네트워크 드라이브 설정
CALL SetNetworkDrive.bat
::Restore 명령 실행
SET SqlCmdOption=-C -U %UserID% -P %Passwd% -S %ServerIP%,%ServerPort% -f 65001 -o .\logs\%RestoreDBName%_Restore.log
sqlcmd %SqlCmdOption% -Q "RESTORE DATABASE [%RestoreDBName%_Restore] FROM DISK='%RestoreDBPath%' WITH REPLACE, MOVE '%RestoreDBName%' TO 'D:\MSSQL\DATA\%RestoreDBName%_Restore.mdf', MOVE '%RestoreDBName%_log' TO 'D:\MSSQL\DATA\%RestoreDBName%_Restore_log.mdf'"