Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

Shrinkfile emptyfile fails

$
0
0

I am benchmarking a new production server for our database.  Our existing server has a single datafile on a SAN.  We are looking to move these to Intel 910 SSD, which provide 4x 200GB volumes.

So I am trying to create new data files, and then move the data as equally as possible to the 4 new files.

ALTER DATABASE [SQLDB] ADD FILE (
   NAME = 'SQLDB_Data1',
   FILENAME = 'H:\Microsoft SQL Server\TEST\MSSQL11.TEST\MSSQL\DATA\SQLDB_Data01.ndf' ,
   SIZE = 75GB ,
   FILEGROWTH = 125GB
);
GO
ALTER DATABASE [SQLDB] ADD FILE (
   NAME = 'SQLDB_Data2',
   FILENAME = 'I:\Microsoft SQL Server\TEST\MSSQL11.TEST\MSSQL\DATA\SQLDB_Data02.ndf' ,
   SIZE = 75GB ,
   FILEGROWTH = 125GB
);
GO
ALTER DATABASE [SQLDB] ADD FILE (
   NAME = 'SQLDB_Data3',
   FILENAME = 'J:\Microsoft SQL Server\TEST\MSSQL11.TEST\MSSQL\DATA\SQLDB_Data03.ndf' ,
   SIZE = 75GB ,
   FILEGROWTH = 125GB
);
GO
ALTER DATABASE [SQLDB] ADD FILE (
   NAME = 'SQLDB_Data4',
   FILENAME = 'K:\Microsoft SQL Server\TEST\MSSQL11.TEST\MSSQL\DATA\SQLDB_Data04.ndf' ,
   SIZE = 75GB ,
   FILEGROWTH = 125GB
);
GO

-- EMPTY THE TEMP FILE INTO THE OTHER DB FILES EVENLY
-----------------------------------------------------
USE [SQLDB]
GO
DBCC SHRINKFILE ('SQLDB_Data',EMPTYFILE);
GO

My issue I am getting the following:

DBCC SHRINKFILE: Heap page 1:21523911 could not be moved.
Msg 2555, Level 16, State 1, Line 1
Cannot move all contents of file "TVShop_Data" to other places to complete the emptyfile operation.
The statement has been terminated.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Msg 9002, Level 17, State 0, Line 1
The transaction log for database 'tempdb' is full due to 'NOTHING'.

I have put the database in simple recovery, and have plenty of log space available.  I was even querying DBCC SQLPERF(logspace) during the shrink and the percent used never went over 3%

Ideas?



Viewing all articles
Browse latest Browse all 15264

Trending Articles