Vous êtes sur la page 1sur 2

Error 2596 The repair statement was not processed.

The database cannot be in read-


only mode
August 6, 2007
Pinal Dave
SQL
4 Comments
ERROR 2596: The repair statement was not processed. The database cannot be in read-
only mode.

SQL SERVER - Fix: Error 2596 The repair statement was not processed. The database
cannot be in read-only mode anothererror This error is described little confusing.
I have received quite a few email asking why this error happens when the database
is already in read-only mode.

Fix/Solution/Workaround :
Yes, This error happens when the database is in read only mode. To repair the
database using DBCC command it should not be in repair mode. It should be in read-
write mode before it is repaired.

1
2
3
4
5
6
7
8
9
10
11
12
13
USE MASTER;
GO
ALTER DATABASE AdventureWorks
SET SINGLE_USER
WITH
ROLLBACK IMMEDIATE;
GO
ALTER DATABASE AdventureWorks
SET READ_WRITE;
GO
ALTER DATABASE AdventureWorks
SET MULTI_USER;
GO
Make Database Read Only
1
2
3
4
USE [master]
GO
ALTER DATABASE [TESTDB] SET READ_ONLY WITH NO_WAIT
GO
Make Database Read/Write
1
2
3
4
USE [master]
GO
ALTER DATABASE [TESTDB] SET READ_WRITE WITH NO_WAIT
GO
If you face an error that if the database is already in use, you can resolve the
same by making database in single user mode �

Vous aimerez peut-être aussi