Q2.3: How do I turn off marked suspect on my database?
Say one of your database is marked suspect as the SQL Server is
coming up. Here are the steps to take to unset the flag.
Remember to fix the problem that caused the database to be marked
suspect after switching the flag.
Pre System 10
- sp_configure "allow updates", 1
- reconfigure with override
- select status - 320 from sysdatabases where dbid = db_id("my_hosed_db") -
save this value.
- begin transaction
- update sysdatabases set status = -32767 where dbid =
db_id("my_hosed_db")
- commit transaction
- you should be able to access the database for it to be cleared
out. If not:
- shutdown
- startserver -f RUN_*
- fix the problem that caused the database to be marked suspect
- begin transaction
- update sysdatabases set status = saved_value where dbid =
db_id("my_hosed_db")
- commit transaction
- sp_configure "allow updates", 0
- reconfigure
System 10
- sp_configure "allow updates", 1
- reconfigure with override
- select status - 320 from sysdatabases where dbid = db_id("my_hosed_db") -
save this value.
- begin transaction
- update sysdatabases set status = -32768 where dbid =
db_id("my_hosed_db")
- commit transaction
- shutdown
- startserver -f RUN_*
- fix the problem that caused the database to be marked suspect
- begin transaction
- update sysdatabases set status = saved_value where dbid =
db_id("my_hosed_db")
- commit transaction
- sp_configure "allow updates", 0
- reconfigure
- shutdown
- startserver -f RUN_*