Oracle BI EE 11g - Reporting on CLOBs - Lookups
One important new feature of BI EE 11g is the ability to report on CLOBs and other large objects. The main difference between normal Varchar/Numeric columns and LOB datatype columns is, LOB columns do not support GROUP BY, DISTINCT & ORDER BY operations on them (from a reporting perspective). Any query that BI EE generates will always have a GROUP BY or a DISTINCT in it. So, in 10g reporting on LOB columns have always been an issue(will result in Ora-XXXX errors). One had to resort to different types of workarounds for reporting on LOB columns.
In BI EE 11g, its possible to isolate different columns from the GROUP BY/DISTINCT operations by using the SPARSE/DENSE lookup operators. I have already blogged about how Sparse & Dense lookups work in general here. Lets see how the same can be used for CLOB reporting. To demonstrate this i shall be using the v$sql view. This view basically contains a CLOB called SQL_FULLTEXT. This column contains the SQL queries stored in the form of CLOB, that are fired to the Oracle database by multiple users. Our aim is to report on this view and display the SQL Queries from the CLOB column.
We start with granting select on the v_$sql view to SH schema and then importing it in BI EE.
Lookup (DENSE "LOB Reporting"."Lookup - CLOB"."SQL Full Text" , "LOB Reporting"."Lookup - CLOB"."SQL ID" )
select sum(T43900.ROWS_PROCESSED) as c1, T43900.SQL_ID as c2 from SYS.V_$SQL T43900 group by T43900.SQL_ID
select T43900.SQL_FULLTEXT as c1, T43900.SQL_ID as c2 from SYS.V_$SQL T43900
In BI EE 11g, usage tracking can now log logical sql's greater than 4000 characters into a separate CLOB column.