i keep getting a message stating that the disk is fulkl so i have been tryin
g
to shrink the database to start with using the following code
USE [BossData]
GO
DBCC SHRINKDATABASE(N'BossData', 50 )
GO
All i get is the following error
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should
be discarded.
Has any one any suggestions please ?Check whether executing BACKUP LOG... can resolve the problem.
** Solution 1
- change the location of the backup device to a HDD with enough HDD space
- do a full backup on the database
- shrink the database using "dbcc shrinkdatabase (dbname)"
- change the location of the backup device to a HDD to the original
directory (with enough HDD space)
** Solution 2 (when there is not enough HDD space, and you cannot add a new
HDD)
** warning ** (from BOL) TRUNCATE_ONLY removes the inactive part of the log
without making a backup copy of it and truncates the lob. This option frees
space. Specifying a backup device is unnecessary because the log backup is
not saved. The changes recorded in the log are not recoverable. For recovery
purpose, immediately execute BACKUP DATABASE.
*** It would be better if you have a valid backup anyways.
- backup log dbname with truncate_only
- dbcc shrinkdatabase (dbname)
Both backup (full/log) and "dbcc shrinkdatabase" can be done with the
database online (and without detaching the database).
There is also a database option 'autoshrink' that could be used for
shrinking a database periodically and automcatically by SQL Server. By
default, the 'autoshrink' option is set to OFF in SS2000 (except SS2000
Personal Edition). You will need to implement an appropriate backup
strategy, anyways.
-- To set the autoshrink database option. (When true, the database files are
candidates for automatic periodic shrinking.)
sp_dboption 'dbname', 'autoshrink', 'TRUE/FALSE'
References
- Shrinking the transaction log
http://msdn.microsoft.com/library/d...r />
_1uzr.asp
- Truncating the transaction log
http://msdn.microsoft.com/library/d...r />
_7vaf.asp
Martin C K Poon
Senior Analyst Programmer
====================================
"Peter Newman" <PeterNewman@.discussions.microsoft.com> bl
news:1B25C6DC-84D9-4E8B-B62B-DC4A4689CD00@.microsoft.com g...
> i keep getting a message stating that the disk is fulkl so i have been
trying
> to shrink the database to start with using the following code
> USE [BossData]
> GO
> DBCC SHRINKDATABASE(N'BossData', 50 )
> GO
> All i get is the following error
> Msg 0, Level 11, State 0, Line 0
> A severe error occurred on the current command. The results, if any,
should
> be discarded.
> Has any one any suggestions please ?
>
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment