none
DBCC checkdb 的时候提示:无法使用闩锁类型 SH 读取并闩锁页 RRS feed

  • 问题

  • 环境:WIN2003+SQL 2008

    数据库可以正常使用。发现有些作业执行不了,才DBCC。

    DBCC CHECKDB 的时候,提示: 无法使用闩锁类型 SH 读取并闩锁页 (1:6)。23(数据错误(循环冗余检查)。)

    dbcc checkdb(‘库名’,REPAIR_ALLOW_DATA_LOSS) 
    dbcc checkdb(‘库名’,REPAIR_REBUILD) 

    都提示上面的错误。

    希望指点

    谢谢


    2013年3月16日 8:53

全部回复

  • That means there were connections to the db, you have to kill those connections first then run dbcc.

    2013年3月16日 18:28
  • 你执行下面语句的时候需要单用户模式才能执行,如果是单用户模式那么不会存在数据库连接

    dbcc checkdb(‘库名’,REPAIR_ALLOW_DATA_LOSS) 
    dbcc checkdb(‘库名’,REPAIR_REBUILD) 

    如果还有连接那么运行下面这句话的时候说设置单用户模式失败

    除非没有数据库连接,才能成功


    给我写信: QQ我:点击这里给我发消息

    2013年3月17日 4:14

  • 给我写信: QQ我:点击这里给我发消息

    不断执行查询,因为数据库还存在连接

    2013年3月17日 4:15
  • That means there were connections to the db, you have to kill those connections first then run dbcc.

    没有数据库连接啊。我这个是晚上执行报错的。况且,我是DW库,即使有,也只能读,难道读也不行?

    谢谢

    2013年3月17日 8:49
  • It needs exclusive access to repair data.
    2013年3月17日 19:38
  • 执行

    select spid from sys.sysprocesses with (nolock) where dbid=db_id('DBName')

    然后将查询出来的SPid Kill掉.


    If you haven't all the things you want,be grateful for the things you don't have that you didn't want.

    2013年3月19日 0:38
  • 执行

    select spid from sys.sysprocesses with (nolock) where dbid=db_id('DBName')

    然后将查询出来的SPid Kill掉.



    If you haven't all the things you want,be grateful for the things you don't have that you didn't want.

    晚上的作业,怎么KILL?KILL下,不是整个作业都失败了,等于没跑数据。还是说,让作业自动判断失败的话,就KILL 下,再执行作业?

    我昨天把所有数据都清了,跑起来是正常的。


    2013年3月20日 12:47
  • If you want to repair db, have to stop all user processes.
    2013年3月20日 13:10
  • 可以尝试一下DBCC CHECKDB  with TABLOCK 参数。

    2013年3月21日 3:22
  • If you want to repair db, have to stop all user processes.

    其他用户是可以停用的,关键是怎么修复?

    用 

    dbcc checkdb(‘库名’,REPAIR_ALLOW_DATA_LOSS) 
    dbcc checkdb(‘库名’,REPAIR_REBUILD) 

    以前用上面语句修复过,修复完还是不行。

    2013年3月23日 0:28
  • DBCC can't repair all kind of corruptions, that's why need good backups.
    2013年3月23日 19:26
  • What kind of corruption did you get?
    2013年3月23日 19:28
  • What kind of corruption did you get?

    DBCC 执行完,就提示这个。

    无法使用闩锁类型 SH 读取并闩锁页 (1:6)。23(数据错误(循环冗余检查)。)

    2013年3月27日 7:22
  • My question is why you run dbcc with repair option? What was result of 'dbcc checkdb (db_name)'?
    2013年3月27日 13:00