Home > Net >  Database error 823 seriously, online search a lot of methods are not completely solve, hope brothers
Database error 823 seriously, online search a lot of methods are not completely solve, hope brothers

Time:11-06

Recent website change to the cloud server, after each operation for a period of time, it is possible that a few hours, may be a day or two, would be a BBS posts list cannot be displayed, list the following error System. The Data. SqlClient. SqlException: warning: serious mistakes after 2020 and 823 occurred in 08 27 PM into the server open event viewer "application", inside there will be a lot of error message: error: 823, severity: 24, state: 2
I/O error (bad page ID) detected during the read at offset 0 x0000007f0c4000 in the file 'D: \ SJK \ aaaaa_Data MDF'.

Search on the Internet a lot of methods, finally use the SQL statements below solution:

USE the MASTER
GO
Sp_dboption 'database name', 'single user', 'true'
Go
DBCC CHECKDB (' database name 'REPAIR_ALLOW_DATA_LOSS)
Go
USE 'database name'
Go
The exec sp_msforeachtable 'DBCC CHECKTABLE (''? , ' 'REPAIR_REBUILD)'
Go
Sp_dboption 'database name', 'single user', 'false'
Go

But after a few hours or a few days, the error will appear again, finally I found that as long as the database is shut, open again, can fix this error, but repaired, still can appear, this problem is really very big, want to know the brothers to help solve, thank you!

CodePudding user response:

With a professional commercial database system, even if is a professional embedded database (but embedded library must not abuse multiple user library), don't use those as early as 15 years ago was eliminated by Microsoft office such as "database", who are mainly used in Microsoft's local, single machine in the program, do not use in other places, if you find that basically mapping disk path through the network access will cause the file is damaged, or interview with multiple processes usually frequently because of the outage of a process file is damaged, so in fact this is a "common", its starting point, is like paddy field of shrimp is put into the sea, more than the program design ability,

CodePudding user response:

Your so-called "repair database", this kind of practice is to throw in the file data links to content and rewrite the file already, this is not acceptable in normal development, only 15, 20 years ago in some personal software will do this,
  • Related