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.
![](http://www.rittmanmead.com/wp-content/uploads/2010/08/Picture_19-thumb2.png)
![](http://www.rittmanmead.com/wp-content/uploads/2010/08/Picture_20-thumb2.png)
![](http://www.rittmanmead.com/wp-content/uploads/2010/08/Picture_21-thumb2.png)
![](http://www.rittmanmead.com/wp-content/uploads/2010/08/Picture_24-thumb2.png)
Lookup (DENSE "LOB Reporting"."Lookup - CLOB"."SQL Full Text" , "LOB Reporting"."Lookup - CLOB"."SQL ID" )
![](http://www.rittmanmead.com/wp-content/uploads/2010/08/Picture_25-thumb2.png)
![](http://www.rittmanmead.com/wp-content/uploads/2010/08/Picture_26-thumb11.png)
![](http://www.rittmanmead.com/wp-content/uploads/2010/08/Picture_27-thumb2.png)
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 T43900In BI EE 11g, usage tracking can now log logical sql’s greater than 4000 characters into a separate CLOB column.
No comments:
Post a Comment