Select the type of variable: Static or Dynamic. If you selected Dynamic, use the Initialization Block list to select an existing To add a Default initializer value, type the value in the Default initializer box, or Click OK.

Using Variables in the Oracle BI Repository 18-3 You need to describe the content of these sources on the Content tab of the Logical Table Source dialog. Without using dynamic repository variables, you would describe the content of the source containing recent data with an expression such as: Orders.OrderDates.Order Date = TIMESTAMP 2001-06-02 00:00:00 This content statement becomes invalid as new data is added to the recent source and older data is moved to the historical source. To accurately reflect the new content of the recent source, you would have to modify the fragmentation content description manually. Dynamic repository values can be set up to do it automatically. Another suggested use for dynamic repository values is in WHERE clause filters of logical table sources, defined on the Content tab of the Logical Table Source dialog. A common use of these variables is to set filters for use in Oracle BI Presentation Services. For example, to filter a column on the value of the dynamic repository variable CurrentMonth, set the filter to the variable CurrentMonth. Creating Repository Variables This section explains how to create repository variables. To create a repository variable: 1. In the Administration Tool, select Manage, then select Variables. 2. In the Variable Manager dialog, select Action New Repository Variable. 3. In the Variable dialog, type a name for the variable. Names for all variables should be unique. The names of system session variables are reserved and cannot be used for other types of variables.

4. Select the type of variable: Static or Dynamic.

5. If you selected Dynamic, use the Initialization Block list to select an existing

initialization block that will be used to refresh the value on a continuing basis. To create a new initialization block, click New. See Creating Initialization Blocks for more information.

6. To add a Default initializer value, type the value in the Default initializer box, or

click the Expression Builder button to use Expression Builder. For static repository variables, the value you specify in the Default initializer window persists. It will not change unless you change it. If you initialize a variable using a character string, enclose the string in single quotes . Static repository variables must have default initializers that are constant values.

7. Click OK.

Using Repository Variables in Expression Builder After they are created, variables are available for use in Expression Builder. In Expression Builder, click the Repository Variables folder in the left pane to display all repository variables both static and dynamic in the middle pane by name. To use a repository variable in an expression, select it and double-click. Expression Builder pastes it into the expression at the active cursor insertion point. Variables should be used as arguments of the function VALUEOF. This happens automatically when you double-click the variables to paste them into the expression. 18-4 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition For example, the following CASE statement is identical to the one explained in the preceding example, except that variables have been substituted for the constants: CASE WHEN Hour = VALUEOFprime_beginAND Hour VALUEOFprime_end THEN Prime Time WHEN ... ELSE...END About Session Variables Session variables are similar to dynamic repository variables in that they obtain their values from initialization blocks. Unlike dynamic repository variables, however, the initialization of session variables is not scheduled. When a user begins a session, the Oracle BI Server creates new instances of session variables and initializes them. Unlike a repository variable, there are as many instances of a session variable as there are active sessions on the Oracle BI Server. Each instance of a session variable could be initialized to a different value. Session variables are primarily used when authenticating users against external sources such as database tables or LDAP servers. If a user is authenticated successfully, session variables can be used to set filters and permissions for that session. For information about using session variables when setting up security, see Managing Session Variables in Oracle Fusion Middleware Security Guide for Oracle Business Intelligence Enterprise Edition. This section contains the following topics: ■ About System Session Variables ■ About Nonsystem Session Variables About System Session Variables System session variables are session variables that the Oracle BI Server and Oracle BI Presentation Services use for specific purposes. System session variables have reserved names that cannot be used for other kinds of variables such as static or dynamic repository variables and nonsystem session variables. When you use these variables for Oracle BI Presentation Services, preface their names with NQ_SESSION. For example, to filter a column on the value of the variable LOGLEVEL, set the filter to the variable NQ_SESSION.LOGLEVEL. Table 18–1 describes the available system session variables. Note: You cannot use variables to represent columns or other repository objects. Table 18–1 System Session Variables Variable Description USER Holds the value the user enters as his or her logon name. This variable is typically populated from the LDAP profile of the user. PROXY Holds the name of the proxy user. A proxy user is a user that has been authorized to act for another user. See Oracle Fusion Middleware Security Guide for Oracle Business Intelligence Enterprise Edition for more information about the PROXY system session variable. Using Variables in the Oracle BI Repository 18-5 GROUP Contains the groups to which the user belongs. Exists only for compatibility with previous releases. Legacy groups are mapped to application roles automatically. WEBGROUPS Specifies the Catalog groups Presentation Services groups to which the user belongs, if any. Note that the recommended practice is to use application roles rather than Catalog groups. USERGUID Contains the global unique identifier GUID of the user, typically populated from the LDAP profile of the user. ROLES Contains the application roles to which the user belongs. ROLEGUIDS Contains the global unique identifiers GUIDs for the application roles to which the user belongs. GUIDs for application roles are the same as the application role names. PERMISSIONS Contains the permissions held by the user, such as oracle.bi.server.impersonateUser or oracle.bi.server.manageRepositories. DISPLAYNAME Used for Oracle BI Presentation Services. It contains the name that is displayed to the user in the greeting in the Oracle BI Presentation Services user interface. It is also saved as the author field for catalog objects. This variable is typically populated from the LDAP profile of the user. PORTALPATH Used for Oracle BI Presentation Services. It identifies the default dashboard the user sees when logging in the user can override this preference after logged on. LOGLEVEL The value of LOGLEVEL a number between 0 and 5 determines the logging level that the Oracle BI Server uses for user queries. This system session variable overrides a variable defined in the Users object in the Administration Tool. If the administrator user defined upon install has a Logging level defined as 4 and the session variable LOGLEVEL defined in the repository has a value of 0 zero, the value of 0 applies. REQUESTKEY Used for Oracle BI Presentation Services. Any users with the same nonblank request key share the same Oracle BI Presentation Services cache entries. This tells Oracle BI Presentation Services that these users have identical content filters and security in the Oracle BI Server. Sharing Oracle BI Presentation Services cache entries is a way to minimize unnecessary communication with the Oracle BI Server. SKIN Determines certain elements of the look and feel of the Oracle BI Presentation Services user interface. The user can alter some elements of the user interface by picking a style when logged on to Oracle BI Presentation Services. The SKIN variable points to an Oracle BI Presentation Services folder that contains the nonalterable elements for example, figures such as GIF files. Such directories begin with sk_. For example, if a folder were called sk_companyx, the SKIN variable would be set to companyx. DESCRIPTION Contains a description of the user, typically populated from the LDAP profile of the user. USERLOCALE Contains the locale of the user, typically populated from the LDAP profile of the user. DISABLE_CACHE_ HIT Used to enable or disable Oracle BI Server result cache hits. This variable has a possible value of 0 or 1. DISABLE_CACHE_ SEED Used to enable or disable Oracle BI Server result cache seeding. This variable has a possible value of 0 or 1. Table 18–1 Cont. System Session Variables Variable Description 18-6 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition About Nonsystem Session Variables You use the same procedure to define nonsystem session variables as for system session variables. A common use for nonsystem session variables is setting user filters. For example, you could define a nonsystem variable called SalesRegion that would be initialized to the name of the sales region of the user. You could then set a security filter for all members of a group that would allow them to view only data pertinent to their region. When you use these variables for Oracle BI Presentation Services, preface their names with NQ_SESSION. For example, to filter a column on the value of the variable SalesRegion, set the filter to the variable NQ_SESSION.SalesRegion. Creating Session Variables This section explains how to create session variables. To create a session variable: 1. In the Administration Tool, select Manage, then select Variables. 2. In the Variable Manager dialog, select Action New Session Variable. 3. In the Session Variable dialog, type a variable name. Names for all variables should be unique. The names of system session variables are reserved and cannot be used for other types of variables. 4. For session variables, you can select the following options: ■ Enable any user to set the value. Select this option to set session variables after the initialization block has populated the value at user login by calling the ODBC store procedure NQSSetSessionValue. For example, this option lets non-administrators to set this variable for sampling. ■ Security Sensitive. Select this option to identify the variable as sensitive to security when using a row-level database security strategy, such as a Virtual Private Database VPD. When filtering cache table matches, the Oracle BI Server looks at the parent database object of each column or table that is referenced in the logical request projection list. If the database object has the Virtual Private Database option selected, the Oracle BI Server matches a list of security-sensitive variables to each prospective cache hit. Cache hits would DISABLE_ SUBREQUEST_ CACHE Used to enable or disable Oracle BI Server subrequest cache hits and seeding. This variable has a possible value of 0 or 1. SELECT_PHYSICAL Identifies the query as a SELECT_PHYSICAL query. See Syntax and Usage Notes for SELECT_PHYSICAL for more information. DISABLE_PLAN_ CACHE_HIT Used to enable or disable Oracle BI Server plan cache hits. This variable has a possible value of 0 or 1. DISABLE_PLAN_ CACHE_SEED Used to enable or disable Oracle BI Server plan cache seeding. This variable has a possible value of 0 or 1. TIMEZONE Contains the time zone of the user, typically populated from the LDAP profile of the user. Table 18–1 Cont. System Session Variables Variable Description Using Variables in the Oracle BI Repository 18-7 only occur on cache entries that included and matched all security-sensitive variables.

5. Use the Initialization Block list to select an initialization block that will be used to