1. 设置为只读 [sql] view plain copy USE [master] GO ALTER DATABASE [TESTDB] SET READ_ONLY WITH NO_WAIT GO 2. 取消只读 [sql] view plain copy USE [master] GO ALTER DATABASE [TESTDB] SET READ_WRITE WITH NO_WAIT GO