BI Publihser Interview
BI Publihser Interview
BI Publihser Interview
two separate layers. We can hook the PL/SQL logic to implement the Business rules, Data
extraction or post processing logic. Through PL/SQL logic, we can push some of the complex
data calculation and network intensive operations to Database layer.
Let's discuss following sample Data Template. The data template has associated default plsql
package.
DYNAMIC_WHERE_CLAUSE varchar2(3200);
P_DEPTNO varchar2(10);
P_SAL number;
P_HIRE_DATE date;
function BeforeReportTrigger return boolean;
function DeptGroupFilter (p_dept_number number ) return boolean;
function AfterReportTrigger (totalOrgsal number) return boolean;
END;
/
CREATE OR REPLACE
PACKAGE BODY emp_test1 AS
function BeforeReportTrigger return boolean IS
begin
IF (P_DEPTNO ='10') THEN
DYNAMIC_WHERE_CLAUSE :='D.DEPTNO =10';
ELSIF (P_DEPTNO ='20') THEN
DYNAMIC_WHERE_CLAUSE :='D.DEPTNO =20';
ELSIF (P_DEPTNO ='30') THEN
DYNAMIC_WHERE_CLAUSE :='D.DEPTNO =30';
ELSIF (P_DEPTNO ='40') THEN
DYNAMIC_WHERE_CLAUSE :='D.DEPTNO =40';
ELSE
DYNAMIC_WHERE_CLAUSE :='1=1';
END IF;
return true;
end;
FUNCTION AfterReportTrigger (totalOrgsal number) return boolean IS
BEGIN
INSERT INTO org_sal (report_date,total_sal_amount ) VALUES (sysdate,totalOrgsal);
commit;
return true;
END;
FUNCTION DeptGroupFilter (p_dept_number number) return boolean is
BEGIN
IF (p_dept_number='30') THEN
RETURN FALSE;
END IF;
RETURN TRUE;
end;
END;
/
PL/SQL logic should be implemented as single PL/SQL Package with following conditions.
1. All the parameters define in Parameter section of Data Template should be define as
parameters in plsql package.
2. PL/SQL logic should be implemented as function and must return a Boolean value.
3. The package should be define as defaultPackage attribute in Data Template Header.
In the above example, we see following three instance of PL/SQL call. Two dataTriggers and
one Group Filter
-<dataTrigger name="afterReport"
source="emp_test1.AfterReportTrigger(:ORG_TOTAL_SALARY)" />
-<dataTrigger name="beforeReport" source="emp_test1.BeforeReportTrigger" />
The position of first dataTrigger is before the dataStructure section in Data Template. It gets fire
before the very first SQL query executes. In this example, PL/SQL function
BeforeReportTrigger drive the DYNAMIC_WHERE_CLAUSE variable based on
P_DEPTNO value. P_DEPTNO value will be available within plsql package as the process set
the value from data template parameters to pl/sql parameters. That is the reason; we need to
define the same set of parameters in PL/SQL as defined in data template. BeforeReportTrigger
function set the DYNAMIC_WHERE_CLAUSE parameter calue as “D.DEPTNO =10”. Before
executing the SQL query Q1, process replace the substitute variable
DYNAMIC_WHERE_CLAUSE with the actual values and following query get fired.
PL/SQL parameter/s can be reference as substitute variables within SQL query and this feature
allow us to design the dynamic SQL query based on the input parameters.
The before report triggers can be used to designing dynamic SQL queries or filter conditions
using substitute variables,populating the temporary or global temporary tables for Oracle apps
for complex data extraction process and then write the SQL query against these temp tables.
The position of “afterReport” data trigger is after the dataStructure section and termed as after
Report Trigger. These triggers get fire after the XML generation complete. In our example
function “AfterReportTrigger” accept the ORG_TOTAL_SALARY as input parameter and
insert a record to ORG_SAL table.
The purpose of after report triggers is to implement any post process logic as cleaning or deleting
the temp tables or records, auditing activities.
3) Group Filter
The use of Group filter is to filter out the groups from the XML ouput, if the specified condition
implemented in calling function does not match. If the PL/SQL function returns the false, the
particular instance of group will not be the part of XML output.
In the example, DeptGroupFilter accept the dept_number element value as input. If the value is
30, it returns false and Group belongs to deptn0=30 will not be there in final xml.
I tried multiple before and aft er data triggers within the same data template and they executed
sequentially, So I think we can use multiple before and after dataTriggers. All these three call
are simple PL/SQL functions and designed for some specific operations but there is no
restrictions on nature of PL/SQL logic inside the function, just make sure it return the
appropriate Boolean value.
Please feel free to ask any question on this topic and I will be happy to help you out.
In contrast, the ON COMMIT PRESERVE ROWS clause indicates that rows should be preserved until
the end of the session.
Miscellaneous Features
If the TRUNCATE statement is issued against a temporary table, only the session
specific data is trucated. There is no affect on the data of other sessions.
Data in temporary tables is automatically deleted at the end of the database session, even
if it ends abnormally.
Indexes can be created on temporary tables. The content of the index and the scope of the
index is that same as the database session.
Views can be created against temporary tables and combinations of temporary and
permanent tables.
Temporary tables can have triggers associated with them.
Export and Import utilities can be used to transfer the table definitions, but no data rows
are processed.
There are a number of restrictions related to temporary tables but these are version
specific.
What is function
Package
Bookmarks in PDF
Excel Templates
Hierarchical Queries
Pragma Autonomous Transaction
Excel Templates
Multiple layouts
Extext templates
OBIEE MUDE
VIEWS
MATERIALIZED VIEWS
DAC
INFORMATICA
This section contains a brief introduction to XPath principles. For more information, see the
W3C Web site: http://www.w3.org/TR/xpath
XPath follows the Document Object Model (DOM), which interprets an XML document as a
tree of nodes. A node can be one of seven types:
root
element
attribute
text
namespace
processing instruction
comment
Many of these elements are shown in the following sample XML, which contains a catalog of
CDs:
The root node in this example is CATALOG. CD is an element, and it has an attribute cattype.
The sample contains the comment My CD Listing. Text is contained within the XML document
elements.
Locating Data
//CATALOG/CD
where
the double slash (//) indicates that all elements in the XML document that match the search
criteria are to be returned, regardless of the level within the document.
the slash (/) separates the child nodes. All elements matching the pattern will be returned.
/CATALOG/CD/TITLE
<CATALOG>
<CD cattype=Folk>
<TITLE>Empire Burlesque</TITLE>
</CD>
<CD cattype=Rock>
<TITLE>Hide Your Heart</TITLE>
</CD>
</CATALOG>
Further limit your search by using square brackets. The brackets locate elements with certain
child nodes or specified values. For example, the following expression locates all CDs recorded
by Bob Dylan:
/CATALOG/CD[ARTIST="Bob Dylan"]
Or, if each CD element did not have an PRICE element, you could use the following expression
to return only those CD elements that include a PRICE element:
/CATALOG/CD[PRICE]
Use the bracket notation to leverage the attribute value in your search. Use the @ symbol to
indicate an attribute. For example, the following expression locates all Rock CDs (all CDs with
the cattype attribute value Rock):
//CD[@cattype="Rock"]
This returns the following data from the sample XML document:
<CD cattype=Rock>
<TITLE>Hide Your Heart</TITLE>
<ARTIST>Bonnie Tylor</ARTIST>
<COUNTRY>UK</COUNTRY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
You can also use brackets to specify the item number to retrieve. For example, the first CD
element is read from the XML document using the following XPath expression:
/CATALOG/CD[1]
<CD cattype=Folk>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
XPath also supports wildcards to retrieve every element contained within the specified node. For
example, to retrieve all the CDs from the sample XML, use the following expression:
/CATALOG/*
You can combine statements with Boolean operators for more complex searches. The following
expression retrieves all Folk and Rock CDs, thus all the elements from the sample:
//CD[@cattype="Folk"]|//CD[@cattype="Rock"]
The pipe (|) is equal to the logical OR operator. In addition, XPath recognizes the logical OR and
AND, as well as the equality operators: <=, <, >, >=, ==, and !=. For example, we can find all
CDs released in 1985 or later using the following expression:
/CATALOG/CD[YEAR >=1985]
Starting Reference
The first character in an XPath expression determines the point at which it should start in the
XML tree. Statements beginning with a forward slash (/) are considered absolute. No slash
indicates a relative reference. An example of a relative reference is:
CD/*
This statement begins the search at the current reference point. That means if the example
occurred within a group of statements the reference point left by the previous statement would be
utilized.
As noted earlier, double forward slashes (//) retrieve every matching element regardless of
location in the document, therefore the use of double forward slashes (//) should be used only
when necessary to improve performance.
To select current and parent elements, XPath recognizes the dot notation commonly used to
navigate directories. Use a single period (.) to select the current node and use double periods (..)
to return the parent of the current node. For example, to retrieve all child nodes of the parent of
the current node, use:
../*
Therefore, to access all CDs from the sample XML, use the following expression:
/CATALOG/CD/..
You could also access all the CD tittles released in 1988 using the following:
/CATALOG/CD/TITLE[../YEAR=1988]
The .. is used to navigate up the tree of elements to find the YEAR element at the same level as
the TITLE, where it is then tested for a match against "1988". You could also use // in this case,
but if the element YEAR is used elsewhere in the XML document, you may get erroneous
results.
XPath is an extremely powerful standard when combined with RTF templates allowing you to
use conditional formatting and filtering in your template.
Namespace Support
If your XML data contains namespaces, you must declare them in the template prior to
referencing the namespace in a placeholder. Declare the namespace in the template using either
the basic RTF method or in a form field. Enter the following syntax:
For example:
<?namespace:fsg=http://www.oracle.com/fsg/2002-30-20/?>
Once declared, you can use the namespace in the placeholder markup, for example: <?
fsg:ReportName?>
If you are using the basic RTF method, you cannot insert XSL syntax directly into your template.
BI Publisher has extended the following XSL elements for use in RTF templates.
To use these in a basic-method RTF template, you must use the BI Publisher Tag form of the
XSL element. If you are using form fields, use either option.
Use this element to apply a template rule to the current element's child nodes.
Call Template
Use this element to call a named template to be inserted into or applied to the current template.
For example, use this feature to render a table multiple times.
Template Declaration
Use this element to apply a set of rules when a specified node is matched.
Variable Declaration
Example:
Assigns the value "red" to the "color" variable. The variable can then be referenced in the
template.
Import Stylesheet
Use this element to import the contents of one style sheet into another.
Note: An imported style sheet has lower precedence than the importing style sheet.
This and the <xsl:stylesheet> element are completely synonymous elements. Both are used to
define the root element of the style sheet.
Note: An included style sheet has the same precedence as the including style sheet.
Note: The namespace must be declared in the template. See Namespace Support.
format-number(number,format,[decimalformat])
Parameter Description
format Required. Specifies the format pattern. Use the following characters to specify the
pattern:
; (Pattern separator. The first pattern will be used for positive numbers and
the second for negative numbers)
decimalformat Optional. For more information on the decimal format please consult any basic XSLT
manual.
Using FO Elements
You can use the native FO syntax inside the Microsoft Word form fields.
The full list of FO elements supported by BI Publisher can be found in the Appendix: Supported
XSL-FO Elements.
Limitations
When designing tables for your PowerPoint slide, you must define the table border type
as a single line (double border, dash, and other types are not supported).
Hyperlinks are not supported.
Paper size must be the same on all pages of the RTF template. You cannot have mixed
paper sizes in the same document.
Text position may be slightly incorrect for Chinese, Japanese, and Korean fonts when
using bold or italic effects on characters. This is because Microsoft uses bold or italic
emulation when there is no bold or italic font.
BI Publisher's font fallback mechanism is not supported for PowerPoint templates. If you
wish to use a font that is not installed, ensure that you have configured it with BI
Publisher.
MUD IN OBIEE
The above diagram illustrates how the MUD works. In order for
the MUD to work following are the pre-requisites
1. A shared drive to host the Master Repository
2. All the client machines should have access to the master
repository.
3. All the client machines should have the admin tool installed.
For the MUD to work, the repository that is worked upon by all
the users should be kept in a shared directory. This shared
directory should be accessible to all the users. In each of the
client’s Admin tool, enter the Shared Directory path.
Now, open the Master repository in offline mode. The entire
concept of MUD revolves around objects called as Projects. So,
from within the Admin tool navigate to Manage – Projects.
This will open up a project window. Projects are basically
subsets of objects within the Admin tool that can be assigned to
individual users. So, the idea is to assign different projects to
different users. Also, each of these projects can contain one or
more Logical Fact tables. As soon as a logical fact table is
included all the other dependent objects would automatically be
part of the project. Typically when we start with a repository, we
would not be having any BM or presentation layers. So, it is
recommended that one imports all the physical tables and
creates the physical joins in the repository first before
implementing MUD. After that we can create dummy BM and
presentation layers so that they can be assigned to individual
projects. Also, one can assign Users, Init Blocks and Variables
to a project.
After creating and assigning objects to a project, the next step is
to save the master repository in a shared drive. Now, open up a
client Admin tool and navigate to File – Multiuser – Checkout.
This Check out process does 2 things
1. Copies the Master repository from the shared drive to the
local drive ( This will serve as the local master repository).
2. Gives you a screen to choose the project that you have the
authority to work on.
3. Creates a subset repository (would ask you to enter the
name) which would contain only the selected project related
data.
So, basically the idea is to work on the subset repository (like
creating/deleting dimensions, hierarchies etc) and then merge
the changes back to the local master repository. The merge
process will lock the master repository in the shared drive. In
order to release the lock one would have to Choose “Publish to
Network” which will copy the modified and merged local
master repository to the shared drive. The process would be the
same for all the other users.
For example :
after completing an implementation, the administrator may want to deploy Oracle BI to other
functional areas of the company. In this example, multiple developers need to work
concurrently on subsets of the metadata and merge these subsets back into a master repository
without their work conflicting with that of the other developers.
in other organizations, a single developer might manage all development. For simplicity and
performance, this developer might want to use a multiuser development environment (MUDE)
to maintain metadata code in smaller chunks instead of in a large repository.
The Oracle BI repository development process adheres to the classic Software Configuration
Management (SCM) process, which utilizes a three-way merge to manage concurrent
development. Changes are managed by merge and reconciliation.
In case of any conflicts, developers can manually resolve them. The merge creates a final
“merged” file based on two changed files, which are base-lined against a common parent file.
This enables developers to work simultaneously on repository development. Developers manage
this process using the utilities and interfaces provided in the BI Administration Tool. Changes
are managed by merge and reconciliation. The merge creates a final, “merged” file based on two
changed files, which are base-lined against a common parent file. Oracle BI repository is stored
as an rpd file. Developers check out the file and make changes locally. Changes are then merged
into a final, merged repository (rpd) file.
Articles Related
OBIEE - Repository (RPD)
Concept
The MUD environment is done by creating Projects in the repository file in the BI
Administration Tool and then copying this repository file to a shared network directory.
Developers can check out projects, make changes, and then merge the changes into the master
repository.
The entire concept of MUD (MutliUser Development) revolves around objects called as Projects.
Projects are subsets of objects based on logical fact table that can be assigned to individual users.
So, the idea is to assign different projects to different users. Also, each of these projects can
contain one or more Logical Fact tables. As soon as a logical fact table is included all the other
dependent objects would automatically be part of the project.
How to start
To start, we must :
Typically when we start with a repository, we would not be having any Business Model or
presentation layers.
importing all the physical tables and creates the physical joins
creating a dummy Business Model and then a dummy presentation layers
creating Users, Init Blocks and Variables.
Check out
In the Oracle BI Administration Tool, select File > Multiuser > Checkout.
You will see then the project where you have right.
Select on which project you want to work and the process purpose you to save it in a subset
repository.
If you have a problem on this step
* check that you have all right
* you can create a dummy file
After saving the subset, you will see 2 repository files in your local repository directory
(OBI_Home\server\Repository) :
your subset
the original file that have be automatically generated with the name
original_your_subset_file_name
Check In
To merge the modifications, Select File > Multiuser > Merge Local Changes. This merges your
changes to the shared repository.
Select ok. The next screen let you the possibilities to describe your modification. This
information will be available in the history management.
A merge screen appears. You will may be have conflicts with other user and you must resolve
them. See the merge process in detail to more details.
In the Shared directory, you can see that an additional file MasterRepository.lck appears in the
directory; this is the lock file, which is created when the shared repository is locked. Also, when you
navigate to OBI_HOME\server\Repository you can see that subset.rpd and subset.log are generated.
No other user can check in projects while the shared repository is locked. You must release it by
publishing it.
If you try to close the repository (File > Close to close the repository). A warning appears indicating that
you are closing an MUD repository without publishing or discarding your local changes, so the lock on
the repository has not been released.
At this point, you have the option to :
* publish the repository (copy the local copy of the shared repository to the server),
* discard the local changes,
* or close the repository and keep the lock.
To publish (unlock the master repository, you must publish it (Select File > Multiuser > Publish
to Network). The local copy of the shared repository is merged with the shared repository and
then closed and deleted.
History
Select File > Multiuser > History. Log in. The several version of the master repository is opened
and the history of changes is displayed.