Quantcast
Channel: SCN : Document List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 1183

Analysing Stats in HANA for Audit or ROI perspective - Part 4

$
0
0

Introduction:

 

This is the third article in the series of Analysing Stats in HANA.  In this article we'll explore Where Used of Catalog objects.

 

Here is the link to first and second part of the series Analysing Stats in HANA for Audit or ROI perspective .Analysing Stats in HANA for Audit or ROI perspective - Part 2 and Analysing Stats in HANA for Audit or ROI perspective - Part 3

 

4. HANA Model: Where Used of Catalog Objects


This is actually quite straight forward and we'll use the "SYS"."OBJECT_DEPENDENCIES" view as the source for our model.  You can execute a simple SQL query on this view to see the dataPlease refer to the SAP HANA Reference guide more details on this view.


If you are interested in ownership of a particular object, you can use the "SYS"."OWNERSHIP" view.  Please refer to the SAP HANA Reference guide more details on this view.

 

Building the Models:

Step 1:  Understanding the dataset:  The "SYS"."OBJECT_DEPENDENCIES" is a database view built on top row-store tables. So you can't use this to build graphical calculation views. But you can build SQL-based scripted calculation views. 


Note: In HANA SP06 (or earlier revisions), you can't build SQL-based scripted calculation view on DB views on row-store tables, the work around during that time was to build a store procedure to select the dataset and then use the store procedure in the scripted calculation view.



Step 2: Build the view:


a. Define the Target as

WhereUsed_Target.PNG

b. Use the following Query


var_out = SELECT

O1."OBJECT_OID"as"BASE_OBJECT_OID",

O1."OWNER_NAME"as"BASE_OWNER_NAME",

OD."BASE_SCHEMA_NAME",

OD."BASE_OBJECT_NAME",

OD."BASE_OBJECT_TYPE",

O2."OBJECT_OID"as"DEPENDENT_OBJECT_OID",

O1."OWNER_NAME"as"DEPENDENT_OWNER_NAME",

OD."DEPENDENT_SCHEMA_NAME",

OD."DEPENDENT_OBJECT_NAME",

OD."DEPENDENT_OBJECT_TYPE",

OD."DEPENDENCY_TYPE",

1 "NO_OF_ROWS"

FROM"SYS"."OBJECT_DEPENDENCIES" OD,

         "SYS"."OWNERSHIP" O1,

         "SYS"."OWNERSHIP" O2

WHERE

       OD."BASE_SCHEMA_NAME" = O1."SCHEMA_NAME"

AND OD."BASE_OBJECT_NAME" = O1."OBJECT_NAME"

AND OD."BASE_OBJECT_TYPE" = O1."OBJECT_TYPE"

AND    OD."DEPENDENT_SCHEMA_NAME" = O2."SCHEMA_NAME"

AND OD."DEPENDENT_OBJECT_NAME" = O2."OBJECT_NAME"

AND OD."DEPENDENT_OBJECT_TYPE" = O2."OBJECT_TYPE";


c. Define NO_OF_ROWS as measure and everything else as attributes. Activate the view.

WhereUsed_View.PNG


Results:

As you see below: List of Views where the "I833916"."ADWEEK" table is used.

WhereUsed_Result.PNG


Viewing all articles
Browse latest Browse all 1183

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>