Hello I have some confusion on how to manage a large SQL Server database.
Let's say size is 15GB, with 3GB available, in simple recovery mode.
Server is not managed by me, I cannot change the size, not even temporarily, nor detach/reattach backup/restore.
Let's say I can only manage the data and the structure of the database.
If I want to alter a table, to add a column, or delete only certain rows (before a datetime
), or want to NULL a few nvarchar(MAX)
columns to save space, how does this impact?
Often I receive the error "no more log space".
Then I shrink the DB, nothing has changed, and I have less space free…
I don't need the transaction log, so what can I do to perform these operations without incurring in error messages regarding the transaction log size?
Thanks!
Best Answer
Points, in no particular order:
NVARCHAR(MAX)
columns nullable will not necessarily save you much space (off the top of my head it'll be 2 bytes per row, per column).DBCC SHRINKDATABASE
uses a naive algorithm that almost perfectly fragments your indexes) and won't regain you much if any space.