Thursday, October 4, 2012

[SYBASE] How to fix a "suspect" database


Damit ich es wiederfinde, habe ich mir mal folgenden Beitrag aus einem Forumpost kopiert. Das Original ist hier zu finden: http://sybase-developer-network.com/conversation/44016/

 From: Bret Halford 
Clearing the suspect database flag is fairly easy, the suspect bit's
value in sysdatabases.status is 256. This code flips the bit off
if it is on:

sp_configure "allow updates", 1
go

-- on very old versions (pre-11.x), "reconfigure with override" would --
be needed here, it is not needed in current versions.
go
update sysdatabases
set
status = status ^ 256 -- exclusive or operator flip the bit
where
status & 256 = 256
[and name = "mydb"]


If you included the "name" clause, you should get 1 row affected.

The next step is to cause the database to go through recovery again
now that it is no longer marked suspect. On all versions, you can
do this by shutting down and then rebooting the whole ASE server.
In 12.5.4 ESD 1 and higher 12.5.x versions, and in 15.0.2 and above
you can use DBCC DBREBOOT to reboot just the one database

dbcc dbreboot("shutdown", )
go
dbcc dbreboot("restart",
)
go


The database should now either recover normally or hit a
problem and get marked suspect again.

If the problem is some sort of corruption in the database, your
options are to try loading an older dump of the database or
(if no such dump exists, for instance) working with tech support.
Generally speaking, though, if some sort of corruption is
preventing recovery from completing, it is unlikely that the
database can be brought to a transactionally consistent state.

3 comments:

  1. Sybase is a computer software company that develops and sells database management system (DBMS) and middleware products.

    ReplyDelete
  2. sybase online training| sybase training| call us+ ...
    http://www.21cssindia.com/courses/sybase-online-training-159.html
    ఈ పేజీని అనువదించు
    sybase training,introduction to sybase,employee training, sybase online training e-learning,sybase tutorial,online course.
    Course contents, biztalk admin enquiry, .Courses at 21st Century Software Solutions
    Talend Online Training -Hyperion Online Training - IBM Unica Online Training -
    Siteminder Online Training - SharePoint Online Training - Informatica Online Training
    SalesForce Online Training - Many more… | Call Us +917386622889
    Visit: http://www.21cssindia.com/courses.html

    ReplyDelete
  3. Sybase Online Training, ONLINE TRAINING – IT SUPPORT – CORPORATE TRAINING http://www.21cssindia.com/courses/sybase-online-training-159.html The 21st Century Software Solutions of India offers one of the Largest conglomerations of Software Training, If you’re serious about a career in IT, 21st Century would like to provide you a guidance don’t hesitate to organize a free demo session. For any further information regarding the courses once go through our website Visit: http://www.21cssindia.com | Call Us +917386622889 - +919000444287 - contact@21cssindia.com

    ReplyDelete