When we issue a DBCC SHRINKFILE with empty option, the data file
is removed and the space is alloted back to the OS.
Same way when we issue a an ALTER DATABASE to remove a database,
all the data files and transaction log files are dropped.
But can these files be recovered again by using any of the disk
recovery tools?
AchillesDBCC SHRINKFILE doesn't remove a data file it just removes unused space in a
file. ALTER DATABASE doesn't remove databases, although it can be used to
remove files (but only when they are empty of data). Since neither of these
statements actually removes any data from your database there isn't really
anything to recover. I doubt it would be feasible to restore a database to a
prior state using disk recovery tools and I definitely wouldn't recommend
you try as the likely result would be a corrupt database.
If you think you have lost some data for some reason then restoring from a
backup is your best course of action. But as I said, neither of the
statements you have mentioned should cause you to lose data even if you use
them in error.
Hope this helps.
--
David Portas
SQL Server MVP
--
No comments:
Post a Comment