Obiee 简明教程

OBIEE – Repositories

OBIEE 存储库包含 BI 服务器的所有元数据,并通过管理工具进行管理。用于存储有关应用程序环境的信息,例如:

OBIEE repository contains all metadata of the BI Server and is managed through the administration tool. It is used to store information about the application environment such as −

  1. Data Modeling

  2. Aggregate Navigation

  3. Caching

  4. Security

  5. Connectivity Information

  6. SQL Information

BI 服务器可以访问多个存储库。OBIEE 存储库可以通过以下路径进行访问:

The BI Server can access multiple repositories. OBIEE Repository can be accessed using the following path −

BI_ORACLE_HOME/server/Repository -> Oracle 10g
ORACLE_INSTANCE/bifoundation/OracleBIServerComponent/coreapplication_obisn/-> Oracle 11g

OBIEE 存储库数据库也被称为 RPD,因为它具有文件扩展名。RPD 文件受密码保护,你只能使用 Oracle BI 管理工具打开或创建 RPD 文件。若要部署 OBIEE 应用程序,必须将 RPD 文件上传到 Oracle Enterprise Manager。上传 RPD 后,必须将 RPD 密码输入到 Enterprise Manager。

OBIEE repository database is also known as a RPD because of its file extension. The RPD file is password protected and you can only open or create RPD files using Oracle BI Administration tool. To deploy an OBIEE application, the RPD file must be uploaded to Oracle Enterprise Manager. After uploading the RPD, the RPD password then must be entered into Enterprise Manager.

Designing an OBIEE Repository using Administration Tool

这是一个三层过程,从物理层(模式设计)、业务模型层和表示层开始。

It is a three layer process − starting from Physical Layer (Schema Design), Business Model Layer, Presentation Layer.

Creating the Physical Layer

以下是创建物理层涉及的常见步骤:

Following are the common steps involved in creating the Physical Layer −

  1. Create physical joins between the Dimension and Fact tables.

  2. Change the names in the physical layer if required.

存储库的物理层包含有关数据源的信息。若要在物理层中创建模式,你需要从数据库和其他数据源导入元数据。

The physical layer of repository contains information about the data sources. To create the schema in the physical layer you need to import metadata from databases and other data sources.

Note - OBIEE 中的物理层支持单个存储库中的多个数据源,即可以在 OBIEE 中执行来自两个不同数据源的数据集。

Note − Physical layer in OBIEE supports multiple data sources in a single repository - i.e. data sets from 2 different data sources can be performed in OBIEE.

Create a New Repository

转到开始 → 程序 → Oracle Business Intelligence → BI 管理 → 管理工具 → 文件 → 新存储库。

Go to Start → Programs → Oracle Business Intelligence → BI Administration → Administration Tool → File → New Repository.

new repository

将打开一个新窗口 → 输入存储库名称 → 位置(它指示存储库目录的默认位置)→ 要导入元数据,选择单选按钮 → 输入密码 → 单击下一步。

A new window will open → Enter the name of Repository → Location (It tells the default location of Repository directory) → to import metadata select radio button → Enter Password → Click Next.

选择连接类型 → 输入数据源名称、用户名和密码,以连接到数据源 → 单击下一步。

Select the connection type → Enter Data Source name and User name and password to connect to data source → Click Next.

select connection type

接受您要导入的元类型 → 您可以选择数据表、主键、外键、系统数据表、同义词、别名、视图等 → 单击“下一步”。

Accept the meta types you want to import → You can select Tables, Keys, Foreign Keys, System tables, Synonyms, Alias, Views, etc. → Click Next.

import meta types

单击“下一步”后,您将看到“数据源视图”和“存储库视图”。展开架构名称并选择要使用“导入所选项”按钮添加到存储库的表 → 单击“下一步”。

Once you click Next, you will see Data Source view and Repository view. Expand the Schema name and select tables you want to add to Repository using Import Selected button → Click Next.

import metadata objects to repository

连接池窗口打开 → 单击“确定”→ 导入窗口 → 完成以打开存储库,如下面的图片所示。

Connection Pool window opens up → Click OK → Importing window → Finish to open the repository as shown in the following image.

展開“資料來源”→“架構名稱”,查看在新的儲存庫中“實體化層”中匯入的資料表清單。

Expand the Data Source → Schema name to see the list of tables Imported in Physical Layer in the new Repository.

importing window

Verify Connection and Number of Rows in Tables Under Physical Layer

轉至工具 → 更新所有列計數 → 完成後,您可以將游標移到資料表上,也可以移到個別欄位。如要查看資料表的資料,請按一下資料表名稱 → 查看資料。

Go to tools → Update all rows counts → Once it is completed you can move the cursor on the table and also for individual columns. To see Data of a table, right-click on Table name → View Data.

verifying connection

Create Alias in Repository

建議您在實體化層中經常使用資料表別名,以消除額外的聯結。在資料表名稱上按一下滑鼠右鍵,然後選擇“新增物件”→“別名”。

It is advisable that you use table aliases frequently in the Physical layer to eliminate extra joins. Right-click on table name and select New Object → Alias.

一旦您建立資料表的別名,它就會顯示在儲存庫中的同一個實體化層中。

Once you create an Alias of a table it shows up under the same Physical Layer in the Repository.

Create Primary Keys and Joins in Repository Design

Physical Joins

當您在 OBIEE 系統中建立儲存庫時,實體化聯結通常用於實體化層中。實體化聯結有助於了解應如何將兩個資料表聯結在一起。實體化聯結通常使用“等於”運算子來表達。

When you create a repository in OBIEE system, physical join is commonly used in the Physical layer. Physical joins help to understand how two tables should be joined to each other. Physical joins are normally expressed with the use of Equal operator.

您也可以在 BMM 層中使用實體化聯結,但這種情況很少見。在 BMM 層中使用實體化聯結的目的,是為了覆寫實體化層中的實體化聯結。它允許使用者定義比實體化層中的實體化聯結更複雜的聯結邏輯,所以它的運作方式類似於實體化層中的複合聯結。因此,如果我們在實體化層中使用複合聯結來套用更多的聯結條件,則無需在 BMM 層中再次使用實體化聯結。

You can also use a physical join in BMM layer, however, it is very rarely seen. The purpose of using a physical join in BMM layer is to override the physical join in the physical layer. It allows users to define more complex joining logic as compared to physical join in the physical layer so it works similar to complex join in the physical layer. Therefore, if we are using a complex join in the physical layer for applying more join conditions, there is no need to use a physical join in BMM layer again.

physical joins

在上面的擷取畫面中,您可以在兩個資料表名稱(「產品」和「銷售」)之間看到實體化聯結。實體化聯結表達式告訴我們,資料表應如何彼此聯結,如下面的擷取畫面所示。

In the above snapshot, you can see a physical join between two table names − Products and Sales. Physical Join expression tells how the tables should be joined with each other as shown in the snapshot.

極力建議在實體化層中使用實體化聯結,並盡可能在 BMM 層中使用複合聯結,以保持儲存庫設計的簡潔。只有在實際需要不同的聯結時,才在 BMM 層中使用實體化聯結。

It is always recommended to use a physical join in the physical layer and complex join in BMM layer as much as possible to keep Repository design simple. Only when there is an actual need for a different join, then use a physical join in BMM layer.

現在,要在設計儲存庫時聯結資料表,請選取實體化層中的所有資料表 → 按一下滑鼠右鍵 → 實體化圖 → 僅針對選取的物件的選項,您也可以使用頂端的「實體化圖」按鈕。

Now to join tables while designing Repository, select all the tables in the Physical layer → Right-click → Physical diagram → Selected objects only option or you can also use Physical Diagram button at the top.

physical layer diagram objects

如以下圖片所示,會出現實體化圖框,並加入所有資料表名稱。選取頂端的「新增外鍵」,並選取要聯結的維度資料表和事實資料表。

Physical Diagram box as shown in the following image appears with all the table names added. Select the new foreign key at the top and select Dim and Fact table to join.

physical diagram box

Foreign Key in Physical Layer

實體化層中的外鍵用於定義兩個資料表之間的主要鍵值 - 外鍵值關係。在實體化圖中建立時,您必須先指派維度,然後再指派事實資料表。

A Foreign key in the physical layer is used to define Primary key-Foreign key relation between two tables. When you create it in the physical diagram, you have to point first the dimension and then the fact table.

Note − 從架構匯入資料表到 RPD 實體化層時,您也可以在資料表資料中選擇 KEY 和 FOREIGN KEY,然後主要鍵值 - 外鍵值聯結會自動進行定義,但從效能的角度來看,不建議這麼做。

Note − When you import tables from schema into RPD Physical Layer, you can also select KEY and FOREIGN KEY along with the table data, then the primary key-foreign key joins are automatically defined, however it is not recommended from performance point of view.

foreign key

您先按一下的資料表,會建立將第一個資料表中的欄位聯結到第二個資料表中的外鍵欄位的「一對一」或「一對多」關係 → 按一下“確定”。兩個資料表之間的聯結會在實體化圖框中顯示。資料表聯結完成後,使用「X」選項關閉實體化圖框。

The table you click first, it creates one-to-one or one-to-many relationship that joins column in first table with foreign key column in the second table → Click Ok. The join will be visible in Physical Diagram box between two tables. Once tables are joined, close the Physical diagram box using ‘X’ option.

如要儲存新的儲存庫,請移至「檔案」→「儲存」,或按一下頂端的「儲存」按鈕。

To save the new Repository go to File → Save or click the save button at the top.

save repository

Creating Business Model and Mapping Layer of a Repository

它定義了物件的業務或邏輯模型,以及業務模型與實體化層中架構之間的對應關係。它簡化了實體化架構,並將使用者的業務需求對應到實體化資料表。

It defines the business or logical model of objects and their mapping between business model and Schema in the physical layer. It simplifies the Physical Schema and maps the user business requirement to physical tables.

OBIEE 系統管理工具的「業務模型和對應關係」層可能包含一個或多個業務模型物件。業務模型物件定義了業務模型定義,以及業務模型中從邏輯資料表到實體化資料表的對應關係。

The Business Model and Mapping layer of OBIEE system administration tool can contain one or more business model objects. A business model object defines the business model definitions and the mappings from logical to physical tables for the business model.

构建存储库的业务模型和映射层步骤如下 −

Following are the steps to build the Business Model and Mapping layer of a repository −

  1. Create a business model

  2. Examine logical joins

  3. Examine logical columns

  4. Examine logical table sources

  5. Rename logical table objects manually

  6. Rename logical table objects using the rename wizard and deleting unnecessary logical objects

  7. Creating measures (Aggregations)

Create a Business Model

右键单击业务模型和映射空间 → 新建业务模型。

Right-click on Business Model and Mapping Space → New Business Model.

business model

输入业务模型名称 → 单击确定。

Enter the name of Business Model → click OK.

在物理层中,选择所有要添加到业务模型中的表/别名表,并将其拖动到业务模型。您也可以逐个添加表。如果您同时拖动所有表,它将保留它们之间的键和联接。

In the physical layer, select all the tables/alias tables to be added to Business Model and drag to Business Model. You can also add tables one by one. If you drag all the tables simultaneously, it will keep keys and joins between them.

adding tables to business model

还要注意维度表和事实表的图标差异。最后一个表是事实表,前三个是维度表。

Also note the difference in icon of Dimension and Fact tables. Last table is Fact table and top 3 are dimension tables.

现在右键单击业务模型 → 选择业务模型关系图 → 整个关系图 → 所有表在同时拖动时将保持所有联接和键。现在双击任意联接以打开逻辑联接框。

Now right-click on Business model → select Business Model diagram → Whole diagram → All tables are dragged simultaneously so it will keep all joins and keys. Now double click on any join to open the logical join box.

business model diagram

Logical and Complex Joins in BMM

此层中的联接是逻辑联接。它不显示表达式,并告知表之间的联接类型。它有助于 Oracle BI 服务器了解业务模型各个部分之间的关系。当您向 Oracle BI 服务器发送查询时,服务器通过检查逻辑模型的结构来确定如何构造物理查询。

Joins in this layer are logical joins. It doesn’t show expressions and tells the type of join between tables. It helps Oracle BI server to understand the relationships between the various pieces of the business model. When you send a query to Oracle BI server, the server determines how to construct physical queries by examining how the logical model is structured.

单击“确定”→ 单击“X”关闭业务模型关系图。

Click Ok → Click ‘X’ to close the Business model diagram.

要检查逻辑列和逻辑表来源,请首先展开 BMM 表下的列。当您从物理层拖动所有表时,会为每个表创建逻辑列。要检查逻辑表来源 → 展开每个表下的源文件夹,并将其指向物理层中的表。

To examine logical columns and logical table sources, first expand the columns under tables in BMM. Logical columns were created for each table when you dragged all tables from the physical layer. To check logical table sources → Expand the source folder under each table and it points to the table in the physical layer.

双击逻辑表来源(不是逻辑表)以打开逻辑表来源对话框 → 常规选项卡 → 重命名逻辑表来源。逻辑表到物理表的映射在“映射到这些表”选项下定义。

Double-click the logical table source (not the logical table) to open the logical table source dialog box → General tab → rename the logical table source. Logical table to physical table mapping is defined under "Map to these tables" option.

logical table source

接下来,列映射选项卡定义逻辑列到物理列的映射。如果未显示映射,请选中该选项 → 显示已映射列。

Next, Column mapping tab defines the logical column to physical column mappings. If mappings are not shown, check the option → Show mapped columns.

column mapping tab

Complex Joins

没有像 OBIEE 11g 中的显式复杂联接。它仅存在于 Oracle 10g 中。

There is no specific explicit complex join like in OBIEE 11g. It only exists in Oracle 10g.

依次转到管理 → 联接 → 操作 → 新建 → 复杂联接。

Go to Manage → Joins → Actions → New → Complex Join.

当复杂联接用于 BMM 层时,它们充当占位符。它们允许 OBI 服务器决定为满足请求的事实和维度逻辑表源之间的最佳联接。

When complex joins are used in the BMM layer, they act as placeholders. They allow the OBI Server to decide on which are the best joins between fact and dimension logical table source to satisfy the request.

Rename Logical Objects Manually

要手动重命名逻辑表对象,请单击 BMM 中逻辑表下的列名称。您也可以右键单击列名称,然后选择重命名选项来重命名对象。

To rename logical table objects manually, click the column name under the Logical table in BMM. You can also right-click on column name and select option rename, to rename the object.

这被称为手动重命名对象的方法。

This is known as manual method to rename objects.

Rename Objects Using the Rename Wizard

依次转到工具 → 实用工具 → 重命名向导 → 执行,以打开重命名向导。

Go to Tools → Utilities → Rename Wizard → Execute to open the rename wizard.

rename wizard

在“选择对象”屏幕中,单击“业务模型和映射”。它将显示业务模型名称 → 展开业务模型名称 → 展开逻辑表。

In the Select Objects screen, click Business Model and Mapping. It will show Business Model name → Expand Business Model name → Expand logical tables.

business model and mapping

使用 Shift 键选中逻辑表下的所有列进行重命名 → 单击添加。类似地,从所有其他逻辑 Dim 和 Fact 表中添加列 → 单击下一步。

Select all the columns under the logical table to rename using the Shift key → Click Add. Similarly, add columns from all other logical Dim and Fact tables → click Next.

select logical column
It shows all logical columns/tables added to wizard → Click Next to open Rules screen → Add rules from the list to rename like : A

text lower case and change each occurrence of ‘_’ to space as shown in the following snapshot.

add rules to open rules

单击下一步 → 完成。现在,如果您展开业务模型中逻辑表下的对象名称和物理层中的对象,那么 BMM 下的对象将根据需要重命名。

Click Next → finish. Now, if you expand Object names under logical tables in Business model and Objects in the physical layer, objects under BMM are renamed as required.

Delete Unnecessary Logical Objects

在 BMM 层中,展开逻辑表 → 选中要删除的对象 → 右键单击 → 删除 → 是。

In the BMM layer, expand Logical tables → select objects to be deleted → right-click → Delete → Yes.

delete unnecessary logical objects

Create Measures (Aggregations)

双击逻辑 Fact 表中的列名称 → 转到“聚合”选项卡,然后从下拉列表中选择聚合函数 → 单击确定。

Double-click on the column name in the logical Fact table → Go to Aggregation tab and select the Aggregate function from the dropdown list → Click OK.

create measures

度量表示可添加的数据,例如总收入或总数量。单击顶部的保存选项以保存信息库。

Measures represent data that is additive, such as total revenue or total quantity. Click on save option at top to save the repository.

Creating the Presentation Layer of a Repository

右键单击显示区域 → 新建主题域 → 在“常规”选项卡中输入主题域名称(建议与业务模型类似)→ 单击确定。

Right-click on Presentation area → New Subject Area → In the General tab enter the name of subject area (Recommended similar to Business Model) → Click OK.

creating presentation layer

创建主题域后,右键单击主题域 → 新建显示表 → 输入显示表名称 → 单击确定(添加与报表中必需的参数数量相等的显示表数量)。

Once subject area is created, right click on subject area → New presentation table → Enter the name of the presentation table → Click OK (Add number of presentation tables equal to number of parameters required in the report).

new presentation table

现在,要在显示表下创建列 → 选择 BMM 中逻辑表下的对象,并将它们拖动到主题域下的显示表(使用 Ctrl 键选择多个对象进行拖动)。重复此过程,并将逻辑列添加到其余的显示表中。

Now, to create columns under Presentation tables → Select the objects under logical tables in BMM and drag them to Presentation tables under subject area (Use Ctrl key to select multiple objects for dragging). Repeat the process and add the logical columns to the remaining presentation tables.

Rename and Reorder Objects in Presentation Layer

您可以通过双击主题域下的逻辑对象对显示表中的对象进行重命名。

You can rename the objects in Presentation tables by a double-click on logical objects under subject area.

在“常规”选项卡中 → 取消选中“使用逻辑列名称”复选框 → 编辑名称字段 → 单击确定。

In General tab → Deselect the check box Use Logical column name → Edit the name field → Click OK.

rename and reorder objects

类似地,您可以重命名显示层中的所有对象,而不更改其在 BMM 层中的名称。

Similarly, you can rename all the objects in the Presentation layer without changing their name in BMM layer.

若要对表中的列进行排序,请双击显示 → 列下的表名称 → 使用向上和向下箭头更改顺序 → 单击确定。

To order the columns in a table, double-click on the table name under Presentation → Columns → Use up and down arrows to change the order → Click OK.

changing order using arrows

类似地,您可以更改显示区域下所有显示表中的对象顺序。转到文件 → 单击保存以保存信息库。

Similarly, you can change objects order in all presentation tables under Presentation area. Go to File → Click Save to save the Repository.

Check Consistency and Load the Repository for Query Analysis

转到文件 → 检查全局一致性 → 您将收到以下消息 → 单击是。

Go to File → Check Global Consistency → You will receive the following message → Click Yes.

check consistency and load repository

单击确定后 → BMM 下的业务模型将变为绿色 → 单击保存信息库,而不再次检查全局一致性。

Once you click OK → Business model under BMM will change to Green → Click save the repository without checking global consistency again.

Disable Caching

为了提高查询性能,建议禁用 BI 服务器缓存选项。

To improve query performance, it is advised to disable BI server cache option.

打开浏览器并输入以下 URL 以打开 Fusion Middleware Control Enterprise Manager:[role="bare"] [role="bare"]http://<machine name>:7001/em

Open a browser and enter the following URL to open Fusion Middleware Control Enterprise Manager: [role="bare"]http://<machine name>:7001/em

输入用户名和密码,然后单击登录。

Enter the user name and password and click Login.

在左侧,展开业务智能 → coreapplication → 容量管理选项卡 → 性能。

On the left side, expand Business Intelligence → coreapplication → Capacity Management tab → Performance.

disable caching

启用 BI 服务器缓存部分默认处于选中状态 → 单击锁定并编辑配置 → 单击关闭。

Enable BI Server Cache section is by default checked → Click Lock and Edit Configuration → Click Close.

enable bi server cache

现在取消选择启用缓存选项 → 用来提高查询性能 → 应用 → 激活更改 → 成功完成。

Now deselect cache enabled option → It is used to improve query performance → Apply → Activate Changes → Completed Successfully.

Loading the Repository

转至部署选项卡 → 存储库 → 锁定并编辑配置 → 成功完成。

Go to Deployment tab → Repository → Lock and Edit Configuration → Completed Successfully.

loading the repository

单击上载 BI 服务器存储库部分 → 浏览至打开选择文件对话框 → 选择存储库 .rpd 文件并单击打开 → 输入存储库密码 → 应用 → 激活更改。

Click Upload BI Server Repository section → Browse to open the Choose file dialog box → Select the Repository .rpd file and click on Open → Enter Repository password → Apply → Activate Changes.

activate changes

激活更改 → 成功完成 → 单击屏幕顶部的重启以应用最新更改选项 → 单击是。

Activate Changes → Completed Successfully → Click Restart to apply recent changes option on top of the screen → Click Yes.

completed successfully

存储库成功创建并加载以供查询分析。

Repository is successfully created and loaded for query Analysis.