1. ANALYZE TABLE OWNER.TABLE_NAME COMPUTE STATISTICS;
2. SELECT NUM_ROWS,CHAIN_CNT FROM DBA_TABLES WHERE TABLE_NAME=’TABLE_NAME’;
CHAIN_CNT= MIGRATED + CHAINED ROWS.
FOR LIST OF ROWS.
1. ANALYZE TABLE OWNER.TABLE_NAME LIST CHAINED ROWS;
2. SELECT OWNER_NAME,TABLE_NAME,HEAD_ROWID FROM CHAINED_ROWS WHERE TABLE_NAME=’TABLE_NAME’;
TO CREATE CHAINED_ROWS TABLE RUN UTLCHAIN.SQL
ELIMINATION MIGRATED ROWS.
- EXPORT / IMPORT
- EXPORT THE TABLE
- DROP OR TRUNCATE THE TABLE
- IMPORT THE TABLE
- MOVE TABLE COMMAND
- ALTER TABLE TABLE_NAME MOVE;
- COPY MIGRATED ROWS
- FIND MIGRATED ROWS USING ANALYZE
ANALYZE TALBE TABLE_NAME LIST CHAINED ROWS;
- COPY MIGRATED ROWS TO NEW TABLE
CREATE TABLE MIGRATED_ROWS AS
SELECT ORIG.*
FROM TABLE_NAME ORIG,CHAINED_ROWS CR
WHERE ORIG.ROWID=CR.ROWID
AND CR.TABLE_NAME=TABLE_NAME;
- delete migrated rows from original table
where rowid in
(select head_rowid from chained_rows);
- copy rows from new table to original table