Shrink the marketing database:/***---- Shrink - Marketing-----***/use MarketingcheckpointDBCC SHRINKDATABASE (N'Marketing', 10)
Detach of the marketing database:This code in a batch file calls Detach_Marketing.sql >> %StepLog% ECHO (%DATE% %TIME%) osql -U sa -P %Pword% -e -p -n -i %Scriptdir%\Detach_Marketing.sql -o %Logdir%\Detach_Marketing_Prod.log -S %Mktsrv%
which then executesALTER DATABASE Marketing SET single_user WITH ROLLBACK IMMEDIATEGOEXEC sp_detach_db 'Marketing', 'true'GO
I then copy from one server to anothercopy /Y \\%Mktsrv%\d\Marketing_Data.mdf \\%Arcsrv%\eAll this works and it is the same copy command for the ldf.copy /Y \\%Mktsrv%\f\Marketing_log.ldf \\%Arcsrv%\eAll my logs are kept in a different array than my database files. Both have the same permission.This hangs on the ldf with a Error Encountered: BackupDatabases.batScratching my head!!