<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sybase数据库技术，数据库恢复专家 &#187; sp_indsuspect</title>
	<atom:link href="http://www.dbainfo.net/tag/sp_indsuspect/feed" rel="self" type="application/rss+xml" />
	<link>https://www.dbainfo.net</link>
	<description>提供Sybase ASE及Sybase SQL Anywhere数据库修复服务，电话：13811580958(微信)，QQ：289965371！We have many years of experience in recovering data from damanged Sybase devices. Contact us by Phone: +86 13811580958 Wechat: 13811580958 Email: 289965371@qq.com</description>
	<lastBuildDate>Sat, 14 Jun 2025 16:28:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>查找并修复损坏的索引</title>
		<link>https://www.dbainfo.net/find_suspect_index.htm</link>
		<comments>https://www.dbainfo.net/find_suspect_index.htm#comments</comments>
		<pubDate>Tue, 24 Jun 2014 07:12:37 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[sp_indsuspect]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=2493</guid>
		<description><![CDATA[ASE将索引标记为&#8220;可疑&#8221;时，或者ASE的排序顺修改后，索引状态会设置：-32768， patrol指标SuspectIndex会监控数据库中可疑索引的个数。 &#160; 查找出现索引索引损坏的表： 存储过程：sp_indsuspect [table_name] &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 如果不加表名，就是查找当前数据库中因排序顺序更改需被重建的索引的所有表； 或： select u.name as user_name, o.name as table_name, i.name as index_name,i.status from&#160; sysobjects o,&#160; sysindexes i,&#160; sysusers u where&#160;&#160; o.id = i.id&#160;&#160; and o.uid = u.uid &#160; --and o.id = object_id(&#39;table_name&#39;) &#160; and (i.status &#38; -32768) != 0 例子： 1&#62; sp_indsuspect 2&#62; go Suspect indexes in database [...]]]></description>
			<content:encoded><![CDATA[<p>ASE将索引标记为&ldquo;可疑&rdquo;时，或者ASE的排序顺修改后，索引状态会设置：-32768，</p>
<p>patrol指标SuspectIndex会监控数据库中可疑索引的个数。</p>
<p>&nbsp;</p>
<p><strong>查找出现索引索引损坏的表：<br />
	</strong></p>
<p>存储过程：sp_indsuspect [table_name]</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果不加表名，就是查找当前数据库中因排序顺序更改需被重建的索引的所有表；</p>
<p>或：</p>
<p>select u.name as user_name, o.name as table_name, i.name as index_name,i.status<br />
	from&nbsp; sysobjects o,&nbsp; sysindexes i,&nbsp; sysusers u<br />
	where&nbsp;&nbsp; o.id = i.id&nbsp;&nbsp; and o.uid = u.uid<br />
	&nbsp; --and o.id = object_id(&#39;table_name&#39;)<br />
	&nbsp; and (i.status &amp; -32768) != 0</p>
<p><strong>例子：<br />
	</strong></p>
<p>1&gt; sp_indsuspect<br />
	2&gt; go<br />
	Suspect indexes in database dbainfo:<br />
	&nbsp;Own.Tab.Ind (Obj_ID, Ind_ID)<br />
	&nbsp;----------------------------------------------<br />
	&nbsp;dbo.sysqueryplans.csysqueryplans (27, 2)<br />
	&nbsp;dbo.sysqueryplans.ncsysqueryplans (27, 3)</p>
<p>&nbsp;</p>
<p><strong>修复索引：</strong></p>
<p>建议使用dbcc reindex ({table_name | table_id})</p>
<p>当dbcc reindex发现损坏的索引时，它会删除并重新创建相应的索引。dbcc reindex不会重建系统表的索引。</p>
<p>生成重建用户表索引命令的SQL语句：</p>
<p>select distinct &#39;dbcc reindex(&#39;&#39;&#39;|| u.name || &#39;.&#39; ||&nbsp; o.name&nbsp; || &#39;&#39;&#39;)&#39;<br />
	from&nbsp; sysobjects o,&nbsp; sysindexes i,&nbsp; sysusers u<br />
	where&nbsp;&nbsp; o.id = i.id&nbsp;&nbsp; and o.uid = u.uid<br />
	&nbsp; --and o.id = object_id(&#39;table_name&#39;)<br />
	&nbsp; and (i.status &amp; -32768) != 0</p>
<p>&nbsp;</p>
<p><strong>索引重建时间：<br />
	</strong></p>
<p>系统表sysindexes中有字段crdate记录索引的创建时间。使用dbcc reindex重建索引后，可以通过查询sysindexes.crdate来确认索引的创建时间。</p>
<p>select object_name(id),indid,name,crdate from sysindexes</p>
<p>&nbsp;</p>
<p><strong>另外修复索引的方法：<br />
	</strong></p>
<p>1、保存索引的创建语法，手动删除索引后再创建索引；</p>
<p>2、reorg rebuild table_name index_name<br />
	&nbsp;</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/find_suspect_index.htm">https://www.dbainfo.net/find_suspect_index.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/find_suspect_index.htm">查找并修复损坏的索引</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2010-04-07 -- <a href="https://www.dbainfo.net/sybase-table-add-drop-column-physical-storage-processing.htm" title="sybase中给表增加和删除字段时内部处理过程分析">sybase中给表增加和删除字段时内部处理过程分析</a> (0)</li><li>2010-12-20 -- <a href="https://www.dbainfo.net/ase-character-set-support-simplified-chinese.htm" title="Sybae ASE中支持简体中文的字符集">Sybae ASE中支持简体中文的字符集</a> (2)</li><li>2009-12-14 -- <a href="https://www.dbainfo.net/an-uncommon-way-to-start-ase.htm" title="ASE15.0.3升级时导致数据库不能启动问题的解决方法">ASE15.0.3升级时导致数据库不能启动问题的解决方法</a> (0)</li><li>2010-09-15 -- <a href="https://www.dbainfo.net/sybase-ase-auto-delete-all-user-tables.htm" title="Sybase ASE自动删除数据库内的所有用户表">Sybase ASE自动删除数据库内的所有用户表</a> (0)</li><li>2009-12-10 -- <a href="https://www.dbainfo.net/sybase-ase15-shutdown-suspended.htm" title="遇到Sybase ASE15 shutdown无法进行的问题">遇到Sybase ASE15 shutdown无法进行的问题</a> (0)</li><li>2015-08-02 -- <a href="https://www.dbainfo.net/sap-ase-manual-chinese-html-format.htm" title="HTML格式的SAP ASE 15.7 ESD#2中文版官方手册内容列表">HTML格式的SAP ASE 15.7 ESD#2中文版官方手册内容列表</a> (0)</li><li>2013-04-02 -- <a href="https://www.dbainfo.net/ase-lob-text-image-usage.htm" title="ASE中对于大文本字段的使用方法">ASE中对于大文本字段的使用方法</a> (0)</li><li>2015-03-08 -- <a href="https://www.dbainfo.net/sap-asa-cr-number-6.htm" title="SAP SQL Anywhere的所有已知BUG列表（6）">SAP SQL Anywhere的所有已知BUG列表（6）</a> (0)</li><li>2010-02-05 -- <a href="https://www.dbainfo.net/start-ase-engine-by-isql-command.htm" title="通过ASE本身的命令重新启动ASE[转]">通过ASE本身的命令重新启动ASE[转]</a> (0)</li><li>2010-06-13 -- <a href="https://www.dbainfo.net/mount-an-iso-image-file-at-aix-solaris-platform.htm" title="aix与solaris中mount一个iso文件的方法">aix与solaris中mount一个iso文件的方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/find_suspect_index.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
