You are an administrator of a SQL Server 2000 computer. The server contains a database that stores inventory data. Another database administrator has created a number of scheduled jobs to maintain the inventory database. Each weeknight the following jobs occur. <br />- A BULK INSERT job imports data at 10:00 P.M<br />- Indexes are rebuilt at 10:15 P.M<br />- Data integrity checks are performed at 10:30 P.M<br />- A differential backup is performed at 10:45 P.M<br />- A DBCC SHRINKDATABASE job runs at 11:00 P.M. <br />You notice that the final job often fails and returns the following error message: "Server: Msg 3140, Level 16, State 3. Could not adjust the space allocation for file 'inventory_data'."You need to ensure that the final job runs without errors. What should you do?

Correct Answer: Increase the time between the differential backup and the DBCC SHRINKDATABASE job.

The DBCC SHRINKDATABSE cannot be executed until the previous job step, the differential backup, has been completed. We should increase the time between these two job steps, or even better configure the last job step to run only after the differential backup has been completed.

 

Note: The DBCC SHRINKDATABASE statement shrinks data files on a per-file basis but shrinks log files as if all the log files existed in one contiguous log pool. The target size for the data and log files cannot be smaller than the minimum size of a file that was specified when the file was originally created, or the last explicit size set with a file size changing operation such as the ALTER DATABASE statement with the MODIFY FILE option or the DBCC SHRINKFILE statement.