13 February,2013 by Jack Vamvas
If there’s a requirement to not change data on a SQL Server database , a DBA may make a database read only (READ_ONLY). There are some benefits to making a database read only outlined below.
Some notes on READ_ONLY
1) A small performance gain is possible due to no locking , which leads to no blocking. Read more on SQL Server - How to detect and troubleshoot blocking and deadlocks
2) No schema changes or data changes are possible for the duration of the database read only status
3) Consider running optimization processes , such as full UPDATE STATISTICS and eliminate logical fragmentation before changing the status to read only . Check SQL Server Update Statistics with FULL SCAN - SQL Server DBA
--to check the current status SELECT name, is_read_only FROM sys.databases WHERE name = 'database_name' --to make a SQL Server database read only ALTER DATABASE database_name SET READ_ONLY --to make a SQL Server database read-write ALTER DATABASE database_name SET READ_WRITE
SQL Database Status with sys.databases - SQL Server DBA
SQL Server – read only database status - SQL Server DBA
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |