Wednesday, 5 September 2012

Session Manager in OBIEE

The Session Manager manages the BI Server session and gives us information about the server variable by session.The Session Manager is used in online mode to monitor activity.
We can see
  • logged in users
  • disconnect users,(can be done only by administrative user) &
  • terminate queries.(can be done only by administrative user)
The Session Manager shows
  • All users logged in to the session,
  • All current query requests for each user,
  • Variables and their values for a selected session.

Cache Manager in OBIEE

Cache Manager
  • Displays queries that have been cached &
  • Displays how frequently the queries have been accessed.
  • Select and delete items in cache

Tuesday, 4 September 2012

Nested Sub query VS Correlated Sub query

With a normal nested sub query, the inner SELECT query runs first and executes once, returning values to be used by the main query.  A correlated sub query however, executes once for each candidate row considered by the outer query.  In other words the inner query is driven by the outer query.
Steps of execution:
 Nested sub query execution:
  • The inner query is executed first and finds a value
  • The outer query executes once, using the value from the inner query.
Correlated Sub query execution:
  • Get the candidate row (fetched by the outer query).
  • Execute the inner query using the value of the candidate row.
  • Use the values resulting from the inner query to test “qualify or disqualify” the candidate.
  • Repeat until no candidate row remains tested.
The general format of a correlated sub query is:
select column1, column2, . . . . . . .
from table1 outer
where [column1] operator (select column1, column2,
from table2 where expr1= outer.expr2);

What is an Inline View?

INLINE VIEW

  • It is not a schema object like a normal view.
  • It is sub query with a name (alias) placed in the from clause of another select statement (main query) for which it (the sub query) acts as a data source.
  • The outer query will have a reference of the inline view.
  • The inline view can have a GROUP BY clause, order by clause or even inline view itself can be join.
  • Inline views are useful for performing the Top-N (Top 3 sales reps or top 10 students etc) analysis.
See AN EXAMPLE OF INLINE VIEW, WHICH HAS THE GROUP BY CLAUSE.  The query finds the employees in the emp table whose salary is less than the maximum salary of their department.

SQL> SELECT ENAME,SAL,E1.DEPTNO,E2.MAXSAL FROM EMP E1,
 (SELECT DEPTNO,MAX(SAL) MAXSAL FROM EMP GROUP BY DEPTNO)E2
 WHERE E1.DEPTNO=E2.DEPTNO AND E1.SAL<E2.MAXSAL;
ENAME             SAL     DEPTNO     MAXSAL
---------- ---------- ---------- ----------
CLARK            2450         10       5000
MILLER          1300         10       5000
SMITH            800           20       3000
ADAMS           1100        20       3000
JONES            2975         20       3000
ALLEN            1600        30       2850
MARTIN         1250        30       2850
JAMES             950          30       2850
TURNER         1500         30       2850
WARD             1250         30       2850
10 rows selected.

SELECT ENAME,SAL,E1.DEPTNO,E2.MAXSAL FROM EMP E1,
 (SELECT DEPTNO,MAX(SAL) MAXSAL FROM EMP GROUP BY DEPTNO order by deptno)E2 WHERE E1.DEPTNO=E2.DEPTNO AND E1.SAL<E2.MAXSAL;
ENAME             SAL     DEPTNO     MAXSAL
---------- ---------- ---------- ----------
CLARK            2450         10       5000
MILLER          1300         10       5000
SMITH            800           20       3000
ADAMS          1100         20       3000
JONES            2975         20       3000
ALLEN           1600         30       2850
MARTIN        1250         30       2850
JAMES           950            30       2850
TURNER       1500         30       2850
WARD           1250         30       2850
10 rows selected.

Related Posts Plugin for WordPress, Blogger...

ShareThis