Sql-server – Any tips to watch out for when setting one of the databases to Read Only

sql-server-2008-r2

Our front end application uses\ pointed to a different database now in SQL Server 2008R2 in the same instance, so to prevent users from accidentally updating data in the old production database, is it simply just changing the Database Read Only State to "True"? As ADMIN users may still need to access it in case, to verify migrated data to the new DB matches the Old DB but not be able to modify anything.

Also, is it a good idea to change the recovery model for this old production database to Simple vs Full? and no need to run its Jobs or maintenance plans ?

In worse cases, I always can set it back to Read and Write at anytime with no issues correct? Thanks for any advice.

Best Answer

is it simply just changing the Database Read Only State to "True"?

yes, you can use below t-sql

alter database db_name
set read_only with rollback immediate

Also, is it a good idea to change the recovery model for this old production database to "Simple" vs "Full"?

Yes, a read-only database wont be having any DML operations. So best practice is to change the recovery model to SIMPLE. Make sure that you take regular FULL backups (and most important is testing your restore) - just incase if the server goes down.

In worse cases, I always can set it back to Read and Write at anytime with no issues correct?

Yes, you can just run below tsql

ALTER DATABASE db_name SET READ_WRITE
with rollback immediate
GO