Sei sulla pagina 1di 45

This post I thought of covering end to end creating a sample RPD, Changing the settings in EM and querying it from

answers in OBIEE 11g. It covers following topics This will be a good starting point for someone who wants to learn OBIEE11g. 1. Building Physical Layer 2. Buiding BMM layer 3. Building Presentation Layer 4. Updating the settings in EM for latest RPD 5. Starting BI services 6. Enabling Query Logging

Building Physical Layer


Understanding the Business Scenario & Data structure
Business Scenario: Sales history schema comes with Oracle database as one of the sample schemas. It explains a business scenario where company has products which are sold through multiple channels to customers with seasoned promotions to make the sales effective. Steps to Install the Schema: Scripts can be found under the path $ORACLE_HOME/demo/schema/sales_history Login to the Oracle Database with system user. Run the main script sh_main.sql which will create the whole schema. It will create the user SH and below list of tables. Table Name COUNTRIES CUSTOMERS PRODUCTS TIMES PROMOTIONS CHANNELS SALES COSTS

Importing a Data Source


1.

Create a New Repository for DW as mentioned below :

a. Select Start > Programs > Oracle Business Intelligence > BI Administration. (Shortcut Start > Run > Admintool) b. Select File > New

c. Enter DW in the Name, password in the Repository Password and retype the same. Select No for Import Metadata option.

Note: Please note the path where the RPD is getting stored. This is the default location for storing the RPD.
2.

Import DW table Schema

a. Create a tnsentry in ORACLE_HOME/Oracle_BI1 /network/ admin/Tnsnames.ora file for the Oracle Database from which you are planning to import the data.

b. Go back to Admin tool and Select File > Import Metadata Make sure that the connection type is OCI 10g/11g.

c. Select Tables & Keys check boxes (which ever object you needed)

Also at the time of import, you can specify the type of metadata to import. The default is to import tables, primary keys, and foreign keys. Only import objects needed for query generation. d. Then Click on Next

Note: Select the tables you wish to import and then click on Import Selected button. e. After clicking the Import button you will see the connection pool which is automatically configured based on the options you had selected. Just click OK.

f. To display the tables, expand the SH schema data source in the rpd. Verify that all tables imported successfully.

g. The Admin tool will look like this :

Update the row count and verify the database connection as shown below

Should be able to see the row counts for each table after the above step.

Save the repository.

a. Select File > Save. b. Click No to check Global Consistency. Note: Check Global Consistency checks for errors in the entire repository. Generally these are done to check errors in Business Model and Mapping. For now you can ignore this.

Defining Keys and Physical Joins


There are two different ways to define keys in Administration tool. The first technique is to create Keys on the table using Table properties and the second technique allows you to create keys and joins using Physical diagram. In the following section we are going to show both the techniques. Creating keys using Table Properties: Let us start with the Physical table CHANNELS table. The primary key on this table is made up of a single column CHANNEL_ID.
1.

In the physical layer, expand the DW folder and select CHANNELS

2. 3. 4. 5. 6. 7. 8.

Double click or right click and select properties Select the Keys tab. Give a name for the Primary Key. Select the check boxes for CHANNEL_ID. Click OK to close the dialog box. Click OK to close the Physical Table window. Collapse the CHANNELS table.

9.

Now you can see the Key Sign after collapsing the CHANNELS table.

10. 11. 12.

To create a foreign key, Select SALES table Double click or right click and select Properties Go to Foreign Keys tab

13.

Click Add button then select the CHANNLES table in the first section

like below and select the CHANNEL_ID column.

14.

Click ok. Now Foreign Key also created.

Using Physical Diagram (Recommended): Using the Physical Diagram approach you can define both Primary and Foreign keys in one step.
1. In the Physical layer, right-click the DW data source > select Physical Diagram > Object (s) and All Joins.

2. The physical diagram may appear as in screenshot below:

3. Objects will appear very big, but the zoom can be adjusted. To adjust the zoom level, right click on the white space and set the zoom level to 100%, as shown in screenshot below :

You can now drag the tables to move around and rearrange them.

4. Click the Create New Join button on the toolbar.

5. Click the PRODUCTS table first and then on the SALES table. The Physical Foreign Key dialog box will open up.

6. Select PROD_ID from PRODUCTS and PROD_ID from SALES.

Note: The order of selecting the tables matters while defining the joins. The join has one to many relationship. The first table and the second table has one to many relationship. Generally, there is one to many relationship between Dimensions and Facts. So, we click on dimension first and then on Fact.

7. Click Ok. If prompted for any question, please select Yes.

8. Repeat the above steps to define join between all the tables. The join conditions are as follows:

PROMOTIONS. PROMO_ID = SALES. PROMO_ID TIMES. TIME_ID = SALES. TIME_ID CUSTOMERS. CUST_ID = SALES. CUST_ID CHANNELS. CHANNEL_ID = SALES. CHANNEL_ID

9. When you are finished, click the X in the upper right corner to close the Physical Diagram. 10. Select File > Save or click the Save button on the toolbar to save the repository. 11.Click No when prompted to check global consistency. 12. Leave the Administration Tool and the DW repository open for the next topic. 13. Keep saving the repository at regular intervals. 14. Congratulations! You have successfully created a new repository, set up an ODBC data source, imported a table schema from an external data source into the Physical layer, and defined keys and joins.

In the next topic you learn how to build the Business Model and Mapping layer of a repository.

Building the Business Model & Mapping Layer


The main purpose of the business model is to capture how users think about their business using their own business terms. The business model simplifies the physical schema and maps the users business terms to physical sources. There are two main categories of logical tables: Fact and Dimension. Logical fact tables contain the measures of organizations business operations and performance. Logical dimension tables contain the data used to qualify the facts. A. Follow the instructions in case you closed the admin tool or else go to point 2. 1) In order to define logical table structure in DW Business Model, you will use Oracle BI Administration tool. a) Select Start > Programs > Oracle Business Intelligence > BI Administration. b) Select File > Open > Offline. c) Double-click DW.rpd to open the repository file. d) Enter the following parameters: User: Administrator Password: Admin123 e) Click OK.

2) Create a Business Model by right clicking in the white space in the Business Model

and Mapping layer and select New Business Model. In the name field, name the business model as DW and click OK. Alternatively, you could drag and drop the Physical schema to create the initial Business Model.

3) Create logical tables by right-clicking on DW business model and select New Object > Logical
Table and name it Sales Fact in the Logical Table dialog box and click OK.

4) Create Logical column of Sales Fact table a) In The Physical Layer expand SALES table. b) Select and drag AMOUNT_SOLD column from the Physical layer to the Sales Fact logical table
in the Business Model and Mapping layer. A new AMOUNT_SOLD logical column is added to the Sales Fact logical table. In the Business Model and Mapping layer, double-click AMOUNT_SOLD logical column to open the Logical Column dialog box. c) Go to the General tab and in the Name field, rename the column to Amount Sold d) Click the Aggregation tab. e) In the Default aggregation rule drop down list, select SUM. Aggregation rule determines the aggregation type to be used in the SQL query generated by OBI. For example, sum, avg, count etc. f) Click OK to close the Logical Column dialog box. Notice that the logical column icon is changed to indicate an aggregation rule is applied. g) Pull the QUANTITY_SOLD column from the SALES table to the Sales Fact h) Add the aggregation rule as SUM for Quantity Sold logical column. It should appear as like below

5) Create Dimensions in Business Model and Mapping Layer as follows :


a) Select the following tables in the Physical layer. CHANNELS, TIMES, PRODUCTS, CUSTOMERS and PROMOTIONS

b) Drag the selected tables from the Physical layer onto the DW business model folder in the
Business Model and Mapping layer. This automatically creates logical tables in the Business Model and Mapping layer.

c)

Right-click the DW business model and select Business Model Diagram > Whole Diagram.

d) Place the Sales Fact table in the middle. To adjust the zoom factor, right click on the empty space
of diagram window and select the zoom.

e)

Click the New Join button in the toolbar.

f) Click on the PRODUCTS table icon first and then click on Sales Fact table icon in the Logical
Table Diagram. The Logical Join dialog box opens. Leave the defaults as they are and click OK.

g)

The join is creating a one-to-many (1:N) relationship that joins the key column in the first table to a column that is a foreign key in the second table. Create the joins and repeat the steps for the remaining tables. You dont have to specify any join conditions in Business Model; BI server will pick the joins defined in the Physical Layer. CHANNELS join with Sales Fact CUSTOMERS join with Sales Fact TIMES join with Sales Fact PROMOTIONS join with Sales Fact Observe and close Logical Table Diagram window.

6) Select File > Save to save the DW repository 7) Click NO to check global consistency.

8) Remain logged in to the Oracle BI Administration Tool for the next lab.

Rename Business Model


Renaming Business Model Objects 1) To change a column name manually, double click a column and change the name. For example change CALENDAR YEAR to Calendar Year.

2) To automate column name changing, Click Tools > Utilities and from utility dialog box, click
Rename Wizard and then Execute.

3) In the Rename Wizard, click the Business Model and Mapping tab and select the DW business
model.

4) Click the Add Hierarchy button and click Next button.

5) First check ONLY Logical Table and Logical Column and click Next.

6) Select All text lowercase and click Add. 7) Click Change each occurrence of _ into a space and click Add. 8) Click First letter capital and click Add.
Similarly add other rules as per the screenshot. The order of the selected rules is very important, it should appear as shown in next screenshot

9) Click next and click Finish and verify that logical tables and logical columns in the Business Model
and Mapping layer are renamed as per rules.

10) The Logical Table names needs to be renamed further. It can be done manually > right click the
logical table > select the Rename option.

11) After renaming, the logical tables it should appear as :

Deleting Unnecessary Business Objects

1) Expand Channels logical table in the Business Model and Mapping layer. Use Ctrl + click to select
the ID columns except Channel ID(we have to retain the primary key always).

2) Press Delete key from keyboard or Right-click either of the selected columns and select Delete. 3) Click Yes to confirm delete. 4) Verify that the Channels logical table now has only three logical columns. 5) Repeat the steps to delete the ID logical columns from the following tables
a) b) c) d) Customers Products Promotions Times

Note: If you choose ctrl button to select multiple object make sure the Logical Table is not highlighted. 6) Save the repository. Do not check global consistency.

Building Presentation Layer


Creating Presentation Layer of DW Repository
Exercise The main purpose of building the Presentation catalog in Presentation Layer is to provide the useful and necessary data from the end-users perspective i.e. different view of data for business measures are provide for different type of users. Steps for making Presentation catalog in Presentation Layer are as follows: 1) In case you closed the rpd file, use the following steps to open the repository.

a) Select Start >Programs > Oracle Business Intelligence > BI Administration. b) Select File > Open > Offline. c) Double-click DW.rpd to open the repository file.
d) Enter the following parameters: User: Administrator Password: Admin123 e) Click OK.

2) Verify that the Presentation layer is visible. If it is not visible, select View > Presentation from the
menu bar.

3) Make the DW Business model available for Queries. To do so, double click on the DW business model in the BMM layer > select the Checkbox for

4) Drag the DW Business Model folder from the Business Model and Mapping Layer to the
Presentation Layer. Thus the DW presentation catalog is created in Presentation Layer. 5) Reordering the columns of DW presentation catalog.

a) Expand the DW presentation catalog.

b) Double click the Customers table and select the column tab.
c) Change the order of columns using Up and Down buttons. Select the column and then click on Up or Down button. After rearranging it should appear as :

d) Click OK to close the window.


6) Similarly reorder the other columns by following the method described in step 4 in following order.

7) Rename the columns of DW presentation catalog.

a) Expand the Products presentation table. b) Double-click the Prod Name column, select the General tab in the Presentation Column dialog
box and uncheck the Use Logical Column Name. c) Change the column name by typing Product Name in the name field. d) Click OK. 8) Repeat the process till all the column of Products presentation table get name as:

Note: Alternatively you could rename these columns in the Business Model & Mapping layer (manually or using Rename wizard shown previously) 9) In order to meet end users requirement we have to hide/delete some columns from presentation Layer which are not used by users or are required in Business Model & Mapping layer. For this purpose you have to perform deletion of unnecessary columns:

a) In the Channels presentation column, select the Channel Id and press Delete key from
keyboard. b) Click Yes to delete the object. c) Similarly delete the following columns from the presentation tables. Table Promotions Times Products Customers Column Name Promo Id Time Id Prod Id Cust Id

10) Verify the presentation tables for the changes you made. 11) Save the repository. Do not check global consistency. Tip: Drag and drop the business model from the business model and mapping layer onto the presentation layer, this ensures faster creation of the presentation model.

Testing and Validating Repository


Consistency Check
Before testing the repository by running queries using Oracle BI Answers, you have to check the consistencies of repository and its business model. Steps of checking repository are as follows: 1) If you havent open the Oracle BI Administration tool just open it by following steps. a) Select Start > Programs > Oracle Business Intelligence > BI Administration. b) Select File > Open > Offline. c) Double-click DW.rpd to open the repository file. d) Enter the following parameters: User: Administrator Password: Admin123 e) Click OK.

2) Select File > Check Global Consistency (Shortcut You can select the presentation catalog and
press CTRL + K)

3) If any error appears in Consistency Check Manager, then edit the repository to correct the
inconsistencies and rerun Check Global Consistency as in step 1.

4) Consistency Check Manager can show three type of messages:

a) Error: These messages indicate that there has been some inconsistency in the model and need to
be fixed before querieng. If you get these errors then go through the error description and fix it before proceeding. b) Warning: These messages show some warning messages which may or may not cause any errors. c) Best Practices: These messages are displays information about the best practices, which can be followed.

5) On successfully and errorless appearance of Consistency Check Manager, click on Close.


6) Keep the rpd open for the next lab.

Updating the EM with new RPD and start Oracle BI Services


Instructions Steps for starting the WLS and updating the configuration using Enterprise Manager Starting the WLS 1) Run the script from the below location ORACLE_HOME\user_projects\domains\bifoundation_domain\bin\startWebLogic.cmd 2) Make sure the WLS running successfully as shown below

3) Also verify that BI Server web application is running properly by logging into the WLS

4) Login to the URL http://localhost:7001/console using below username/password given


during the installation 5) After logging in go to Environment -> Servers. You can see the status of BI Server like below

6) Now login to EM URL http://localhost:7001/em using the same username/password used


for WLS We have to do following steps to config BI server with our new RPD 1. Create an encrypted key entry in the EM (new feature from 11g) 2. Enter the new RPD name in the configuration 1. Create an encrypted key entry in the EM After logging in navigate to WebLogic Domain -> bifoundation_domain Lock the domain like below before changing the configuration

Click on Security -> Credentials

Click on Create Key

Enter the Details like below Select Map -> oracle.bi.enterprise (default for encrypted key) Key -> repository.DW (repository string with the RPD name) Type -> password (always) Username/password -> enter the administrator user with password (Administrator/Admin123)

Then click on ok. Without this key BI server wont upload the repository online. After creating the key, we have to change the RPD that has to be loaded to the memory. Navigate to System MBean Browser like below

After that go to Server Configuration like below

Enter the RPD name and click on apply

Then for enabling cache go to Performance Configuration

Select true for the cache enabling option and then click apply

Navigate to BIDomain like below

Click on commit to complete your changes and make it to the config files.

Enter the value as Error (so it throws only error) and click invoke.

Check the configuration files whether the changes are into effect or not. Path: ORACLE_HOME\instances\instance1\config\OracleBIServerComponent\coreapplication_obis1\N QSConfig.INI To check the webcat location navigate like below to the PresentationServerConfiguration

See the parameter called WebCatalogSharedLocation

Now we are done with the Enterprise Manager settings. Let us start the BI services Go to Business Intelligence -> coreapplication like below and click on start

Make sure we have four components running We have not configured the scheduler so it wont run.

Now WLS & BI services both are running.

Enabling Query logging


1) Enable query logging to see the Objects being used and the SQL being issued to the data source by
the BI Server.

a) From OBIEE 11g Administrator user will not be in RPD as they are coming from WLS.
b) We can set the log level only in online mode. c) Open the Admin tool after starting all the services

d) Navigate to Manage -> Identity

e) Click on Administrator

f) Set the log level appropriately and click ok

g) After that checking the changes

2) Select File > Save to save the DW repository, Click NO to check global consistency (since consistency
check was just performed). 3) Close the Admin tool.

Executing queries using Oracle BI Answers


1) Log in to Oracle Business Intelligence as the following parameters: a) Enter the following parameters: URL: http://localhost:9704/analytics User: Administrator Password: Admin123 b) Click OK. 2) Since we had made changes to the RPD (log level changes) after starting the services, Now we have to reload the metadata configuration which is loaded in the BI server following below steps. Click on Administration after logging in

Then click on Reload Files and Metadata

Now click on Home tab and continue. 3) Click on the Analysis and the click on DW subject area to see the AD HOC layer.

4) Click on the DW Subject Area in the right pane.

5) Lets start with a simple query say state wise amount sold. In order to create a report for this, you
have to first expand Customers folder and click on State Province, then expand Sales folder and click on Amount Sold.

6) Click on Results tab or Display Results button in the right pane.


7) It may take few minutes to return the results as there are no filters. 8) The result is displayed as follows.

9) Examine the Analytics query log file.


a) Open <Oracle BI installation directory (generally D:\Oracle\instances\instance2\diagnostics\logs\OracleBIServerComponent\coreapplication_obis1 \NQQuery.log. Scroll down to the bottom of the file to locate the last query you executed. OR the other method is:

b) Go to Oracle Answers > Click Administration

c) Then click Manage Sessions to open Session Management window

d) Manage Sessions window opens. Under Action column, click View Log link to see entries of
Query log file.

The SQL Request is seen as:

As we had set the log level to 7, we can full details like 1. SQL Request 2. Subject Area Details 3. Logical Table Sources List 4. Caching Information 5. Execution Plan 6. Physical Query 7. Row count Details. As we proceed in the course we will learn all these aspects. 10) Click the logout button to log out of Oracle Answers.

Potrebbero piacerti anche