sybase rebuild index

用isql登录数据库,查看一下object_id:1792006384是哪张表,这张表的哪个索引坏了?

通过select object_name(1792006384)查询出来表名为:js_keys

查询表js_keys内数据的时候,报索引损坏的错误:

1> select count(*) from js_keys

2> go

Index id 2 on table id 1792006384 cannot be used in the optimization of a query

as it is SUSPECT. Please have the SA run DBCC REINDEX on the specified table.

 

-----------

5

(1 row affected)

通过上面给出的提示信息,可以看出表js_keys的indid=2的索引坏了。需要重建该表的索引。

使用reindex命令来修复表js_keys的损坏的索引:

dbcc traceon(3604)

go

dbcc reindex(js_keys)

go

反馈信息为:

1> dbcc traceon(3604)

2> go

DBCC execution completed. If DBCC printed error messages, contact a user with

System Administrator (SA) role.

1> dbcc reindex(js_keys)

2> go

Checking table 'js_keys' (object ID 1792006384): Logical page size is 4096

bytes.

 Checking partition 'js_keys_1792006384' (partition ID 1792006384) of table

'js_keys'. The logical page size of this table is 4096 bytes.

 The sortorder and character set ID's for index 2 on this table were 50:1 in

sysindexes. They have been corrected to 101:190.

The indexes for 'js_keys' are already correct. They will not be rebuilt.

DBCC execution completed. If DBCC printed error messages, contact a user with

System Administrator (SA) role.

用checktable命令检查一下表js_keys

1> dbcc checktable(js_keys)

2> go

Checking table 'js_keys' (object ID 1792006384): Logical page size is 4096

bytes.

 Checking partition 'js_keys_1792006384' (partition ID 1792006384) of table

'js_keys'. The logical page size of this table is 4096 bytes.

The total number of data pages in partition 'js_keys_1792006384' (partition ID

1792006384) is 1.

Partition 'js_keys_1792006384' (partition ID 1792006384) has 5 data rows.

The total number of empty pages (with all deleted rows) in partition

'js_keys_1792006384' (partition ID 1792006384) is 0.

The total number of pages in partition 'js_keys_1792006384' (partition ID

1792006384) which could be garbage collected to free up some space is 0.

The total number of deleted rows in partition 'js_keys_1792006384' (partition ID

1792006384) is 0.

The total number of pages in partition 'js_keys_1792006384' (partition ID

1792006384) with more than 50 percent garbage is 0.

The total number of pages in partition 'js_keys_1792006384' (partition ID

1792006384) with more than 50 percent insert free space is 1.

 

The total number of data pages in this table is 1.

The total number of pages with more than 50 percent insert free space is 1.

Table has 5 data rows.

DBCC execution completed. If DBCC printed error messages, contact a user with

System Administrator (SA) role.

1>

至此,表js_keys索引已修复完成,一致性检查没有问题了。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21416913/viewspace-743318/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/21416913/viewspace-743318/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值