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)
 alter database remove file

Author  Topic 

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-05-15 : 11:44:51
Let's say you...

ALTER DATABASE Test1
ADD LOG FILE
( NAME = test1log2,
FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\test2log.ldf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 5MB)
GO

 
And then later you want to remove the log file you added.

In order to alter database remove file, the file must be emptied....dbcc shrinkfile(test1log2,emptyfile)...But a log file can only be shrunk to the virtual log file boundary.

I've seen scripts that do dummy transactions to wrap the virtual log boundray around to the front so that the file can be shrunk ... but how do you do this in a multi-log file situation?

Jay White
{0}

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-05-15 : 12:36:29
Nevermind, I think I've figured it out ... I simply need to do dummy transactions until the active virtual log pointer is in the primary ...

Jay White
{0}
Go to Top of Page
   

- Advertisement -