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.
Author |
Topic |
lraghunahth
Starting Member
1 Post |
Posted - 2010-02-23 : 03:14:54
|
Hi,My Objective is to delete a DB File from SQL Server 2000.Database Name : ABCTotal No of DB Files : 8File to be deleted : ABCDATA2.ndfI used the DBCC SHRINKFILE command EMPTYFILE option to empty the contents.It appeared that the operation successfully completed. I could confirm the message. After that when I executed the alter database command to remove the above said DB file, it is throwing the following error and the command fails :The file 'ABCDATA2' cannot be removed because it is not emptyWhen I checked for the usage of the above said DB File, it is showing as 1.8MBBefore I shrinked the above file, the usage was around 88 GB. From this I could understand that almost all the contents have been moved to the rest of the DB files.I had used the following commands:use ABCDBCC TRACEON(8901)DBCC SHRINKFILE('ABCDATA2',EMPTYFILE)ALTER DATABASE ABC REMOVE FILE ABCDATA2DBCC TRACEOFF(8901)(Error Message)The file 'ABCDATA2' cannot be removed because it is not emptyWould like to know if you had faced the similiar issue and the solution you had applied it to rectify it.Best RegardsRaghunahth LGeneral System InformationRAM 4GBCPU Xeon 2.7GhzSQLServer Version : SQLServer2000 3a hotfix 8.00.919OS WindowsServer2003 32Bit (No SP)FileID FileGroup Total Extents Used Extents Name FileName1 1 1792000 1688781 ABCDATA1 E:\ABCDATA1\ABCDATA1.mdf3 1 1835739 30 ABCDATA2 O:\ABCDATA2\ABCDATA2.ndf4 1 1920000 1776416 ABCDATA3 P:\ABCDATA3\ABCDATA3.ndf6 1 1920000 1713409 ABCDATA4 W:\ABCDATA4\ABCDATA4_Data.NDF7 1 1968000 1714709 ABCDATA5 B:\ABCDATA5\ABCDATA5.ndf8 1 1968000 1714960 ABCDATA6 G:\ABCDATA6\ABCDATA6.ndf9 1 1376000 1260704 ABCDATA7 H:\ABCDATA7\ABCDATA7.ndf10 1 1360000 1250530 ABCDATA8 K:\ABCDATA8\ABCDATA8.ndfInfo : I had even restarted the DB and rerun the Shrink command. But no effect. |
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2010-02-23 : 14:02:14
|
Do you have any tables created on that file group or indexes?Select s.groupname,i.id,object_name(i.id)From sysfilegroups sINNER JOIN sysindexes iON i.groupid = s.groupidORDER BY object_name(i.id)Mike"oh, that monkey is going to pay" |
|
|
|
|
|