Pages

Friday, 5 July 2013

OBIEE Content in an IFrame

We had a customer who wanted a dashboard to appear on the departmental display. This display rotates through several URLs in turn displaying each for 30 seconds and then the next one.

So a dashboard is an ideal candidate for inclusion in this display.

Unfortunately though the software used to display content embeds the content in an IFRAME.

A quick test with a bit of static HTML

<html>
<head>
<title>iFrame test</title>
</head>
<body>
<iframe src="http://myserver:9704/analytics" height=500 width=500></iframe>
</body>
</html>

Gives you an error which boils down to OBIEE doesn't work inside an IFRAME.

Fortunately by changing a few configuration settings you can be up and running.

Firstly in the instanceconfig.xml located in
[OBIEE_HOME]\instances\instance1\config\OracleBIPresentationServicesComponent\coreapplication_obips1\


add the following line 
<Security>
<InIFrameRenderingMode>allow</InIFrameRenderingMode>
<!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager-->
<ClientSessionExpireMinutes>210</ClientSessionExpireMinutes>
</Security>


Secondly in the web.xml file located in [OBIEE_HOME]\oracle_BI1\bifoundation\web\app\WEB-INF\
add the following snippet before the <login-config> node

 </servlet-mapping>
   <context-param>
   <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
   <param-value>never</param-value>
   </context-param>
    <login-config>

Thirdly restart opmn.

Finally, clear your browser cache or you will continue to get errors.

There should now be no problems with the IFRAME and we can add a list of GO URLS to the display rotator.

Monday, 1 July 2013

OBIEE - Testing the Repository Using NQCMD

You have finished making your changes to the repository and the consistency check reports no errors or warnings. Great, it's all working as planned. Unfortunately all that the consistency checker does, is make sure that logically the repository hangs together, not that your business logic is correct. A consistency check means that most common problems with the construction of the physical layer and the facts and dimensions.

Now to test that the outputs are as expected. (see also Generating an OBIEE performance Test Harness)

NQCMD

We can automate this using nqcmd and sample reports.

Before starting NQCMD run bi-init (found in ORACLE_INSTANCE/bifoundation/OracleBIApplication/coreapplication/setup) to give a properly configured command line environment to run the OBI commands.

A look at the help for the command reveals a load of options:

C:\obiee11g\Oracle_BI1\bifoundation\server\bin>nqcmd -?

-------------------------------------------------------------------------------
          Oracle BI ODBC Client
          Copyright (c) 1997-2013 Oracle Corporation, All rights reserved
-------------------------------------------------------------------------------


Argument error near: -?
Command: nqcmd - a command line client which can issue SQL statements
                 against either Oracle BI server or a variety
                 of ODBC compliant backend databases.
SYNOPSIS
         nqcmd [OPTION]...
DESCRIPTION
         -d<data source name>
         -u<user name>
         -p<password>
         -s<sql input file name>
         -o<output result file name>
         -D<Delimiter>
         -C<# number of fetched rows by column-wise binding>
         -R<# number of fetched rows by row-wise binding>
         -a (a flag to enable async processing)
         -f (a flag to enable to flush output file for each write)
         -H (a flag to enable to open/close a request handle for each query)
         -z (a flag to enable UTF8 in the output result file
         -utf16 (a flag to enable UTF16 for communicating to Oracle BI ODBC driver)
         -q (a flag to turn off row output)
         -NoFetch (a flag to disable data fetch with query execution)
         -NotForwardCursor (a flag to disable forwardonly cursor)
         -v (a flag to display the version)
         -ONFormat<FormatString, i.e. TM9, 0D99>

Before we go further go to answers and build a test query against the part of the repository you wish to test, in the advanced tab copy out the query and save this to a file. This will be the SQL file used in the test.

Run the following, your connection data source name will be different, as hopefully will your username and password.

nqcmd -d coreapplication_OH206444865 -u weblogic -p weblogic -s C:\Test\test.sql -o C:\Test\test.txtv -D; -utf16

Note that the -D is the delimiter between SQL statements in the input file if more than one select statement is in there.

Your output file should contain the query and end something like
....
....
ORDER BY 1, 2 ASC NULLS LAST
FETCH FIRST 250001 ROWS ONLY

-------------------------
s_0          s_1         
-------------------------
0            00/000008/  
-------------------------
Row count: 1
-------------------------


Processed: 1 queries

If you set up a DSN to the other server you can run the same command line and only change the contents of the -d flag, then compare the results.

Always useful if you want to test that nothing is broken prior to releasing a change.

Update :
See here for an worked example of how to automate all this in Generating an OBIEE Performance Test Harness


Friday, 28 June 2013

OBIEE - Clear Cache -SAPurgeAllCache()

Warning !!!!
What follows is technical (geeky) and should be approached only by those personnel wearing appropriate safety equipment!

One command to remember

Call SAPurgeAllCache()

Login to dashboards as normal, and go to Administration and then Issue SQL


In the box that appears input the command from above.
Call SAPurgeAllCache()



Click Issue SQL


Server Cache cleared! I’ll leave you to clear the browser cache.

Here’s what the server cache looks like.

You can also clear the cache of specific databases.
Call SAPurgeCacheByDatabase( ‘MYDB’ );

Will clear just the MYDB database cache i.e. the OBIEE physical database in the right column.

There are other similar commands to clear specific tables / queries. That I’ll leave to you.

Friday, 21 June 2013

OBIEE MUDE

It's been a while since I last put up any substantial post so I thought maybe it was time to leave you with a brain dump of what I've (been attempting to) achieved over the past month.

Two major things stand out;
1. MUDE - Multi User Development Environment.
2. Integration with SVN Subversion.

The first was a no-brainer really, a few too many developers in the repository at once, lots of half finished code, the nightmare of promoting the repository to production based on what was complete or mostly complete. Definately time for MUDE.

For those of you unaware of MUDE and what it is, not many I'm sure, it is a method of segregating the repository into various projects, where each project is self contained and has all the component parts required to function. The projects can be checked out to a local install by developers where they work, in isolation, before merging their changes back into a central repository.

MUDE


To setup MUDE you need three things; a bi server, a shared directory on that server and a full local install of OBIEE.

On the server create a shared directory and ensure that all your users have sufficient priveleges to merge changes back.
The MUD Administrator then copies in the Repository required and this will become the MUD master against which all changes are published.
The repository is opened offline and divided into projects - again by the MUD Administrator.

On the client side the users open the OBIEE administration tool and in the Tools --> Options --> Multiuser Tab, point the where the MUD master shared directory (\\server\muddir) is and describe the environment (eg DEV Machine)

When a developer wants to work they will start the OBIEE administration tool on their local installation. From the File menu they will then select Multiuser and then checkout. Select the project, as setup by the MUD Administrator, on which you want to work and open.

The local repository consists of only those details required to make the top level components in the repository work. The project may not have specified the physical layer to include and this will be added at checkout by the MUD process.

The developer, using their local install, will make changes and test outputs against their local answers queries for that project.

Once changes are made the operator has several options;
1. Discard changes - revert to how things were.
2. Refresh subset - pick up any changes in the master MUD repository that have occured since the checkout, that affect this project.
3. Compare to original - show what has changed.
4. Publish to Network - promote changes back to the MUD Master repository.

When you publish back to the MUD Master repository, a merge takes place and if conflicts arise, you need to resolve them by selecting what goes through for publication.

The MUD Master repository will then be uploaded through EM and changes promoted up through your environments.

Just bear in mind the following;

You may require named user plus licensing to be financially viable
MUD is more complex than online development, but makes sense when you know how it works
MUD Administrator divides main repository into projects; self-contained RPD subsets
Master repository is then published to a network share
Projects are then worked on independently, and then merged back into the master RPD
Uses the repository compare and merge features under the covers
Works best when each developer has a full OBIEE “Sandbox” environment to develop with and unit test their work License considerations

Integration with SVN follows.

Thursday, 20 June 2013

Decimal difference to hours and minutes in OBIEE

Just has one of those issues of different interpretations of the same item by different people in different ways.

Actually, if I'm honest, I'm glad someone's out there manually checking all the hard work we put in here.

And what is this magical value that causes so much confusion - the difference between two time values displayed as a number of hours. Does the value 5.08 mean a. five hours and eight hundredths of an hour, or b. five hours and eight minutes.

Turns out it's we thought it was the first - five hours and eight hundredths of an hour and (some of) the users thought it was five hours and eight minutes.

In the interests of sanity it was decided that a disclaimer should be put against the report in question to clarify the issue and all metadata altered to definitively reflect that this was an decimal representation of hours and fractions thereof.

But the question arose - how difficult is it to show the value 5.08 as hours and minutes.

To derive 5.08 in the database we had subtracted the start date from the end date and multiplied the result by 24 giving us the difference in hours. Oracle does offer us the opportunity to do this calculation and have the result as an interval (day-to-second), but that gets stuck in the database hence the numeric difference in hours.

Thinking the solution through it is immediately apparent the first number is the hours regardless of what comes after the decimal point. For this we can use the FLOOR function which returns 5.

FLOOR(5.08) = 5

calculating minutes is working with what's left after we remove the hours.

5.08 - FLOOR(5.08) = 0.08

which in minutes is

60*0.08 = 4.8

Which is very different to the 8 minutes assumed by some users. We could carry on and work out the seconds implied by the 0.8 of a minute, but for the purpose of this discussion, rounding the result is sufficient. Putting the last piece together gives

ROUND(60*(5.08 - FLOOR(5.08)))

so sticking it all together to make it look pretty means we'll have to cast our numbers to CHAR

CAST(FLOOR(5.08) AS CHAR) || ' hours and ' || CAST(ROUND(60*(5.08 - FLOOR(5.08))) AS CHAR) || ' minutes'

Problem solved.

Monday, 20 May 2013

Aggregates, source control and Monitoring

I have been fortunate enough to have some time to do some housekeeping on the OBIEE systems.

Monitoring.


I think it's fair to say that we had very little monitoring in place, and we knew things were bad when users phoned to say that their pages were 'slow'. Now to get a user to phone you takes some doing, usually they'll live with it, so things must get pretty bad before they do. Luckily this is only n our exploratory areas, otherwise people would be questioning just what it is we do.

Source Control


No-one like interrupting their work to perform a manual step, like source control. it is one of those things that somehow gets missed the one time you really need it. I've been looking at ways to automate this, behind the scenes, totally hands off using SVN (Subversion)

Aggregates 


Need I say more. Level heirarchies and aggregates go hand in hand. If you can provide the least number of rows back to satisfy your answers report, it will run a lot faster that running an aggregate operation over raw data.

Expect a couple of posts over the coming days detailing just what I've been doing.

Friday, 17 May 2013

Renaming Objects in the Business Layer

Rename Wizard

If you need to rename of your business layer objects in the repository, try using the Rename Wizard, found under Tools > Utilities > Rename Wizard. You can also right click objects in the Business Model and Mapping or Presentation layer and Select the rename option from the context menu.

Actually the first line should start WHEN.

You will be able to quickly and globally replace underscores with spaces, database names with business names, change from all caps to first letter capitalized only, and perform many other useful Find and Replace operations. 

The Wizard allows you to create an ordered sequence of operations, and select which repository objects to include in the processing. Be aware though, if you include objects from the presentation layer, the original object names will be preserved as aliases once you have renamed them using the Wizard.

You will be asked to approve all changes before they are applied.



See more in the Metadata Repository Builder's Guide for Oracle Business Intelligence Enterprise Edition -- Chapter 18