Click the Add button. In the Browse dialog, you can view joins and select tables To view the joins, in the Browse dialog, select a table and click View. After Optionally, in the Priority Group field, enter a priority group number for this Click OK.

10-2 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition 1. In the Business Model and Mapping layer of the Administration Tool, right-click a logical table and select New Object, then select Logical Table Source. 2. In the Logical Table Source dialog, in the General tab, type a name for the logical table source.

3. Click the Add button. In the Browse dialog, you can view joins and select tables

for the logical table source. When there are two or more tables in a logical table source, all of the participating tables must have joins defined between them.

4. To view the joins, in the Browse dialog, select a table and click View. After

reviewing the joins in the Physical Table dialog, click Cancel. 5. To add tables to the table source, select the desired tables in the Name list and click Select.

6. Optionally, in the Priority Group field, enter a priority group number for this

logical table source. See Setting Priority Group Numbers for Logical Table Sources for more information. 7. In the Logical Table Source dialog, click the Column Mapping tab and complete the fields. See Defining Physical to Logical Table Source Mappings and Creating Calculated Items for instructions. 8. In the Logical Table dialog, click the Content tab and complete the fields. See Defining Content of Logical Table Sources for instructions.

9. Click OK.

Setting Priority Group Numbers for Logical Table Sources You can set priority group numbers to determine which logical table source should be used for queries for which there is more than one logical table source that can satisfy the requested set of columns. For example, you might have user queries that can be fulfilled by both a data warehouse and an OLTP source. Often, access to an operational system is expensive, while access to a data warehouse is cheap. In this situation, you can assign a higher priority to the data warehouse to ensure that all queries are fulfilled by the data warehouse if possible. Note that the priority group of a given logical table source does not always ensure that a particular query will be fulfilled by that source. Priority group assignments are only one of many factors used by the Oracle BI Server to determine which logical table source to select for a given query. However, the logical table source priority is the most significant metric and is considered before any other cost metric. To assign priority group numbers, rank your logical table sources in numeric order, with 0 being the highest-priority source. You can assign the same number to multiple sources. For example, you can have two logical table sources in priority group 0, two logical table sources in priority group 1, and so on. Often, only two priority groups are necessary 0 and 1. Assigning priority groups is optional. All logical table sources are set to priority 0 by default. In some situations, you might want to allow users to reverse the normal logical table source priority ranking at query time. To accomplish this, you can use a combination of session variables and request variables with logical table source priority groups. This feature provides a way to dynamically select a source at run time, depending on user preference. Managing Logical Table Sources Mappings 10-3 To enable this dynamic selection, you must first create the REVERSIBLE_LTS_ PRIORITY_SA_VEC session variable in the repository. Create this variable as a string vector session variable that uses a row-wise session initialization block. REVERSIBLE_ LTS_PRIORITY_SA_VEC should list the subject areas for which you want to allow users to reverse the logical table source priority ranking. You must define this variable to enable priority ranking reversal. After you have defined the set of subject areas for which you want to allow priority ranking reversal, users can include the request variable REVERSE_LTS_PRIORITY with their queries to reverse the logical table source priority ranking. This request variable can be set to 1 to reverse the logical table source priority, or 0 to keep the normal logical table source priority. As an alternative to using a request variable at query time, you can also define a predetermined set of subject areas for which the logical table source priority should be permanently reversed. To do this, create the session variable REVERSED_LTS_ PRIORITY_SA_VEC in the repository. Create this variable as a string vector session variable that uses a row-wise session initialization block. REVERSED_LTS_ PRIORITY_SA_VEC should list the subject areas for which you want the logical table source priority to be permanently reversed. See Creating Session Variables for more information about how to define session variables in the Administration Tool. Example of REVERSIBLE_LTS_PRIORITY_SA_VEC You could create a table called SA_TABLE that contains two columns: SUBJECT_ AREA_NAME and REVERSIBLE. This table could contain rows mapping subject area names to their reversible values 1 or 0, as follows: Then, you would create a string vector session variable called REVERSIBLE_LTS_ PRIORITY_SA_VEC with a row-wise session initialization block. The initialization string for this initialization block could be similar to the following: SELECT REVERSIBLE_LTS_PRIORITY_SA_VEC, SUBJECT_AREA_NAME FROM SA_TABLE WHERE REVERSIBLE=1 Figure 10–1 shows the Session Variable Initialization Block dialog for this example. SUBJECT_AREA_NAME REVERSIBLE my_sa_1 1 my_sa_2 10-4 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition Figure 10–1 Session Variable Initialization Block Dialog for REVERSIBLE_LTS_ PRIORITY_SA_VEC Example Defining Physical to Logical Table Source Mappings and Creating Calculated Items Use the Column Mapping tab of the Logical Table Source dialog to map logical columns to physical columns. The physical to logical mapping can also be used to specify transformations that occur between the Physical layer and the Business Model and Mapping layer. The transformations can be simple, such as changing an integer data type to a character, or more complex, such as applying a formula to find a percentage of sales per unit of population. Applying these transformations is typically referred to as creating calculated items. The data type of a logical column is determined by its logical table source mappings. For example, if a logical column has one physical source with a data type of VARCHAR50 not-nullable, and another physical source with a data type of VARCHAR20, nullable, then the data type of the logical column is VARCHAR50 nullable. This final type is called a promoted type. Because of the rules governing logical table source mappings, you cannot map physical sources with data types that cannot be promoted such as an INT with a VARCHAR. Managing Logical Table Sources Mappings 10-5 To map logical columns to physical columns: 1. In the Business Model and Mapping layer of the Administration Tool, double-click a logical table source. 2. In the Logical Table Source dialog, click the Column Mapping tab. 3. In the Column Mapping tab, maximize or enlarge the dialog to show all the contents, as shown in Figure 10–2 . In the Column Mapping tab, in the Logical column to physical column mapping area, you can sort the rows toggle among ascending order, descending order, and then restore original order by clicking a column heading. Figure 10–2 Column Mapping Tab of Logical Table Source Dialog

4. In the Physical Table column, select the table that contains the column you want