Home Forums SQL Server 2008 SQL Server 2008 - General Determine if a database is read-only when the log is not marked as read-only so DBCC SHRINKFILE may be skipped? RE: Determine if a database is read-only when the log is not marked as read-only so DBCC SHRINKFILE may be skipped?

  • Doug

    Are you saying you clear out the log before you do the restore, or after? There's no point in doing so before, since the restore operation will plonk an exact copy of your "true prod" database in place of whatever you have there already (assuming you restore the database with the same name as the existing one). Do you use this server for anything else? If not, there's not much point in shrinking the log afterwards, either, since it's not going to grow if you're only using it to query. If you do go ahead and shrink the database, I would recommend you do so immediately after the restore, and then you don't need to do the read-only check.

    John

    Edit - slightly revised my advice having re-read your original post