Manohar Paleti

My photo
Hyderabad, AP, India
Working as a BI Consultant, Served for various organizations as an OBIEE Developer by building the BI Solutions for Business Decision Making..

Sunday, June 5, 2011

Building Reports From Oracle EBS

Hi,
 This  time I would like to share some basic queries to build reports on Oracle EBS.


Query to analyze Supplier Performance:-

 
SELECT DISTINCT
aps.vendor_name AS vendor,
 poh.po_header_id AS po_numbers,
mtl.segment1 AS item_code, pol.promised_date AS promise_date,
rcv.transaction_date AS receipt_date,
pol.quantity AS ordered_qty,
pol.quantity_accepted AS accepted_qty,
ROUND (rcv.transaction_date - pol.promised_date) AS variance_days,
pol.quantity - pol.quantity_accepted AS variance_qty
FROM
ap_suppliers aps,
po_headers_all poh,
po_line_locations_all pol,
rcv_transactions rcv,
po_lines_all pll,
mtl_system_items_b mtl

WHERE
          aps.vendor_id = poh.vendor_id
AND pol.line_location_id = rcv.po_line_location_id
AND pll.po_line_id = pol.line_location_id
AND pll.item_id = mtl.inventory_item_id
ORDER BY 1, 2, 3


Query to Find Variance in Cost per Meterial Over a Period:-


select CST.creation_Date as PERIOD,
MTL.SEGMENT1 as Item,
MTL.ITEM_TYPE,
avg(CST.MATERIAL_COST) as Cost
from
CST_ITEM_COSTS CST,
MTL_SYSTEM_ITEMS_B MTL
WHERE
CST.INVENTORY_ITEM_ID=MTL.INVENTORY_ITEM_ID
and MTL.item_type='P'
group by MTL. SEGMENT1,CST.creation_Date,MTL.ITEM_TYPE
order by 1

Shipments made vs Orders booked in a period


select
REQUEST_DATE PERIOD,
NVL(sum(ORDERED_QUANTITY),0) ORDERED,
NVL(SUM(SHIPPED_QUANTITY),0) SHIPMENTS
from OE_ORDER_LINES_ALL
GROUP BY REQUEST_DATE
ORDER BY 1

Order lines comparison between Schedule date and Shipment date


select DISTINCT
LINE_ID ORDER_LINES,
SCHEDULE_SHIP_DATE SCHEDULED_DATE,
ACTUAL_SHIPMENT_DATE SHIPMENT_DATE
from
OE_ORDER_LINES_ALL
Order Lines comparison between promise date and Shipment date


select
DISTINCT LINE_ID ORDER_LINE,
PROMISE_DATE,
ACTUAL_SHIPMENT_DATE SHIPMENT_DATE
FROM
OE_ORDER_LINES_ALL

Performance Analysis

SELECT unit_price, amount, job_id, purchase_basis, line_num, line_type,


item_revision, item_description, unit_meas_lookup_code, quantity,

base_unit_price, vendor_product_num, supplier_ref_number, base_uom,

base_qty, secondary_uom, secondary_qty, qc_grade,

secondary_unit_of_measure, secondary_quantity, preferred_grade,

list_price_per_unit, market_price, price_type,

allow_price_override_flag, not_to_exceed_price,

negotiated_by_preparer_flag, contract_id, oke_contract_version_id,

note_to_vendor, un_number, hazard_class, capital_expense_flag,

transaction_reason, contractor_first_name, contractor_last_name,

start_date, quantity_committed, committed_amount, row_id,

transaction_reason_code, price_type_lookup_code, cancel_flag,

cancel_date, expiration_date, price_break_lookup_code,

firm_status_lookup_code, po_header_id, creation_date,

hazard_class_id, program_id, program_update_date, request_id,

closed_by, closed_date, closed_reason, attribute2, attribute4,

attribute7, attribute9, attribute11, attribute14, category_id,

qty_rcv_tolerance, type_1099, attribute_category, attribute1,

attribute3, attribute5, attribute6, attribute8, attribute10,

reference_num, attribute12, attribute13, attribute15,

min_release_amount, closed_code, government_context,

program_application_id, min_order_quantity, max_order_quantity,

over_tolerance_error_flag, unordered_flag, closed_flag,

user_hold_flag, cancelled_by, cancel_reason, firm_date, po_line_id,

last_update_date, last_updated_by, line_type_id, last_update_login,

created_by, item_id, un_number_id, from_header_id, from_line_id,

from_line_location_id, order_type_lookup_code, matching_basis,

outside_operation_flag, allow_item_desc_update_flag,

planned_item_flag, allowed_units_lookup_code,

outside_operation_uom_type, primary_unit_class,

global_attribute_category, global_attribute1, global_attribute2,

global_attribute3, global_attribute4, global_attribute5,

global_attribute6, global_attribute7, global_attribute8,

global_attribute9, global_attribute10, global_attribute11,

global_attribute12, global_attribute13, global_attribute14,

global_attribute15, global_attribute16, global_attribute17,

global_attribute18, global_attribute19, global_attribute20,

oke_contract_header_id, manual_price_change_flag,

tracking_secondary_default_ind, grade_control_flag,

secondary_uom_code

FROM po_lines_v

WHERE NVL (cancel_flag, 'N') = 'N'

AND NVL (closed_code, 'OPEN') != 'FINALLY CLOSED'

AND (po_header_id = 64034)

ORDER BY line_num

Thursday, June 2, 2011

Company Logo on OBIEE 11G

Hi,
Following are steps to change default oracle logo on 11g home page.

Take a back up of OBIEE 11g Default logo oracle_logo

from location below (Location middlewarehome will be your middlewarehome folder name)

D:\MIDDLEWAREHOME\Oracle_BI1\bifoundation\web\app\res\sk_blafp\b_mozilla_4


Edit the logo within the above location and copy ammended logo file to location below..
transfer to:

Again your middleware path will differ slightly depending on your install

D:\MIDDLEWAREHOME\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\sk_blafp\b_mozilla_4


Restart All Services . Also goto OBIEE Administration and Clear Presentation server cache. Reload metadata.

Tnx,

OBIEE 11g – Client Only installation package available now

Just a couple of days ago Oracle announced that the Oracle BI Client Only installation is now available. You can download it from the following link:
http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/downloads/bus-intelligence-11g-165436.html

Just one important information from the Readme:

“Oracle BI Catalog Manager Client
The Oracle BI Catalog Manager client is not part of the Oracle BI Client Tools installer. Users requiring the Oracle BI Catalog Manager client tool should install the full Oracle Business Intelligence platform.”
It also works now on Windows 7 64 Bit (as reply to my blog post click here

Thanks,



Wednesday, June 1, 2011

OBIEE 11g: Configure Oracle BI Scheduler E-Mail Settings

Hi Folks,

iBot _Mail Configuration for OBIEE 11g

Before sending dashboard reports as mailing contents in iBots we have to configure the mailing details.


We have to configure in two xml files.
1. instanceconfig.xml
2. biee-domain.xml

1. instanceconfig.xml
The instanceconfig.xml file will be located in the fallowing path
    BI installation Drive\instances\instance1\config\OracleBISchedulerComponent\ coreapplication_obisch1

The below screen shot gives the information about instanceconfig.xml before configuration



 Provide SMTP Server and Sender Details in xml file as specified below
 SMTP Server as smtp.emailsrvr.com under the tag localhost
Sender as obieemanu@gmail.com under the tag
      defaultuser@defaultmailserver.com


The below screen shot gives the information about instanceconfig.xml after configuration


2. biee-domain.xml
The biee-domain.xml file will be located in the fallowing path

      BI installation Drive\user_projects\domains\bifoundation_domain\config\fmwconfig
The below screen shot gives the information about biee-domain.xml before configuration


Provide smtpServerName and emailAddressOfSender in xml file as specified below

smtpServerName as smtp.emailsrvr.com
emailAddressOfSender as obieemanu@gmail.com
 The below screen shot gives the information about biee-domain.xml after configuration
After completion for configuring instanceconfig.xml and biee-domain.xml mails we have to deploy the mail details in Enterprise Manager under the link http://localhost:7001/em as below
Configure Email settings:

1. Login to Fusion Middleware Control Enterprise manager (http://yourservername:7001:/em) using Admin user credentials

2. Navigate to Mail tab (Business Intelligence > coreapplication > Deployment>Mail



3. Click Lock and Edit Configuration to enable changes to be made.


4. Complete the elements with the following information.
 

• SMTP Server – SMTP server of your email (e.g. mail.obieemanu.com)


• Port – Port of the SMTP server (e.g. 25)

• Display name of sender – Any name

• Email address of sender – Sender’s email address (e.g. manu@obieemanu.com

• Username – Same as the sender’s email (e.g. manu@obieemanu.com)

• Password – password of your email

• Confirm password – confirm the same password as above

• Number of retries upon failure – any number

• Maximum recipients

• Addressing method To, Blind Copy Recipient (Bcc) – if you want to receive a BCC, select it.

5. Click Apply, and then click Activate Changes.

6. Return to the Business Intelligence Overview page and click Restart.
Creating an Agent to send mails:

Since we are going to configure just to test the email settings we did in the above, we create this agent as simple as possible.

1.Login to OBIEE Web (http://yourservername:7001/analytics)

2.Click New in the Global header and then select Agent and Actionable Intelligence

3.In the Schedule tab and then select Once from the Frequency list box.


4. In the Delivery content tab, select the content you want to deliver clicking the Browse button.

5. In the Recipients tab, add emails (you can add external users mails as well) whom do you want to receive a mail with delivery content.
6. Save the agent and Run it. If it runs successfully recipient get the mail with pdf attachment (we selected pdf format in the Delivery content tab).



Thank You,

Wednesday, May 25, 2011

ODI and OBIEE 11g Integration



Copied from Oracle Site


Here we will see some of the connectivity options to OBIEE 11g using the JDBC driver. You’ll see based upon some connection properties how the physical or presentation layers can be utilized. In the integrators guide for OBIEE 11g you will find a brief statement indicating that there actually is a JDBC driver for OBIEE.


In OBIEE 11g its now possible to connect directly to the physical layer. In ODI 11g the Oracle BI technology is shipped with the product along with KMs for reverse engineering, and using OBIEE models for a data source.

When you install OBIEE in 11g a light weight demonstration application is preinstalled in the server, when you open this in the BI Administration tool we see the regular 3 panel view within the administration tool.

To interrogate this system via JDBC (just like ODI does using the KMs) need a couple of things; the JDBC driver from OBIEE 11g, a java client program and the credentials. In my java client program I want to connect to the OBIEE system, when I connect I can interrogate what the JDBC driver presents for the metadata. The metadata projected via the JDBC connection’s DatabaseMetadata  changes depending on whether the property NQ_SESSION.SELECTPHYSICAL is set when the java client connects.

Let’s use the sample app to illustrate. I have a java client program here that will print out the tables in the DatabaseMetadata, it will also output the catalog and schema. For example if I execute without any special JDBC properties as follows

•java -classpath .;%BIHOMEDIR%\clients\bijdbc.jar meta_jdbc oracle.bi.jdbc.AnaJdbcDriver jdbc:oraclebi://localhost:9703/ weblogic mypass


Then I get the following returned representing the presentation layer, the sample I used is XML, and has no schema;

Catalog                          Schema    Table


Sample Sales Lite              null        Base Facts

Sample Sales Lite               null       Calculated Facts

…        ...                    ...                  .....
Sample Targets Lite            null         Base Facts

Now if I execute with the only difference being the JDBC property NQ_SESSION.SELECTPHYSICAL with the value Yes, then I see a different set of values representing the physical layer in OBIEE;

•java -classpath .;%BIHOMEDIR%\clients\bijdbc.jar meta_jdbc oracle.bi.jdbc.AnaJdbcDriver jdbc:oraclebi://localhost:9703/ weblogic mypass NQ_SESSION.SELECTPHYSICAL=Yes

The following is returned;


Catalog                        Schema                 Table

Sample App Lite Data   null                    D01 Time Day Grain

Sample App Lite Data    null                   F10 Revenue Facts (Order grain)



System DB (Update me)




If this was a database system such as Oracle, the catalog value would be the OBIEE database name and the schema would be the Oracle database schema. Other systems which have real catalog structure such as SQLServer would use its catalog value.

Its this ‘Catalog’ and ‘Schema’ value that is important when integration OBIEE with ODI.

For the demonstration application in OBIEE 11g, the following illustration shows how the information from OBIEE is related via the JDBC driver through to ODI.



In the XML example above, within ODI’s physical schema definition on the right, we leave the schema blank since the XML data source has no schema. When I did this at first, I left the default value that ODI places in the Schema field since which was ‘’ (like image below) but this string is actually used in the RKM so ended up not finding any tables in this schema! Entering an empty string resolved this.


                                 

Below we see a regular Oracle database example that has the database, schema, physical table structure, and how this is defined in ODI.

Remember back to the physical versus presentation layer usage when we passed the special property, well to do this in ODI, the data server has a panel for properties where you can define key/value pairs. So if you want to select physical objects from the OBIEE server, then you must set this property.
An additional changed in ODI 11g is the OBIEE connection pool support, this has been implemented via a ‘Connection Pool’ flex field for the Oracle BI data server. So here you set the connection pool name from the OBIEE system that you specifically want to use and this is used by the Oracle BI to Oracle (DBLINK) LKM, so if you are using this you must set this flex field.

Thank You,


OBIEE 10.1.3.4.1 installation issues ?

500 Internal Server Error

OracleJSP: oracle.jsp.provider.JspCompileException:
Errors compiling:
C:\obiee\OracleBI\oc4j_bi\j2ee\home\applicationdeployments\analytics\analytics\persistence\_pages\\_default.java
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main

Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

Exception in thread "main" Could not find the main class: com.sun.tools.javac.Main. Prog



Cause of the error :

Could not create the Java virtual machine.

Error occurred during initialization of VM

Could not reserve enough space for object heap

Resolution:
Change the parameter heap value in the server.xml file to 1024m to 256m.

please execute the following steps:

1. In server.xml (from ORACLE_HOME\j2ee\home\config\) find the following setting:

2. Change it to a lower value (ex. 256M):

3. Restart oc4j

It works now.

If you see issues again with the same jdk1.6 file then try coping the jdk1.5 file and then restart the services.

Thanks,



15 Steps to migrate 10g SSO to 11g SSO

OBIEE 10g SSO Integration with OAM 11g


In this post I share the necessary steps in order to integrate OBIEE 10g into OAM 11g Single Sign On with the little caveat that OBIEE Analytics application is deployed in Weblogic server.

OBIEE 10g has two installation modes: basic and advanced. For SSO integration, you must pick adavanced mode. And Oracle Application Server version 10.1.3.1.0 or later is required.

OBIEE 10g deployment guide states that it can be implemented with any SSO solution that uses cookies, http header variables or JavaEE container server variables. That’s true indeed, and most of the configuration is actually performed on the OBIEE side.

OBIEE 10g implements SSO through the concept of impersonation. It retrieves the end user identity through one of the mechanisms mentioned above and uses an impersonator user to establish a session to the OBIEE server on behalf of the end user.

And what you’re about to follow has been implemented in a Windows XP box for demonstration purposes.
The exact product versions used were:
Oracle Business Intelligence Enterprise Edition 10.1.3.4.1
Oracle Identity and Access Management 11.1.1.3.0
Oracle Access Manager WebGates 11.1.1.3.0
Oracle Identity Management 11.1.1.3.0
Oracle WebTier Utilities 11.1.1.2.0
Oracle Weblogic Server 10.3.4
Oracle Containers For Java (OC4J) 10.1.3.5.0

Fasten your seat belts! Here we go....
1 - Install OBIEE 10g

When you install OBIEE 10g, you get a set of standalone component processes, some admin UIs and a front-end web application running on top of OC4J.

For the purposes of this post, we’re interested in the BI Server, BI Presentation Services and the BI Presentation Services Plug-in components. The BI Server is a standalone process that maintains the BI data model and connects to data stores. BI Presentation Services is another standalone process that present information worked by BI Server to clients via ODBC. BI Presentation Services Plug-in allows web clients to interact with BI Presentation Services. In JavaEE application servers, it is a servlet component delivered via the analytics.war web application.

Once OBIEE is installed, find the analytics.war file under $BI_HOME/web folder.
Shut down OC4J in case it's running. We don't need it.

2 - Deploy the analytics.war application in WebLogic
Simply use Weblogic console to deploy the analytics.war application. There really is nothing special here. Click click click and you should get the analytics application up and running in Weblogic.


3 - Install Oracle HTTP Server (OHS)

OHS front-ends Weblogic server. A mod weblogic routing rule will forward requests to the analytics application running in Weblogic.


4 - Create routing rule in OHS mod weblogic for /analytics URL

This step can also be accomplished via Enterprise Manager.
Open mod_wl_ohs.conf located under your OHS instance home config folder and type in the following:

1:
 2: WebLogicHost
 3: WebLogicPort
4: Debug ON
5: WLLogFile /tmp/weblogic.log
 6:

 7: 8:
9: SetHandler weblogic-handler
10:

Make sure to replace the values in between
The OHS instance home config folder is typically located at $ORACLE_HOME/instances//config/OHS/ohs1
Restart OHS.

Checkpoint 1: at this point we should be able to submit requests to OHS and have them directed to Weblogic.

5 - Install OAM 11g

Nothing special here. Just follow OAM 11g install guide. It is a good idea to create one Weblogic domain along with one managed server for the OAM server.

6 - Install OAM 11g WebGate in OHS
The WebGate checks whether the executing user is authenticated before letting it access the analytics application.

7 – Register the WebGate in OAM Console



Simply follow OAM Administration Guide Instructions



Here’s my WebGate definition:




On registration, by default, you get an application domain and Authentication and Authorization policies automatically configured for the patterns / and /…/*. You don’t need those policies. Remove them and add the /analytics/…/* as a protected resource to the set of Authentication and Authorization policies.



And make sure you copy the generated ObAccessConfig.xml and cwallet.sso from the OAM’s $DOMAIN_HOME/output/ to the WebGate’s instance config folder, which is typically located at OHS’ $ORACLE_HOME/instances//config/OHS/ohs1/webgate/config.
is the name you gave to your WebGate when you registered it in the OAM Console.
Restart both OAM access server and the WebGate.

Checkpoint 2: At this point we should be able to have the WebGate intercepting calls to /analytics URL running in WebLogic and asking for credentials. Upon entering them, the user would be re-challenged by BI login screen.

8 - Create Impersonator user for the BI Server
Connect to the BI Administrator tool and select Manage –> Security.
Select User, right click on the panel’s right side, select New User… and type in the user name. For this exercise, I am calling it Impersonator. Make sure it is a member of the Administrators group.

9 - Add Impersonator user to BI Presentation Services credential store (credentialstore.xml)
Navigate to BI’s home web/bin folder and type:

> cryptotools credstore–add–infile /web/config/credentialstore.xml

You are prompted for some information. Make sure the Credential Alias is impersonation (literally). Username and password should obviously match those you just provided in the previous step. Encrypt the password and give it a passphrase.

10 - Configure instanceconfig.xml
instanceconfig.xml is also located at /web/config.
In my case, is C:\OracleBIData.
In order to allow BI Presentation Services connecting to BI Server using the Impersonator user, add the following snippet as a child of element:


Make sure to enter the passphrase you chose previously.

In order to allow BI Presentation Services consuming the end user identity authenticated by OAM, add the following as a child of element as well:





Here we’re instructing BI Presentation Services to use the OAM_REMOTE_USER http header value as the “impersonatee” user. OMA_REMOTE_USER is always put in the HTTP header by OAM upon successful authentication. BI will simply trust that. Dangerous? Oh yes.

Don NOT go to production without implementing a trusting mechanism between Weblogic and OHS. Weblogic should only accept requests from OHS. And the solutions to the rescue are 2-way SSL or some firewalling protecting Weblogic. Don’t let anyone sending requests directly to Weblogic!
Restart BI Server and BI Presentation Services processes.

Checkpoint 3: At this point SSO should work for /analytics. After getting challenged by OAM on accessing /analytics/saw.dll?Dashboard, you should be let in without any further authentication challenge by BI.

Notice that we still have two user repositories. OAM is looking at the Weblogic embedded LDAP server while BI is looking at its internal repository. That assumes the user is defined in both identity stores.

OBIEE 10g has the option of importing users and groups to its internal repository from external systems. That’s certainly an option, but it involves synchronization, which I am not a great fan of. Import and synchronization are available in the BI Administration tool.

If you seek a single identity store, keep reading.

11 - Define a new OID identity store in OAM

This step assumes OID has been previously installed. In this exercise, OID version is the one packaged in Oracle Identity Management 11.1.1.3.0.

The application policy domain created when we registered our WebGate uses Weblogic embedded LDAP server as the identity store by default.

We need to change it, by pointing it to an external LDAP server. OID being the choice here.
This is done in OAM console. On the System Configuration tab, expand the Data Sources node and select User Identity Stores. Click the New button on the tool bar. Here’s my definition:


Then associate this identity store to the authentication scheme that is associated with the authentication policy protecting the /analytics/…/* pattern. This is done under Authentication Modules node on the System Configuration tab:


LDAP is the authentication module defined for the authentication scheme protecting our /analytics/…/* pattern.

Restart OAM server.

12 - Create an LDAP server in BI Server (the same OID identity store above)
Using BI Administration tool, define the LDAP server.
Go to Manage –> Security –> New… –> LDAP Server

Click the Advanced tab and inform uid as the User name attribute type. uid is the attribute that univocally identifies the user in OID.




13 - Create a USER session variable in BI Server.

* Defining a USER session variable tells BI Server to authenticate users in an external repository.
But in case of conflicting usernames, users defined in the BI repository takes precedence.

Using the BI Administration tool,
go to Manage –> Variables. On the left side panel, under Session, select System. Right click on the right side and pick New USER…

14 - Create an LDAP Initialization Block for authenticating users in OID.
Initialization blocks are the means by which external repository data is communicated to BI server.
Again, using BI Administration tool,
go to Manage –> Variables. Click Session.
Right click on the right side and pick New Initialization Block… Give it a name, like Authentication Block.

Under Data Source, click Edit Data Source… button, pick LDAP as the type, click Browse button and pick the LDAP server you’ve defined previously.
Under Variable Target, pick the USER variable you’ve created. Inform uid as the LDAP Variable value.
You should end up with something like this:




Restart BI Server.

Checkpoint 4: at this point, you should be able to login with a user defined in OID and access the BI analytics application in SSO mode, but you’ll notice that the privileges within BI analytics look wrong.

15 – Implementing authorizations for BI using groups defined in an external LDAP server.

Unfortunately, OBIEE 10g does not retrieve group memberships directly from LDAP. But it is possible to implement it indirectly, by creating a virtual table in the Oracle database populated with LDAP user/group information (that can be done with DBMS_LDAP package).

Another option would be writing a SQL query directly against OID tables, but that’s too invasive and could break at any time due to changes in the OID schema, which is private.

Once you populate a table using DBMS_LDAP package, you can query it via a second Initialization Block and retrieve the group names for a given user, populating the GROUP session variable. This block should refer the Authentication initialization block we’ve defined earlier as a predecessor so that the USER variable is properly initialized with the authenticated user.

References:-

OBIEE 10g Documentation Library

OAM 11g Administration Guide

Thank You,