728x90
Problem(Abstract)
A quick method is needed to identify all indices in a database that have been marked 'bad' by IBM® Informix Dynamic Server™ (IDS) database server.
Resolving the problem
You may use this SQL query to identify all indices that have been marked as "bad" in your IDS instance:
- (SELECT st.tabname, si.idxname, hex(spt.flags) flags
FROM sysindexes si, systables st, sysmaster:sysptnkey spt
WHERE st.tabid = si.tabid AND
st.partnum = spt.partnum AND
sysmaster:bitval(spt.flags, 64) = 1 AND
st.partnum !=0 AND
si.idxname NOT IN (
SELECT sfs.indexname
FROM sysfragments sfs
WHERE sfs.tabid = st.tabid)
GROUP BY 1,2,3
)
UNION ALL
(SELECT st.tabname, sf.indexname idxname , hex(spt.flags) flags
FROM systables st, sysmaster:sysptnkey spt, sysfragments sf
WHERE st.tabid = sf.tabid
AND sf.fragtype = 'I'
AND sf.partn = spt.partnum
AND sysmaster:bitval(spt.flags, 64) = 1
GROUP BY 1,2,3
)
ORDER BY 1
728x90
'Informix > informix reference' 카테고리의 다른 글
High Performance Loader Express and Deluxe mode comparison (0) | 2011.12.07 |
---|---|
Avoiding system generated index and constraint names (0) | 2011.12.01 |
Informix Server: Buffered vs. Unbuffered Logging (0) | 2011.11.20 |
Determining the type of Enterprise Replication (0) | 2011.11.20 |
C-ISAM version and serial number -- Determining what they are for an existing C-ISAM installation. (0) | 2011.11.20 |