Thursday 24 September 2009

Oracle BI EE : Comment from OBI Dashboard

I was facing one problem in my application and I was searching for a suitable solution for that but did not get any thing from anyone. Finally I used my J2EE knowledge and build a functionality for OBI EE. You must be thinking what I am taliking about. It is putting comments on dashboards.


The requirement statement goes this way –

1> We have a set of dashboards for different purposes

2> We have a set of user of those dashboard reports

3> Our user want to provide some comments ob the dashboards

4> Those comments will be saved in the database and will be displayed in the report.

The first way to meet this requirement was to consider the so called write-back functionality. But it has some draw backs as well. Not only complex implementation but also the managing the updated data and also show them on the dashboard just after the users press update.

The approach that I have taken is little bit different. These are the steps for that –

1> Create a simple jsp page that can execure an SQL command on database. Use DB connection pool in the coding if the Application Server supports.

2> Create a dummy table in the data base. Named it DUMMY and in this table there will be only one column Dummy_Field as verchar2(1) and insert a row like this INSERT INTO dummy VALUES(‘X’); Create another table USERS_COMMENTS with these fields Comment_By, Comment_On, Comment_Text.

3> Now import this table into the physical layer and create a self join so that you build a fact to dim relation between its two alias views. Expose this table to presentation layer.

4> In the answer create a report with the Dummy_Field. As this column has one row so it will never give you a no data found error. Now go to the Narrative section of the report and create an HTML form with a multi-line text area (id=comment) and one submit button. When the submit button is called it will call a javascript function that will create a SQL like INSERT INTO user_comments VALUES(‘VALUEOF(‘USER’)’,sysdate,’comment.value’); with the text entered in the multi-line text area and call the jsp file using AJAX. The code is very simple and widely available in internet. If any one need sample code please let me know. Add this report at the end of your dashboard. It will show you a comment area with a submit button.

5> Now create a simple report that can fetch and display rows from the USER_COMMENTS table. Make the by pass saw server cache as ticked in the advance setting of the report.

6> Finally add a cookie check section on the jsp file so that it can match the OBI security mechanism.

If anyone need on any of these parts please let me know I will update the blog with that information.

Monday 21 September 2009

OBI EE : Design To Address Performance

The topic that I am going to discuss in this blog is so common place that you will find at least 9 out of every 10 OBI EE bloggers have written something on it. As a matter of fact it is highly probable that you will find nothing new in my blog. I will try to explain the A to X [Y and Z are still under researchJ] of performance engineering that governs the readiness of over all OBI EE application. The thoughts are made to be as generic as possible to address the similar issues in other reporting tools as well.

Let me start with a simple question –

What are the factors you think have an impact on the report performance?

The solution of most of the problems is under the answer of this one single question.

I am putting my own answers, just cross check your answers with mine. [And do append anything that I missed]

1> Physical Specification of Servers. Both Database and BI Servers.

2> Configuration of the database. In case of Oracle DB - PGA Size, SGA Size etc.

3> Configuration of BI Servers

4> Structure of Database Objects

5> Physical Layer and BMM Layer Modelling

6> Reporting Requirement Considerations

7> Caching

First two points are not in the direct scope OBI EE 10g discussion so I will keep them out of this blog. But you can always check ASK Tom website for bolgs related to these two steps. Just remember that the performance of OBI EE is limited to the physical resources like CPU, Memory, I/O and Network Bandwidth you have provided to the application. So more the resources you have, faster the performance you will get.

Step 3> Configuration of BI Servers
Performance is not the last but the first step of any successful BI implementation. Faster the information you provide, better the response you get from business. This is the base of every BI reporting application, so if this is not met and preserved throughout the lifecycle of the application, it is very possible that you will end up with a dead solution.

We need to define the physical architecture of the implementation. In case of production system clustering is a must to have thing. This not only boosts the performance of reports but also increase the availability of overall application. It eliminates the possibility of single node failure of the platform which is very important for any application has 24 X 7 availability commitment.

A simple OBI EE architecture can be like this –

2 Servers : Presentation Service, Java Host and OAS instance for J2EE Plug-In

2 Servers : Oracle BI Server and Scheduler

You can host your cluster controllers to any of these boxes but Oracle BI Server nodes are my personal preference. With added nodes you will increase the load applied on the platform at pick hours. But there is a limitation of maximum 16 nodes that can be added in a single OBI Server cluster. Read OBI EE documentation on how to configure a cluster for better understanding. There is another thing that you have to keep in mind when you are setting up a system - in a 32 bit server OBI can use only 3GB of memory per process.

Step 4> Structure of Database Objects
OBI as a reporting tool takes the logical queries and send the corresponding physical queries to the database layer. Database layer then executes the query and fetches the data rows and then it is sent to the OBI server for report preparation. So, if your physical query is not sending the data in time, most probably you will hit a performance related issue in your reports. The best way to address this type of issues is to create aggregate tables whenever possible. Suppose if you have a base table with day, sales qty, sales price and you have a monthly report at your OBI end then creating an aggregate table on month, sales qty and sales price will give you better performance than the earlier one. But this does not mean you have to create aggregate table for every OBI report. Just remember one thing when you create an aggregate table you put on yourself to populate (or refresh) the aggregate tables during data load time. So with the number of aggregation table your data load window will also increase.

Table also can be designed to be partitioned on date or month column to give better query response. Note that partition in Oracle means different under laying physical tables (all are different segments) accessed using same logical name.

Once you classified the data for aggregate tables and partitioning, you can build a set of indexes to make the query even faster. When you create your indexes make sure they are build on the columns that are used in the WHERE clauses of the OBI queries.

You can also use Oracle OLAP to build the aggregate layer to improve physical query response time. You can get the implementation details in Oracle OLAP website.

Remember data modelling is 25% science and 75% arts. So do not always go by the rule book to achieve the best solution.

Step 5> Physical Layer and BMM Layer Modelling
OBI internally uses a set of rules to parse the logical query to an executable physical query and it is the model that you have designed in the repository that governs the decision made by OBI during its up time. So building a proper repository is very much important for a successful BI application. Step by step documentation of how to build physical or logical object can be found in OBI EE documentation and I will not discuss them here. Rather I will focus on some points that you have to remember when building the repository.

When you are building your physical layer, try to keep these things in your mind.

1) Use the connection pools properly. Specify proper driver type (Native Call Interfaces). For example, if you are connecting to an Oracle database then an OCI 10/11g connection will be more suitable than an ODBC connection. Specify the pool size. If you have 100 concurrent users in the system then 10% to 20% of that number should be your pool size. You can increase this size but before increasing this value do consult with your database administrators. Your database should be able to handle that many concurrent open connections. Moreover every connect needs some memory in the application space, so adding more connection will increase the memory footprint of your application and require more time during start up. Make sure connection pooling is enabled.

2) Use Physical layer Alias from the physical tables. This gives your better flexibility on designing the physical model. If you have a role playing dimension (like date), this approach is very helpful. This is also helps you to model scenarios like Circular join. More over it helps you to keep the number of database views in control and easily manageable.

3) Do not forget to specify the primary keys of the tables.

4) Nullable setup is another thing that has to be defined properly for every column. This has some strange impacts. Firstly if you are selection a column that has null value but not declared as nullable. The OBI server will convert it to a double and show will 0. This may be acceptable in some cases but if you do joins then this types of conversion cases great problems. Let me explain with an example – In your physical layer you have a dimension D and a Fact F. The dimension key is D_PK and fact foreign key is F_FK. Now suppose by some mistake you have checked the Nullable option for this F_FK column. Now all the joins between your fact and dimension will take a form like this- NVL(D.D_PK, 88.00) = NVL(F.F_FK,88.00) and NVL(D.D_PK, 99.00) = NVL(F.F_FK,99.00) instead of D.D_PK = F.F_FK. As you can understand, this will impact the join performance heavily. Setting the column to null when it is really not null will give you the correct answer, however it will be slower than the straight join due to the non-use of indexes. Setting the column to not null when it is really nullable will result in the wrong answer, as the equi-join will remove null rows from the record set completely.

5) Do not use complex joins in the physical layer. Use of complex join is only required when you have a poor database design. This affects the query performance badly.

6) OBI EE allows you to import tables from different databases and join them in the physical layer but it is strongly not recommended. This type of join has to be resolved in the OBI server and makes the whole application slow.

If physical layer is the backbone of the application then the business model and mapping layer (hence forth BMM) can be seen as the heart and mind of the OBI applications. This is the place where all mystery reveals. For an OBI EE developer this is the area where he has to show his magic. I will start my discussion with a simple diagram of pyramids.


In this diagram I consider the dimension and the fact as pyramid structures with the width proportion to the data volume. In both case (i.e. Dimension and Fact), I have three layers. The Base data layer, Intermediate Aggregate layer and final Aggregate later. As we know the volume of data decreases with the increase in summarization. We will traverse less data to form out output if we fetch the information from the final aggregate layer and the same will be more if we fetch the information from the base data layer. With the amount of data traversed the time elapsed in the database side increases so the overall performance of the report decreases. This is the main conceptual building block that you always have to remember when you are modelling your business model and mapping layer. The aim is to hit the proper aggregation layer through the generated physical SQL queries from the logical SQL queries. The basic question is how to do that? Many of you already knew the answer. But I will explain for other who does not know the trick.

Fact data normally grouped (or sectioned) by the values present in the dimension and in most cases if you notice, these are the dimensional levels or hierarchies. So it is very important to model the dimensional hierarchies in the BMM model properly. For every dimension if possible create a dimensional hierarchy and specify the level keys properly. For logical dimensional tables create more than one logical table sources (hence forth LTS) and map them properly to different dimensional aggregation layers. These LTS are not selected automatically to the most performing physical sources. You have to specify proper dimensional level information in the content section of the LTS objects so that OBI can generate physical SQL that are optimum in nature. If you have dimensional values placed in more than one physical table based on some value indexing (like A to M to one physical table and N to Z to another physical table) then put proper fragmentation information in the content tab of each LTS. The same rule applies for logical fact tables. If you are hitting some performance related problems due to improper physical SQL, always remember to check your BMM layer for improper mappings and content selection.

Step 6> Reporting Requirement Consideration

From my past experience I have seen that end user comes with complains that the reports are not very fast. Specially, if you have provided OBI Answers access and end users are building their own analytical reports. The issue in most of the cases is how you are building your reports. OBI EE provides a long range of report view options and all of them have some trade offs. In most of the cases if you remember these few points then you will be able to come out from many of the issues.

1) Pivot views are normally slower than Table views as they need some extra calculation to produce the pivot functionality, so if you are considering performance then Table view is always better than Pivot views.

2) Try to implement the business rules inside the database layer as far it is possible. If it is not possible try to do it in OBI repository. Answer requests should be your last option when you are considering any business rule. This is not only gives you performing but also reusable design.

3) Try to limit the number of dashboard prompts to 6 or 10 if possible. Use multiple select instead of dropdown list. This will provide better performance for the dashboard pages. Avoid constraints and always put some default values for the prompts. This will reduce the initial search space by adding some condition in the SQL and thus provide better performance.

4) Like the above try to avoid the in-line queries from the dashboard prompts.

5) Try to avoid conditional filter based on other request. In this case the first request executes before the actual request and thus may cause slower response.

6) Make sure you have sufficient space in the temporary folder. If possible try to have more than one disk drive and configure more than one temporary location. This will provided faster response. The rule of thumb is one temporary location per physical disk. You can also use in-memory locations as temporary locations.

7) SAW has its own caching mechanism, try to use that cache as long it is possible. Bypass Oracle BI Presentation Services Cache only it is advised by the administrator.

Moreover, The OBI reports give better performance in Mozilla Firefox 3 or higher versions. This is just an observation from my past experiences. I do not know why it is like that. So when you are drawing any conclusion on performance. Make sure you have run the reports in all the available internet browsers (like IE and FireFox).

Step 7> Caching

Caching mechanism designed in a proper way can boost the end user report running experience. But this should not be treated as the solution for any performance related issue. Moreover caching if not designed properly may produce stall data related problem in the reports. Defining a caching strategy is very important.

1) If the under laying physical tables are refreshing less than 15 minutes time then it is better not to cache those tables. Because the overhead to maintain the cache will be much costly than its actual benefits.

2) If the tables are refreshing in hours and the tables are encountering similar types of queries from different user sets then you can consider caching with event tables. This will maintain the cache automatically once the table data is changed.

3) If the table refreshes only once or twice in a day then you can use programmatic cache purging and cache building. In this case after the ETL job loads the data in the tables purge the OBI cache and then run a set of Logical Queries to rebuild the cache. Normally it is suggested from Oracle to use the iBot jobs to rebuild the SAS cache. But it has some limitations. Especially if you have a clustered environment iBots build cache for Dashboard are not propagated to the cluster even if you have cluster aware cache. We have encountered this issue in our production environment and Oracle Support suggested us to us SASeedQuery command to populate the cache instead of iBots.

The effectiveness of the cache can be analyzed from the user log. If you have User Tracking enabled in your environment then you can track the efficiency from the tracking table. This information is normally helpful if you want to make some changes in your caching strategy.

Wednesday 16 September 2009

OBI EE 10.1.3.4.1 Installation procedure in Linux x86

I have searched the internet to get a proper guideline for installing Oracle BI EE 10.1.3.4.1 but did not find any thing that can state all the steps involved in this installation process. I struggled a bit and finally able to install and configure it in LINUX x86 environment. I have faced some issues and do not want anyone working in the same field to face the same problems when they start their installation.

In the following sections I have tried to document end to end installation and cluster configuration process if anyone find anything missing please let me know I will add them as well.

I will devide the whole installation process in 5 steps -

  • Get softwares and setup the platform for Oracle BI EE
  • Install Oracle BI EE 10.1.3.4.1
  • Configure the user.sh file for Orcle Database Connectivity
  • Configure the odbc.ini file for Clustered Analytics DSN
  • Managing the Services (Command Set)


Step 1> Get softwares and setup the platform for Oracle BI EE
Before you start the actual installation make sure you have all the installers with you. Oracle BI EE needs GNU Compiler Collection [commonly known as gcc, man gcc for details) C++ runtime version 3.4.3 (or later) for compilation so you have to have this in your Linux environment. The best way to know the version of gcc is very simple just put this command 'gcc -v' and check the version from there. If the version is not present please ask you Linux administrator to install the proper version.

Second thing that is important for the environment is the limit set to the number of resource handle. This can be checked issuing this command 'ulimit' or 'ulimit -n'. For proper installation of Oracle BI EE this limit should be set either to 10240 (or higher) to unlimited. If this is not set properly the UnixChk.sh script will fail and say the system is not proper for Oracle BI EE installation. So make sure you have it :)

Also check that all the server that you are planning to add the cluster have their name registered in DNS register of the network. If this is not done your clustered BI Servers will not be able to communicate with each other. The other way to resolve this is to put the IP and Name pair in the hosts file of the system. This again needs root access. :(

Now create a folder in Linux and named it OBI_EE_BASE. We will export this and use as $OBI_EE_BASE in the following section. You can create this directory anywhere in the directory structure where you (or the user who will run Oracle BI EE) has all the accessed. (Normally in my case it is 750. All to Owner, Read-Execute to Group and nothing to Other). Inside OBI_EE_BASE create three folders Installer, OracleBI, OracleBIData. Download the Oracle BI EE 10.1.3.4.1 installation binary file from Oracle e delivery and put it inside the Installer directory. for my installationthe name of the file was biee_linux_x86_redhat_101341_1of1.tar. The name may get changed with new versions. untar this file using 'tar -xvf biee_linux_x86_redhat_101341_1of1.tar' command. This will create the installer image inside the $OBI_EE_BASE/Installer/RH_Linux directory.

Once you have the created the installer image, check the version of the JDK (Java development Kit) in the system. Oracle BI EE 10.1.3.4.1 requires 1.5.0 or higher. You can check the installed JDK version using 'java -version' command. In my case I do not have JDK 1.5.0 so I have to install JDK in my system. I take the latest 1.6 version. The also is very simple. Download the binary installer from SUM website and put it under $OBI_EE_BASE directory. [Note. If you do not have root access then download the .bin (jdk-6u16-linux-i586.bin) file only.]. Change the mode of the file to 750 (chmod 750 jdk-6u16-linux-i586.bin). Now run the ./jdk-6u16-linux-i586.bin command and it will install Sun JDK 1.6. New JDK directory location will be $OBI_EE_BASE/jdk1.6.0_16. If you want you can export JAVA_HOME=$OBI_EE_BASE/jdk1.6.0_16. But this is optional.



Step 2> Install Oracle BI EE 10.1.3.4.1
Now we will start the actual Oracle BI EE installation. Go to the $OBI_EE_BASE/Installer/RH_Linux/Server/Oracle_Business_Intelligence directory. Run the ./UnixChk.sh $OBI_EE_BASE/OracleBI command for system check. If there is any issue with the system this command will identify all of them. As these are Linux system related issues so you may need to take the help of Linux administrator to resolve them. Now start Oracle BI EE installation running ./setup.sh -console command. Follow the normal instructions for the installation. During the installation you have to provide some inputs from your end like –

  • OC4J Administrator Password = Any valid string
  • jdk Location = $OBI_EE_BASE/jdk1.6.0_16
  • OracleBI Location = $OBI_EE_BASE/OracleBI
  • OracleBIData Location = $OBI_EE_BASE/OracleBIData

Once these are given the installer will do the whole installation and you can rest on your sofa :).



Step 3> Configure the user.sh file for Orcle Database Connectivity
The installation itself does not configure the Oracle Client information. So if you are planning to connect Oracle Databases. You have to configure this yourself. Also make sure you have Oracle Client installed on the system.

This is again very simple. Go to the $OBI_EE_BASE/OracleBI/setup directory and open the user.sh file. Uncomment the following lines -

# Oracle Parameters
#---------------------------
ORACLE_HOME= (In my case /$ORABASE/product/10.2.0.1)
export ORACLE_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN
PATH=$ORACLE_HOME/bin:/opt/bin:$PATH
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$LD_LIBRARY_PATH:/opt/j2se/jre/lib/sparc
export LD_LIBRARY_PATH
#---------------------------

Normally this should make you enable to access databases but some time it may cause an error like this -
[nQSError: 46029] Failed to load the DLL /ias_home/install/OracleBI/server/Bin/libnqsdbgatewayoci10g.so. Check if 'Oracle OCI 10G' database client is installed. I faced this in my own installation as well. There are many reasons for this. In my case the path for LD_LIBRARY_PATH was wrong. There was no lib32 directory under $ORACLE_HOME. I changed it to $ORACLE_HOME/lib and it solved my problem. The other two reason for this error is - Improper version of Oracle Database Client and Missing of libclntsh.so softlink inside $OBI_EE_BASE/OracleBI/setup/Bin directory. Check the metalink3 document id 537898.1 for details.

Step 4> Configure the odbc.ini file for Clustered Analytics DSN

Once you set the Oracle Client related information in the user.sh file. It is now time to configure the odbc.ini file for Oracle BI Server DSN. Open the odbc.ini file under $OBI_EE_BASE/OracleBI/setup directory and change the following section –

[Cluster]

Driver=/ias_home/install/OracleBI/server/Bin/libnqsodbc.so

Description=Oracle BI Server

ServerMachine=local

Repository=

FinalTimeOutForContactingCCS=60

InitialTimeOutForContactingPrimaryCCS=5

IsClusteredDSN=Yes

Catalog=

UID=

PWD=

Port=9703

PrimaryCCS=

PrimaryCCSPort=9706

SecondaryCCS=

SecondaryCCSPort=9706

Regional=No

The default name of the DSN is Cluster. If you want you can change it to any other name but in that case you have to change the same in instanceconfig.xml file as well under $OBI_EE_BASE/OracleBIData/web/config directory.

Step 5> Managing the Services (Command Set)

All the commands required to manage different services for Oracle BI EE can be found under $OBI_EE_BASE/OracleBI/setup directory. The use of them is also very simple.

OC4J can be manually started by running the command:

nohup ./oc4j -start > /dev/null 2>&1 &

OC4J can be manually stopped by running the command:

./oc4j -shutdown -port 23791 -password

BI Server can be started by running the command:

./run-sa.sh start

BI Server can be manually stopped by running the command:

./run-sa.sh stop

BI Presentation Service and Javahost can be started by running the command:

./run-saw.sh start

BI Presentation Service and Javahost can be manually stopped by running the command:

./run-saw.sh stop

BI Scheduler Service can be started by running the command:

./run-sch.sh start

BI Scheduler Service can be manually stopped by running the command:

./run-sch.sh stop

BI Cluster Controller can be started by running the command:

./run-ccs.sh start

BI Cluster Controller can be manually stopped by running the command:

./run-ccs.sh stop

If anyone needs any other information then please let me know. I have not writen about the cluster configuration in this blog as that this same as windows installation. But if any one needs that please let me know. I will document that in another blog.



Blog Archive