Oracle index-audit port
What was done
Ported bin/index-audit.sh / bin/index-audit.py to Oracle, closing the last
engine for the schema-correctness gate.
The port
index-audit.pynorm()now strips all double-quotes (Oracle writes expressions with quoted uppercase identifiers:SUBSTR("VALUE",1,250)→substr(value,1,250)) and folds the result to the changelog's<modifySql dbms="oracle">form.col_norm()'s(N)prefix-length strip is now scoped tomysql/mariadbonly (Oracle has no prefix-length columns; previously!= postgresqlalso applied it to Oracle).- Added
parse_db_oracle()(index-name → ordered column list) and the--engine oraclechoice.
index-audit.sh- The Oracle catalogue query reads
USER_IND_COLUMNSjoined toUSER_IND_EXPRESSIONS.USER_IND_EXPRESSIONS.COLUMN_EXPRESSIONis aLONG, which cannot be concatenated orSUBSTRed in a plain SELECT (ORA-00932/ORA-24856), so the emission is a PL/SQL block that reads the expression into aVARCHAR2(4000)and writesindex|columnlines viaDBMS_OUTPUT.BIN$%recycle-bin ghosts are excluded.
- The Oracle catalogue query reads
Result
--- 121 index definitions applied to this database: 121 correct, 0 missing, 0 wrong shape, 0 unverified (9 skipped: table dropped in a later version)
The 26.7.3 Oracle schema is correct by definition — including the function-based
indexes (IDX_GROUP_ATT_BY_NAME_VALUE → SUBSTR("VALUE",1,250)), which is the
Oracle spelling of the same index that produced the postgres false-positive
earlier.
Remaining Oracle tooling
- snapshot/restore — still needs Data Pump (
expdp/impdp); the one Oracle item left unported.
Verification
| Claim | Evidence |
|---|---|
| Function-based expressions fold to the changelog form | SUBSTR("VALUE",1,250) vs substr(value,1,250) matched, 121/121 |
LONG column handled without ORA-00932 | PL/SQL block + DBMS_OUTPUT, no errors |
| Recycle-bin ghosts excluded | WHERE index_name NOT LIKE 'BIN$%' |