OBIEE - Aggregate Tables
OBIEE - Aggregate Tables
Aggregate Persistence wizard will generate a logical script, which creates aggregate tables in data source and creates corresponding objects in the repository. Instead of creating Aggregate tables and mapping them in repository manually we can run APW, which automates the aggregate process. Prerequisites to create Aggregate Persistence Wizard (APW): 1. The repository must be in online [The server creates scripts to run APW; to connect to the server the connection pool must be enabled, so the RPD must be in online mode]. 2. Repository should have a password. 3. There should be a valid Time Dimensional hierarchy. 4. There should be a valid measure column Ex: Revenue. Aggregate tables are created only on Fact table measure columns. [Measure Column: A column on which aggregation will apply] Steps: Creating Aggregate Tables Tools > Utilities > Aggregate Persistence Wizard Check the Generate DDL File option Specify a file and location where the output script should be saved [Make sure the script should be saved in repository folder] Save it with .sql extension, select Next Select Business model and select fact tables related to that B. model [only fact tables are displayed] Expand Fact table, select the measure columns on which you are creating aggregate tables [only measure columns will be displayed for all fact tables], Select Next
Select the Database, Schema, Connection pool and the name of the Aggregate table.
Dont close the Admin tool until the APW completed. Go to the repository folder and check the Aggregate file which we created. To run this we need to run a batch file Create Batch file Logical script generates logical query which understands only BI Server. Data source will understand Physical queries. To convert the logical script to physical script we need to run the above command. Open a new Note pad and write the below script (script is case sensitive), save it as .bat file in any location. nqcmd d AnalyticsWeb -u Administrator -p Administrator -s c:\OracleBI\Server\Repository\Agg.sql nqcmd Oracle BI Server Command utility -d The Data source name [we can find the data source name on top of the rpd when it is opened in online mode or we can check in instanceconfig.xml file] -u User name of the repository -p Password of the repository -s Source of the SQL file Run the batch file in command prompt or we can double click the batch file. If we run in command prompt we can see the script status whether it is failed or succeed. Note: Aggregate script is a static/snapshot, which means whenever there is an update in Database it will stay what it is, it will not update. So we need to run batch file whenever there is an update.
Aggregate Navigation: Depending on the dimension column that you selected in the query the BI Server will decide which table to hit for fetching (Detailed table or Aggregate table). Ex: if the Aggregate table is in month level and Detailed table in Day level. If the report needs month level data then BI Server retrieves data from Aggregate table. Q: How the BI Server knows to hit Aggregate table or detailed table? Ans: In the LTS of Aggregate table go to Content tab, in that we can see the Logical level, with this the BI server knows to hit aggregate or detailed table.
Q: I have a day level time table and I have created month level aggregate table on sales table, can I join these tables by default? Ans: We cant join; we need to get the both tables into same level to join the tables. Better to bring Time table to month level and join to aggregate table. Q: I have 3 reports Month, Quarter and Year; when I pull the data I am getting data after very long time, what kind of performance tuning we can do? Ans: We can create Aggregate tables, we have to create aggregate table at month level. When we have month level data it can made into Quarter and Year level, so one aggregate table is enough. If we create 3 aggregate tables Month level, Quarter level and Year level, then we need to have space and also more number of joins. Performance will be degraded. Q: What are Aggregate Properties? Q: What are the Advantages of Aggregate tables?