Oracle Column Lineage
An Oracle lineage sync links columns through views and static loads in code, and impact analysis can say when nothing in the database reads a column.
What gets column lineage
| Object | Column links come from |
|---|---|
| Views and materialized views | The view's query |
| Procedures, functions, packages and triggers | Each INSERT ... SELECT and MERGE, including an INSERT into a partition and a statement that ends in a LOG ERRORS clause. This covers the same statements given as a string literal to EXECUTE IMMEDIATE |
Each column link carries the expression that produced the target column. For example, a load that writes ROUND(O.AMOUNT * FX.RATE, 2) into SALES.ORDERS_USD.AMOUNT_USD links SALES.ORDERS.AMOUNT and REF.FX_RATES.RATE to it with that expression. Click the link on the canvas to see it under Column mapping (see Click a link to see how data changes). A column copied as is shows a dash.
What stays table-level
These get table-level lineage only:
- SQL built at run time:
EXECUTE IMMEDIATEorOPEN ... FORwith a variable, and anyDBMS_SQLcall. - A
MERGEwith extra conditions: aWHEREclause on itsUPDATEorINSERTbranch, or aDELETE WHEREclause. - An
INSERTwith an aliased target, such asINSERT INTO SALES.ORDERS o .... - Other statements:
UPDATE,DELETE,SELECT ... INTO,INSERT ... VALUESandINSERT ALLwrite no column lineage.
If a procedure or package holds a MERGE or INSERT from the second or third case, the whole object keeps table-level lineage. This holds for one given as a string literal too.
SQL given as string literals, such as EXECUTE IMMEDIATE 'INSERT INTO SALES.ORDERS_HIST SELECT * FROM SALES.ORDERS', or several literals joined with ||, is read for table and column lineage. SELECT * maps each column of the source to the target column in the same position. A literal joined with a variable is SQL built at run time, the first case above.
Impact: "nothing reads this column"
From the DataDios release after v1.13.0, impact analysis can say that nothing reads an Oracle table column. You see it in the Downstream tab of the Metadata Timeline when a column is dropped or changed.
Before, a column with no column links always gave Table-level: the column was not traced., and the walk listed every table downstream of the whole table. Now, when DataDios can prove that nothing reads the column, that label goes away and nothing is marked breaking for it.
DataDios gives that answer only when all of these hold:
- Every object that Oracle lists as depending on the table, in
DBA_DEPENDENCIES, is a view or code object that DataDios read in full. - Each of those objects reads the table, so it has a lineage link from it. An object that only loads the table does not count.
- None of them names the column anywhere in its SQL text.
If any of these fails, you get the table-level answer and the downstream walk, as before.
Requirements and limits
- The login must read
DBA_DEPENDENCIES, for example throughSELECT_CATALOG_ROLEorSELECT ANY DICTIONARY. With onlyALL_DEPENDENCIES, which hides objects in schemas the login cannot see, the answer stays table-level. - The answer is as of the last lineage sync. An object created since then is not seen.
- It sees only static SQL inside the database. It cannot see SQL built at run time, or readers outside the database such as reports, ETL tools and other databases.
- Some SQL counts as reading every column:
SELECT *,alias.*andNATURAL JOIN. - It errs toward "something reads it". A column name anywhere in a reader's text counts as read, even in a comment or an unrelated string. So a common name like
STATUSoften keeps the table-level answer. - Writers are not listed. A load that inserts into the column is not reported by this check.