Repository initialization blocks only In the Schedule area, select a start date and

18-10 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition Creating Initialization Blocks See About Using Initialization Blocks with Variables for more information about initialization blocks. To create initialization blocks, perform the steps in the following sections: ■ Assigning a Name and Schedule to Initialization Blocks ■ Selecting and Testing the Data Source and Connection Pool Assigning a Name and Schedule to Initialization Blocks For repository variables, you can specify the day, date, and time for the start date, as well as a refresh interval. To assign a name and schedule to initialization blocks: 1. In the Administration Tool, select Manage, then select Variables. 2. In the Variable Manager dialog, from the Action menu, choose New Repository or Session Initialization Block. 3. In the [Repository|Session] Variable Initialization Block dialog, type a name for the block. The NQ_SYSTEM initialization block name is reserved.

4. Repository initialization blocks only In the Schedule area, select a start date and

time and the refresh interval. 5. Session init blocks only Select the following options when appropriate: – Disabled . If you select this option, the initialization block is disabled. You can also right-click an existing initialization block in the Variable Manager and choose Disable or Enable. This option enables you to change this property without opening the initialization block dialog. – Allow deferred execution . If you select this option, execution of the initialization block is deferred until an associated session variable is accessed for the first time during the session. This option prevents execution of all session variable initialization blocks during the session logon stage, giving a shorter logon time. Session variables that are not needed during the session do not have their initialization blocks executed. This saves the resources which would have been used to execute these unnecessary initialization blocks. The deferred execution of an initialization block also triggers the execution of all unexecuted predecessor initialization blocks. All associated variables of the initialization block and its unexecuted predecessors are updated with the values returned from the deferred execution. Note: The Allow deferred execution option is unavailable in some circumstances. See When Execution of Session Variable Initialization Blocks Cannot Be Deferred for more information. – Required for authentication . If you select this option, this initialization block must succeed for users to log in. In other words, users are denied access to Oracle Business Intelligence if the initialization block fails to execute. Failure to execute can occur if the wrong credentials have been defined in the initialization block, or if there is an error in the default initialization string. Note that this requirement is waived for internal processes like Delivers that use impersonation, if a single user session variable has been associated with Using Variables in the Oracle BI Repository 18-11 the initialization block. In this case, the trusted internal process can connect regardless of whether the initialization block succeeds or fails. The next step is to select the data source and connection pool. Selecting and Testing the Data Source and Connection Pool If you select Database as the data source type for an initialization block, the values returned by the database for the columns in your SQL statement are assigned to variables that you associate with the initialization block. For session variable initialization blocks, you can also select LDAP Server or Custom Authenticator. It is recommended that you create a dedicated connection pool for initialization blocks where you select Database as the data source type. See About Connection Pools for Initialization Blocks for more information. If you select Database as the data source type: ■ If you select Database as the data source type, and do not select the Use OBI EE Server option The SQL statement used to refresh the variable must reference physical tables that can be accessed through the connection pool specified in the Connection Pool field. The tables do not have to be included in the Physical layer of the metadata. At run time, if an initialization string for the database type has been defined, this string is used. Otherwise, the default initialization SQL for the database type is used. You can overtype this string. When you create SQL and submit it directly to the database for example, when using database-specific SQL in initialization blocks, the SQL statement bypasses the Oracle BI Server. The order of the columns in the SQL statement and the order of the variables associated with the initialization block determine which columns are assigned to each variable. You should test this SQL using the Test button in the [Repository|Session] Variable Initialization Block Data Source dialog. If the SQL statement contains an error, the database returns an error message. See Testing Initialization Blocks for more information. ■ If you select Database as the data source type, and select the Use OBI EE Server option The SQL statement you use to refresh the variable might be written for a specific database. However, it will still work with other data sources because the SQL statement is processed by the Oracle BI Server. The Oracle BI Server can also provide functions such as PI that might not be available in the data source, and the SQL statement will work with other data sources supported by the Oracle BI Server for example, ADF, SQL Server, Oracle, and XML files. When you select the Use OBI EE Server option, there is no need for a connection pool, because the SQL statement is sent to the Oracle BI Server and not directly to the underlying database. You can only test this SQL statement using the Test button in the [Repository|Session] Variable Initialization Block Data Source dialog when in online mode. If the SQL statement contains an error, the database returns an error message. See Testing Initialization Blocks for more information. To select a data source and connection pool for initialization blocks: 1. In the Administration Tool, select Manage, then select Variables. 18-12 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition 2. In the Variable Manager dialog, double-click the initialization block you want to edit. You can edit Repository initialization blocks, or Session initialization blocks.

3. Click Edit Data Source next to the Connection Pool field.