sexta-feira, 29 de novembro de 2013

Script para copiar sholder de producao para teste ( Datasul )


@echo off
rem #***************************************************************************
rem # Arquivo...............: 204sholder/scripts/tst-ems204copia_sholder_prd.bat
rem # Descricao.............: Script para copiar sholder de producao para teste
rem # Criar arquivo Bat para execução do backup
rem #***************************************************************************


set DLC=C:\dlc101c
set OLDPATH=%PATH%
set PATH=%DLC%\bin

REM Exclui Schema Holder de Teste

for %%i in (Z:\ems\204sholder\database\*.db) do (
  echo .
  echo ----------- banco: %%~ni
  echo ----------------------------------
  echo Y | call prodel Z:\ems\204sholder\database\%%~ni
)

REM Realiza backup do Schema Holder de Producao para servidor de Teste

for %%i in (T:\ems\204sholder\database\*.db) do (
  echo .
  echo ----------- banco: %%~ni
  echo ----------------------------------
  call probkup T:\ems\204sholder\database\%%~ni Z:\ems\204sholder\backup\%%~ni-prd.bkp
)

REM Realiza restore do backup do Schema Holder de Producao sobre bancos de Teste

Z:
cd\ems\204sholder\database

for %%i in (Z:\ems\204sholder\database\*.st) do (
  echo .
  echo ----------- banco: %%~ni
  echo ----------------------------------
  echo Y | call prorest Z:\ems\204sholder\database\%%~ni Z:\ems\204sholder\backup\%%~ni-prd.bkp
)


REM Realiza truncate do Schema Holder de Teste

for %%i in (Z:\ems\204sholder\database\*.db) do (
  echo .
  echo ----------- banco: %%~ni
  echo ----------------------------------
  call proutil Z:\ems\204sholder\database\%%~ni -C truncate bi -G 0
)

cls

echo COPIA REALIZADA!

pause.

Nenhum comentário:

Postar um comentário