Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Transfering Databases

Author  Topic 

Donovan
Starting Member

8 Posts

Posted - 2005-10-24 : 12:04:43
We have a simple shrink/detach/copy/reattach process that gets hung when copying the logs. Copying the mdb goes fine, but when it gets to the ldf it hangs.

There are no pending processes (checkpoint), and permissions appear to be correct.

Any ideas.

X002548
Not Just a Number

15586 Posts

Posted - 2005-10-24 : 12:14:42
Got Code?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

Donovan
Starting Member

8 Posts

Posted - 2005-10-24 : 13:50:31
Shrink the marketing database:

/***---- Shrink - Marketing-----***/
use Marketing
checkpoint
DBCC 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 executes

ALTER DATABASE Marketing SET single_user WITH ROLLBACK IMMEDIATE
GO
EXEC sp_detach_db 'Marketing', 'true'
GO


I then copy from one server to another

copy /Y \\%Mktsrv%\d\Marketing_Data.mdf \\%Arcsrv%\e
All this works and it is the same copy command for the ldf.

copy /Y \\%Mktsrv%\f\Marketing_log.ldf \\%Arcsrv%\e
All 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.bat

Scratching my head!!
Go to Top of Page
   

- Advertisement -