Search code examples
oracleoracle11goracle-sqldevelopermetadata

Is it possible to add a custom metadata field to Oracle Data Dictionary?


Is it possible to add a metadata field at column-level (in the Oracle Data Dictionary)?

The purpose would be to hold a flag identifying where individual data items in a table have been anonymised.

I'm an analyst (not a DBA) and I'm using Oracle SQL Developer which surfaces (and enables querying of) the COLUMN_NAME, DATA_TYPE, NULLABLE, DATA_DEFAULT, COLUMN_ID, and COMMENTS metadata fields of our Oracle DB (see pic).

Screenshot of Data Dictionary fields in Oracle SQL Developer

I'd be looking to add another metadata field at this level (essentially, to add a second 'COMMENTS' field) to hold the 'Anonymisation' flag, to support easy querying of our flagged-anonymised data.

If it's possible (and advisable / supportable), I'd be grateful for any advice for describing the steps required to enable this, which I can then discuss with our Developer and DBA.


Solution

  • [TL;DR] Don't do it. Find another way.


    If it's advisable

    NO

    Never modify the data dictionary; (unless Oracle support tells you to) you are likely to invalidate your support contract with Oracle and may break the database and make it unusable.

    If it's possible

    Don't do this.

    If you really want to try it then still don't.

    If you really, really want to try it then find a database you don't care about (the don't care about bit is important!) and log on as a SYSDBA user and:

    ALTER TABLE whichever_data_dictionary_table ADD anonymisation_flag VARCHAR2(10);
    

    Then you can test whether the database breaks (and it may not break immediately but at some point later), but if it does then you almost certainly will not get any support from Oracle in fixing it.

    Did we say, "Don't do it"... we mean it.