Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
x Performance Recommendations
An Oracle Technical Note, 7th Edition
April 2011
Introduction ............................................................................................................................................................. 4 Hardware recommendations for implementing Oracle BI Applications .................................................................. 4 Storage Considerations for Oracle Business Analytics Warehouse................................................................... 5 Introduction..................................................................................................................................................... 5 Shared Storage Impact Benchmarks ............................................................................................................. 5 Conclusion...................................................................................................................................................... 7 Source Tier ......................................................................................................................................................... 7 Oracle BI Enterprise Edition (OBIEE) / ETL Tier ................................................................................................ 7 Review of OBIEE/ETL Tier components ........................................................................................................ 7 Deployment considerations for the ETL components .................................................................................... 7 Target Tier .......................................................................................................................................................... 7 Oracle RDBMS............................................................................................................................................... 7 Oracle Business Analytics Warehouse configuration ............................................................................................. 8 Database configuration parameters ................................................................................................................... 8 ETL impact on amount of generated REDO Logs.............................................................................................. 8 Oracle RDBMS System Statistics....................................................................................................................... 9 Parallel Query configuration ............................................................................................................................... 9 Oracle Business Analytics Warehouse Tablespaces ....................................................................................... 10 Oracle BI Applications Best Practices for Oracle Exadata ................................................................................... 10 Handling BI Applications Indexes in Exadata Warehouse Environment .......................................................... 10 Gather Table Statistics for BI Applications Tables ........................................................................................... 11 Oracle Business Analytics Warehouse Storage Settings in Exadata............................................................... 11 Parallel Query Use in BI Applications on Exadata............................................................................................ 11 Compression Implementation Oracle Business Analytics Warehouse in Exadata .......................................... 12 Exadata Smart Flash Cache............................................................................................................................. 12 Database Parameter File for Analytics Warehouse on Exadata ...................................................................... 12 Informatica configuration for better performance.................................................................................................. 14 Informatica PowerCenter 8.6 32-bit vs. 64-bit .................................................................................................. 14 Informatica Session Logs ................................................................................................................................. 14 Informatica Lookups ......................................................................................................................................... 15 Disabling Lookup Cache for very large Lookups .............................................................................................. 15 Joining Staging Tables to Lookup Tables in Informatica Lookups ................................................................... 16 Informatica Custom Relational Connections for long running mappings.......................................................... 16 Informatica Session Parameters ...................................................................................................................... 17 Commit Interval ............................................................................................................................................ 17 DTM Buffer Size ........................................................................................................................................... 17 Additional Concurrent Pipelines for Lookup Cache Creation ....................................................................... 18 Default Buffer Block Size ............................................................................................................................. 18 Informatica Load: Bulk vs. Normal ................................................................................................................... 18 Informatica Bulk Load: Table Fragmentation ................................................................................................... 18 Use of NULL Ports in Informatica Mappings .................................................................................................... 19 Informatica Parallel Sessions Load on ETL tier................................................................................................ 19 Informatica Load Balancing Implementation .................................................................................................... 20 Bitmap Indexes usage for better queries performance......................................................................................... 20 Introduction ....................................................................................................................................................... 20 DAC properties for handling bitmap indexes during ETL ................................................................................. 20 Bitmap Indexes handling strategies.................................................................................................................. 22 Disabling Indexes with DISTINCT_KEYS = 0 or 1 ........................................................................................... 25
Monitoring and Disabling Unused Indexes ....................................................................................................... 26 Handling Query Indexes during Initial ETL ....................................................................................................... 28 Partitioning guidelines for Large Fact tables......................................................................................................... 29 Introduction ....................................................................................................................................................... 29 Convert to partitioned tables............................................................................................................................. 30 Identify a partitioning key and decide on a partitioning interval .................................................................... 30 Create a partitioned table in Data Warehouse ............................................................................................. 31 Configure Informatica to support partitioned tables ..................................................................................... 34 Configure DAC to support partitioned tables................................................................................................ 34 Unit test the changes for converted partitioned tables in DAC..................................................................... 41 Interval Partitioning ........................................................................................................................................... 41 Informatica Workflows Session partitioning.......................................................................................................... 42 Workflow Session Partitioning for Parallel Writer Updates .............................................................................. 42 Table Compression implementation guidelines .................................................................................................... 44 Guidelines for Oracle optimizer hints usage in ETL mappings ............................................................................. 45 Hash Joins versus Nested Loops in Oracle RDBMS........................................................................................ 45 Suggested hints for Oracle Business Intelligence Applications 7.9.6............................................................... 48 Using Oracle Optimizer Dynamic Sampling for big staging tables ................................................................... 52 Custom Indexes in Oracle EBS for incremental loads performance .................................................................... 53 Introduction ....................................................................................................................................................... 53 Custom OBIEE indexes in EBS 11i and R12 systems ..................................................................................... 53 Custom EBS indexes in EBS 11i source systems............................................................................................ 55 Oracle EBS tables with high transactional load ................................................................................................ 56 Custom EBS indexes on CREATION_DATE in EBS 11i source systems ....................................................... 57 Custom Aggregates for Better Query Performance.............................................................................................. 57 Introduction ....................................................................................................................................................... 57 Database Configuration Requirements for using MVs ..................................................................................... 57 Custom Materialized View Guidelines .............................................................................................................. 58 Integrate MV Refresh in DAC Execution Plan .................................................................................................. 62 Wide tables with over 255 columns performance................................................................................................. 64 Introduction ....................................................................................................................................................... 64 Wide tables structure optimization ................................................................................................................... 64 Oracle BI Applications HIgh Availability ................................................................................................................ 65 Introduction ....................................................................................................................................................... 65 High Availability with Oracle Data Guard and Physical Standby Database ...................................................... 65 Oracle BI Applications ETL Performance Benchmarks ........................................................................................ 67 Oracle BI Applications 7.9.6.1, Siebel CRM 8.0 Adapter.................................................................................. 67 Oracle BI Applications 7.9.6.1, Oracle EBS R12 Projects Adapter .................................................................. 68 Oracle BI Applications 7.9.6.1, Oracle EBS 11i10 Enterprise Sales Adapter................................................... 68 Oracle BI Applications 7.9.6.1, Oracle EBS 11i10 Supply Chain Adapter........................................................ 69 Conclusion ............................................................................................................................................................ 70
INTRODUCTION
Oracle Business Intelligence (BI) Applications Version 7.9.6 delivers a number of adapters to various business applications on Oracle database. 7.9.6.1 version is certified with other major data warehousing platforms. Each Oracle BI Applications implementation requires very careful planning to ensure the best performance both during ETL and web queries or dashboard execution. This article discusses performance topics for Oracle BI Applications 7.9.6 and higher using Informatica PowerCenter 8.6 ETL platform. Note: The document is intended for experienced Oracle BI Administrators, DBAs and Applications implementers. It covers advanced performance tuning techniques in Informatica and Oracle RDBMS, so all recommendations must be carefully verified in a test environment before applied to a production instance. Customers are encouraged to engage Oracle Expert Services to review their configurations prior to implementing the recommendations to their BI Applications environments.
Storage System
Local (PATA, SATA, iSCSI). Local (PATA, SATA, iSCSI), Recommended two or more preferred RAID configuration I/O controllers Oracle BI Enterprise Edition / ETL Tier
4-8 8Gb
8 - 16 8 - 16Gb
16** 16Gb**
Storage Space
100Gb local
200Gb local
400Gb local
* Consider implementing Oracle RAC with multiple nodes to accommodate large numbers of concurrent users accessing web reports and dashboards. ** Consider installing two or more servers on ETL tier and implementing Informatica Load Balancing across all ETL tier servers. Important: It is recommended to set up all Oracle BI Applications tiers in the same local area network. Installation of any of these three tiers over Wide Area Network (WAN) may cause timeouts during ETL mappings execution on the ETL tier.
Oracle positions Exadata solution as fast and efficient hardware for addressing I/O bottlenecks in large volume environments. The internal benchmarks for running Oracle BI Applications on Exadata will be published soon. Shared Storage Impact Benchmarks Sharing storage among heavy I/O processes could easily degrade ETL performance and result in extended ETL runtime. The following benchmarks helped to measure the impact from sharing the same NetApp filer storage between two target databases, concurrently loading data in two parallel ETL executions. Configuration description: Linux servers #1 and #2 have the following configurations: 2 quad-core 1.8 GHz Intel Xeon CPU 32 GB RAM Shared NetApp filer volumes, volume1 and volume2, are mounted as EXT3 file systems: o o Server #1 uses volume1 Server #2 uses volume2
Execution test description: Set record block size for I/O operations to 32k, the recommended db block size in a target database. Execute parallel load using eight child processes to imitate average workload during ETL run. Run the following test scenarios: o Test#1: execute parallel load above on NFS volume1 using Linux server #1; keep Linux server #2 idle. o Test#2: execute parallel load above on both NFS volume1 and volume2 using Linux servers #1 and #2.
The following benchmarks describe performance measurements in KB / sec: Initial Write: write a new file. Rewrite: re-write in an existing file. Read: read an existing file. Re-Read: re-read an existing file. Random Read: read a file with accesses made to random locations in the file. Random Write: write a file with accesses made to random locations in the file. Mixed workload: read and write a file with accesses made to random locations in the file. Reverse Read: read a file backwards. Record Rewrite: write and re-write the same record in a file. Strided Read: read a file with a strided access behavior, for example: read at offset zero for a length of 4 Kbytes, seek 200 Kbytes, read for a length of 4 Kbytes, seek 200 Kbytes and so on.
The test summary: Test Type "Initial write " "Rewrite " "Read " "Re-read " "Reverse Read " "Stride read " "Random read " "Mixed workload " "Random write " "Pwrite " "Pread " Total Time Test #1 46087.10 KB/sec 70104.05 KB/sec 3134220.53 KB/sec 3223637.78 KB/sec 1754192.17 KB/sec 1783300.46 KB/sec 1724525.63 KB/sec 2704878.70 KB/sec 68053.60 KB/sec 45778.21 KB/sec 2837808.30 KB/sec 110 min Test #2 30039.90 KB/sec 30106.25 KB/sec 2078320.83 KB/sec 3038416.45 KB/sec 1765427.92 KB/sec 1795288.49 KB/sec 1755344.27 KB/sec 2456869.82 KB/sec 25367.06 KB/sec 23794.34 KB/sec 2578445.19 KB/sec 216 min
Initial Write, Rewrite, Initial Read, Random Write, and Pwrite (buffered write operation) were impacted the most, while Reverse Read, Stride Read, Random Read, Mixed Workload and Pread (buffered read operation) were impacted the least by the concurrent load. Read operations do not require specific RAID sync-up operations therefore read requests are less dependent on the number of concurrent threads.
Conclusion Make sure you carefully plan for storage deployment, configuration and usage in Oracle BI Applications environment. Avoid sharing the same RAID controller(s) across multiple databases. Set up periodic monitoring of your I/O system during both ETL and end user queries load for any potential bottlenecks.
Source Tier
Oracle BI Applications data loads may cause additional overhead of up to fifteen percent of CPU and memory on a source tier. There might be a bigger impact on the I/O subsystem, especially during full ETL loads. Using several I/O controllers or a hardware RAID controller with multiple I/O channels on the source side would help to minimize the impact on Business Applications during ETL runs and speed up data extraction into a target data warehouse.
Deployment considerations for the ETL components The Informatica server and DAC server should be installed on a dedicated machine for best performance. The Informatica server and DAC server cannot be installed separately on different servers. The Informatica client and DAC client can be located on an ETL Administration client machine, or a Windows server, running Informatica and DAC servers. Informatica and DAC repositories can be deployed as separate schemas in the same database, as Oracle Business Analytics Warehouse, if the target database platform is Oracle, IBM DB2 or Microsoft SQL Server. The Informatica server and DAC server host machine should be physically located near the source data machine to improve network performance.
Target Tier
Oracle RDBMS
Oracle recommends deploying Oracle Business Analytics Warehouse on Oracle RDBMS 64-bit, running under 64-bit Operating System (OS). If 64-bit OS is not available, then consider implementing Very Large Memory (VLM) on Unix / Linux and Address Windowing Extensions (AWE) for Windows 32 bit Platforms. VLM/AWE implementations would increase database address space to allow for more database buffers or a larger indirect data buffer window. Refer to Oracle Metalink for VLM / AWE implementation for your platform.
Note: You cannot use sga_target or db_cache_size parameters if you enable VLM / AWE by setting 'use_indirect_data_buffers = true'. You would have to manually resize all SGA memory components and use db_block_buffers instead of db_cache_size to specify your data cache.
Review an appropriate init.ora template file and follow its guidelines to configure target database parameters specific to your data warehouse tier hardware. Note: init.ora template for Exadata / 11gR2 is provided in Exadata section of this document.
Gb
---------280.49
Important: Execute dbms_stats.gather_system_stats, when the database is not idle. Oracle computes desired system statistics when database is under significant workload. Usually half an hour is sufficient to generate the valid statistic values.
LARGE: 2Tb and higher 150 250Gb > 1.8Tb > 200Gb
Important!!! Make sure you use Locally Managed tablespaces with AUTOALLOCATE clause. DO NOT use UNIFORM extents size, as it may cause excessive space consumption and result in queries slower performance. Use standard (primary) block size for your warehouse tablespaces. DO NOT build your warehouse on non-standard block tablespaces. Note that the INDEX Tablespace may increase if you enable more query indexes in your data warehouse. During incremental loads, by default DAC drops and rebuilds indexes, so you should separate all indexes in a dedicated tablespace and, if you have multiple RAID / IO Controllers, move the INDEX tablespace to a separate controller. You may also consider isolating staging tables (_FS) and target fact tables (_F) on different controllers. Such configuration would help to speed up Target Load (SIL) mappings for fact tables by balancing I/O load on multiple RAID controllers.
ORACLE BI APPLICATIONS BEST PRACTICES FOR ORACLE EXADATA Handling BI Applications Indexes in Exadata Warehouse Environment
Oracle Business Analytic Applications Suite uses two types of indexes: ETL indexes for optimizing ETL performance and ensuring data integrity Query indexes, mostly bitmaps, for end user star queries
Exadata Storage Indexes functionality cannot be considered as unconditional replacement for BI Apps indexes. You can employ storage indexes only in those cases when BI Applications query indexes deliver inferior performance and you ran the comprehensive tests to ensure no regressions for all other queries without the query indexes. Do not drop any ETL indexes, as you may not only impact your ETL performance but also compromise data integrity in your warehouse. The best practices for handling BI Applications indexes in Exadata Warehouse: Turn on Index usage monitoring to identify any unused indexes and drop / disable them in your env. Refer to the corresponding section in the document for more details. Consider pinning the critical target tables in smart flash cache
10
Consider building custom aggregates to pre-aggregate more data and simplify queries performance. Drop selected query indexes and disable them in DAC to use Exadata Storage Indexes / Full Table Scans only after running comprehensive benchmarks and ensuring no impact on any other queries performance.
11
Make sure you benchmark the query performance prior to implementing the changes in your Production environment.
The simple calculation (num_rows * avg_row_len / 8k block size) * ~25% (block overhead) gives ~15M blocks for an uncompressed segment. This segment should be re-compressed reduce its footprint and improve its queries performance. Refer to Table Compression Implementation Guidelines section in this document for additional information on compression for BI Applications Warehouse.
control_files
12
db_block_size
= 8192 # or 16384 (for better compression) = FALSE = TRUE = TRUE = /<DUMP_HOME>/admin/<dbname>/udump = /<DUMP_HOME>/admin/<dbname>/bdump = /<DUMP_HOME>/admin/<dbname>/cdump = 20480 = 1000 = 2000 = 1024 = 100 = 1000 = TYPICAL
cursor_space_for_time open_cursors
= EXACT = FALSE = 500 = 2 = 1 = 2 = true = 45G = 40G = 2G = 100M = AUTO = 16G = FALSE = 1000
= typical
shared_pool_size
log_checkpoints_to_alert
13
INFORMATICA CONFIGURATION FOR BETTER PERFORMANCE Informatica PowerCenter 8.6 32-bit vs. 64-bit
32-bit OS memory can address only 2 ^ 32 bytes, or four gigabytes of RAM, and allow maximum two gigabytes for any application. Oracle BI Applications ETL mappings use complex Informatica transformations such as lookups, cached in memory, and their performance is heavily impacted by data from incremental extracts and high watermark warehousing volumes. Additionally BI Applications ETL execution plans employ parallel mappings execution. So 32-bit ETL tier can quickly exhaust the available memory and end up with very expensive I/O paging and swapping operations, thus causing rather dramatic regression in ETL performance. On the contrast, Informatica 64-bit takes the advantage of more physical RAM for performing complex transformations in memory and eliminating costly disk I/O operations. Informatica PowerCenter 8.6 provides a true 64-bit performance and the ability to scale because no intermediate staging or hashing files on disk are required for processing. The internal BI Applications ETL benchmarks for Informatica 8.6 32-bit vs. 64-bit showed at least two times better throughputs for 64-bit configuration. So, Oracle Business Intelligence Applications customers are strongly encouraged to use Informatica 8.6 64-bit version for Medium and Large environments.
Busy Percentage for a single thread cannot be considered as an absolute measure of performance for a whole mapping. All threads statistics must be reviewed together. Informatica computes it for a single thread in a mapping as follows:
14
Busy Percentage = (Total Run Time Total Idle Time) / Total Run Time If the report log shows high Busy Percentage (> 70 - 80%) for the READER Thread, then you may need to review the mappings Reader Source Qualifier Query for any performance bottlenecks. If the report shows high Busy Percentage (> 60 - 70%) for the TRANSF Thread, then you need to review the detailed transformations execution summary and identify the most expensive transformation. In the example above the transformation mplt_SIL_CustomerLocationUseDimension.Exp_Scd2_Dates consumes 44.2% of all TRANSF runtime, so it may be considered a candidate for investigation. If the report shows high Busy Percentage for the WRITER Thread, it may not necessarily be a performance bottleneck. Depending on the processed data volumes, you may want to turn off Bulk Mode. Refer to the section Informatica Load: Bulk vs. Normal for more details. The log above shows that most probably the mapping is well balanced between Reader and Transformation threads and it keeps Writer busy with inserts.
Informatica Lookups
Too many Informatica Lookups in an Informatica mapping may cause significant performance slowdown. Review the guidelines below for handling Informatica Lookups in Oracle Business Intelligence Applications mappings: Inspect Informatica session logs for the number of lookups, including each lookups percentage runtime.
Check Lookup table row count and Lookup cache row count numbers for each Lookup Transformation. If
Lookup table row count is too high, Informatica will cache a smaller subset in its Lookup Cache. Such lookup could cause significant performance overhead on ETL tier.
If functional logic permits, consider reducing a large lookup row count by adding more constraining predicates to
the lookup query WHERE clause.
If a Reader Source Qualifier query is not a bottleneck in a slow mapping, and the mapping is overloaded with
lookups, consider pushing lookups with row counts less than two million into the Reader SQL as OUTER JOINS. Important: Some lookups could be reusable within a mapping or across multiple mappings, so they cannot be constrained or pushed down into Reader queries. Consult Oracle Development prior to re-writing Oracle Business Intelligence Applications mappings.
If you identify a very large lookup with row count more than 15-20 million, consider pushing it down as an OUTER
JOIN into the mappings Reader Query. Such update would slow down the Reader SQL execution, but it might improve overall mappings performance.
Make sure you test the changes to avoid functional regressions before implementing optimizations in your
production environment.
15
Disabling the lookup cache for heavy lookups will help to avoid excessive paging on the ETL tier. When the lookup cache is disabled, the Integration Service issues a select statement against the lookup source database to retrieve lookup values for each row from the Reader Thread. It would not store any data in its flat files on ETL tier. The issued lookup query uses bind variables, so it is parsed only once in the lookup source database. Disabling lookup cache may work faster for very large lookups under following conditions:
Lookup query must use index access path, otherwise data retrieval would be very expensive on the source lookup database tier. Remember that Informatica would fire the lookup query for every record from its Reader thread. Consider creating an index for all columns, which are used in the lookup query. Then Oracle Optimizer would choose INDEX FAST FULL SCAN to retrieve the lookup values from index blocks rather than scanning the whole table. Check the explain plan for the lookup query to ensure index access path.
Make sure you test the modified mapping with the selected disabled lookups in a test environment and benchmark its performance prior to implementing the change in the production system.
Such change ensured the lookup row count drop from > 22M to 180K and helped to improve the mapping performance. This approach can be applied selectively to both initial and incremental mappings after thorough benchmarks.
16
To speed up such ETL mappings execution, set sort_area_size and hash_area_size to higher values. If you have limited system memory, you can increase only the sort_area_size as sorting operations for aggregate mappings are more memory intensive. Hash joins involving bigger tables can still perform better with smaller hash_area_size. Follow the steps below to create a new Relational Connection with custom session parameters in Informatica: 1. Open Informatica Workflow Manager and navigate to Connections -> Relational -> New 2. Define a new Target connection 'DataWarehouse_Manual_PGA' 3. Use the same values as in DataWarehouse connection 4. Click on Connection Environment SQL and insert the following commands: Repeat the same steps to define another custom Relational connection to your Oracle Source database. alter session set workarea_size_policy = manual; alter session set sort_area_size = 1000000000; alter session set hash_area_size = 2000000000; Each mapping that is a candidate to use the custom Relational connections, should meet the requirements below: The mapping doesnt use heavy transformations on ETL tier The Reader query joins very large tables Its Reader query execution plan uses HASH JOINS
Connect to Informatica Workflow Manager and complete the following steps for each identified mapping: 1. Open a session in Task Developer 2. Click on Mapping tab 3. Select Connections in the left pane 4. Select the defined Custom value for Source or Target connection 5. Save the changes.
17
Additional Concurrent Pipelines for Lookup Cache Creation Additional Concurrent Pipelines for Lookup Cache Creation parameter defines the concurrency for lookup cache creation. Oracle BI Applications Informatica mappings have the default setting 0. You can reduce lookup cache build time by enabling parallel lookup cache creation by setting the value larger than one. Important: Make sure you carefully analyze long running mapping bottlenecks before turning on lookup cache build concurrency in your production environment. Oracle BI Applications execution plans take advantage of parallel workflows execution. Enabling concurrent lookup cache creation may result in additional overhead on a target database and longer execution time. You can consider turning on lookup cache creation concurrency when you have one or two long running mappings, which are overloaded with lookups. Default Buffer Block Size The buffer block size specifies the amount of buffer memory used to move a block of data from the source to the target. Oracle BI Applications Informatica mappings have the default setting 128,000. Avoid using Auto value for Default Buffer Block Size, as it may cause performance regressions for your sessions. The internal tests showed better performance for both Initial and Incremental ETL with Default Buffer Block Size set to 512,000 (512K). You can run the following SQL to update the Buffer Block Size to 512K for all mappings in your Informatica repository: SQL> update opb_cfg_attr set attr_value='512000' where attr_value='128000' and attr_id = 5; SQL> commit; Important: Make sure you test the changes in your development repository and benchmark ETL performance before making changes to your production environment.
18
extents increased rather significantly with commit size going down. The commit size also affected the mapping performance for both Normal and Bulk load; the drop in throughput has been more significant for the latter scenario. The table below shows the number of extents (ext) and throughput (rps) for each tested scenario. Informatica Load type Normal mode Bulk mode 1M commit
80 ext / 34K rps 80 ext / 55.5K rps
100K commit
80 ext / 33K rps 190 ext / 55.5K rps
10K commit
80 ext / 30K rps 200 ext / 37K rps
1K commit
80 ext / 27K rps 960 ext / 8K rps
10 rows commit
80 ext / 14K rps > 5K ext (out of space) / 600 rps
Important!!! To ensure bulk load performance and avoid or minimize target table fragmentation, make sure you set larger commit size in Informatica mappings.
19
2.
Important: Deploying multiple Informatica domains and repository services on different server nodes would cause additional maintenance overhead. Any repository updates or configuration changes, performed on one node, must be replicated across all the participating nodes in the multiple domains configuration. To minimize the overhead from Informatica repositories maintenance, consider the load balancing implementation below: Configure a single Informatica domain and deploy a single PowerCenter Repository service in it. Create Informatica services on each Informatica node and subscribe them to the single domain
20
The following table summarizes the list of parameters, available in DAC 10.1.3.4.1, to handle indexes during ETL runs: Parameter Parameter Values Name Type Effect DAC will drop all indexes on a target table, truncated before a load, and then recreate them after loading the table. It is used mostly in small Execution plans. Initial ETL: Drop/Create Execution Y|N Indices Plan Y all indexes irrespective of any other settings will be dropped and created N - no indexes will be dropped during an initial ETL Default Value
Incremental ETL: Y - indexes with Always Drop & Create (Bitmap) will be dropped during an incremental ETL N - no indexes will be dropped during an incremental ETL Y
DB2/390 customers may want to set it to N. The recommended default value for other platforms is Y, unless you are executing a micro ETL in which case it would be too expensive to drop and create all indexes, so the value should be changed to N. Important: When set to N, this parameter overrides all other index level properties. The property Always Drop and Create is an index specific property, applicable to bitmap indexes only. Always Drop & Create Index Bitmap Y|N Y - a Bitmap index will be dropped prior to an ETL run. N - a Bitmap index will not be dropped in an incremental ETL run only. N/A
The index property Always Drop & Create Bitmap does not override Drop/Create Indices execution plan property if the latter is set to N'. If an index is inactivated in DAC, the index would not be dropped and recreated during subsequent ETL runs. The property applies to Oracle data warehouse platform only. The property Always Drop and Create is an index specific property, applicable to all indexes.
Y|N -
Y an index will be dropped prior to an ETL run. N an index will not be dropped in an incremental ETL run only. N/A
The index property Always Drop & Create does not override Drop/Create Indices execution plan property if the latter is set to N'. If an index is inactivated in DAC, the index would not be dropped and recreated during subsequent ETL runs. ETL | QUERY ETL - an index is required to improve subsequent ETL mappings performance. DAC drops ETL indexes on a table if it truncates the table before the load, or you set Drop/Create Indices, Always Drop and Create Bitmap or Always Drop & N/A Create to True. DAC will re-create the dropped ETL indexes after loading the table, since the indexes will be used to speed up subsequent mappings. Query - an index is required to improve web queries performance.
21
True The DAC server will verify that all indexes defined in the DAC repository are created in the target database. False - DAC will not run any reconciliation checks between its repository and the target database. False
True | False
This parameter is useful when the current execution plan has Drop/Create Indexes set to True, and new indexes have been created in the DAC repository since the last ETL run. This parameter specifies the maximum number of indexes that the DAC server will 1 create in parallel for a single table.
Number
To identify the list of the exposed columns, included into filtering conditions in RPD repository, connect to BI Server Administration Tool and generate the list of dependencies for each column using Query Repository and Related To features. To disable the identified redundant indexes in DAC and drop them in Data Warehouse: Check the Inactive checkbox against the indexes, which should be permanently dropped in the target schema. Rebuild the DAC execution plan. Connect to your target database schema and drop the disabled indexes.
2. Decide whether to drop or keep bitmap indexes during incremental loads. Analyze the total time to build indexes and computing statistics during an incremental run. You can connect to your DAC repository and execute the following queries: SQL> alter session set nls_date_format='DD-MON-YYYY:HH24:MI:SS'; -- Identify your ETL Run and put its format into the subsequent queries: select , || || || ROW_WID, NAME ETL_RUN EXTRACT(DAY FROM (END_TS EXTRACT(HOUR FROM (END_TS EXTRACT(MINUTE FROM (END_TS EXTRACT(SECOND FROM (END_TS START_TS) DAY TO SECOND ) || START_TS) DAY TO SECOND ) || - START_TS) DAY TO SECOND ) || - START_TS) DAY TO SECOND ) || ' ' ' ' days ' hrs ' min ' sec ' PLAN_RUN_TIME
22
from W_ETL_DEFN_RUN order by START_TS DESC; -- Identify your custom Execution Plan Name: SELECT DISTINCT app.row_wid FROM w_etl_defn_run run , w_etl_app app , w_etl_defn_prm prm WHERE prm.etl_defn_wid = run.etl_defn_wid AND prm.app_wid = app.row_wid AND run.row_wid = '<Unique ETL ID from the first query>; -- Indexes build time: SELECT ref_idx.tbl_name table_name , ref_idx.idx_name , sdtl.start_ts start_time , sdtl.end_ts end_time , EXTRACT(DAY FROM(sdtl.end_ts - sdtl.start_ts) DAY TO SECOND) || ' days ' || EXTRACT(HOUR FROM(sdtl.end_ts - sdtl.start_ts) DAY TO SECOND) || ' hrs ' || EXTRACT(MINUTE FROM(sdtl.end_ts - sdtl.start_ts) DAY TO SECOND) || ' min ' || EXTRACT(SECOND FROM(sdtl.end_ts - sdtl.start_ts) DAY TO SECOND) || ' sec' idx_bld_time FROM w_etl_defn_run def , w_etl_run_step stp , w_etl_run_sdtl sdtl , (SELECT ind_ref.obj_wid , ind.name idx_name , tbl.name tbl_name FROM w_etl_index ind , w_etl_obj_ref ind_ref , w_etl_obj_ref tbl_ref , w_etl_table tbl , w_etl_app app WHERE ind_ref.obj_type = 'W_ETL_INDEX' AND ind_ref.soft_del_flg = 'N' AND ind_ref.app_wid = <Your custom Execution Plan Name from the second query> AND ind_ref.obj_wid = ind.row_wid AND tbl_ref.obj_type = 'W_ETL_TABLE' AND tbl_ref.soft_del_flg = 'N' AND tbl_ref.app_wid = <Your custom Execution Plan Name from the second query> AND tbl_ref.obj_wid = tbl.row_wid AND tbl_ref.obj_ref_wid = ind.table_wid AND ind.app_wid = app.row_wid AND ind.inactive_flg = 'N' ) ref_idx WHERE def.row_wid = stp.run_wid AND def.row_wid ='<Unique ETL ID from the first query> AND sdtl.run_step_wid = stp.row_wid AND sdtl.type_cd = 'Create Index' AND sdtl.index_wid = ref_idx.obj_wid -- AND ref_idx.tbl_name = 'W_OPTY_D' ORDER BY sdtl.end_ts - sdtl.start_ts DESC -- Table Stats computing time: select TBL.NAME TABLE_NAME , STP.STEP_NAME , EXTRACT(DAY FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' || EXTRACT(HOUR FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' || EXTRACT(MINUTE FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' || EXTRACT(SECOND FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' TBL_STATS_TIME from W_ETL_DEFN_RUN DEF , W_ETL_RUN_STEP STP , W_ETL_RUN_SDTL SDTL
23
, W_ETL_TABLE TBL where DEF.ROW_WID=STP.RUN_WID and DEF.ROW_WID ='<Unique ETL ID from the first query> and SDTL.RUN_STEP_WID = STP.ROW_WID and SDTL.TYPE_CD = 'Analyze Table' and SDTL.TABLE_WID = TBL.ROW_WID order by SDTL.END_TS - SDTL.START_TS desc; -- Informatica jobs for the selected ETL run: select SDTL.NAME SESSION_NAME SDTL.SUCESS_ROWS STP.FAILED_ROWS SDTL.READ_THRUPUT SDTL.WRITE_THRUPUT , EXTRACT(DAY FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' || EXTRACT(HOUR FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' || EXTRACT(MINUTE FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' || EXTRACT(SECOND FROM (SDTL.END_TS - SDTL.START_TS) DAY TO SECOND ) ||' INFA_RUN_TIME from W_ETL_DEFN_RUN DEF , W_ETL_RUN_STEP STP , W_ETL_RUN_SDTL SDTL where DEF.ROW_WID=STP.RUN_WID and DEF.ROW_WID ='<Unique ETL ID from the first query> and SDTL.RUN_STEP_WID = STP.ROW_WID and SDTL.TYPE_CD = 'Informatica' order by SDTL.END_TS - SDTL.START_TS desc; , , , , If the report shows significant amounts of time to rebuild indexes and compute statistics, and the cumulative incremental load time does not fit into your load window, you can consider two options: Option 1: range partition large fact tables if they show up in the report. Refer to the partitioning sections for more details. Option 2: If the incremental volumes are low, leave bitmap indexes on the reported tables for the next incremental run and then compare the load times. Refer to the next chapter for the implementation. Option 2 is not recommended for fact tables (%_F). It may be used for large dimension tables, which cannot be partitioned effectively by range. Important: Bitmap indexes present on target tables during inserts, updates or deletes could significantly increase the SQL DML execution time. The same SQL would complete much faster if the indexes get dropped prior to the query execution. Alternatively, it would take more time to rebuild the dropped bitmap indexes and compute required statistics. You should measure the cumulative time to run a specific task plus the time to rebuild indexes and compute required database statistics before deciding whether to drop or keep bitmap indexes in place during incremental loads. 3. Configure DAC not to drop selected bitmap indexes during incremental loads. If your benchmarks show that it is less time consuming to leave bitmap indexes in place on large dimension tables during incremental loads and the incremental volumes are relatively small, then you can consider keeping the selected indexes in place during incremental loads. Since the DAC system property Drop and Create Bitmap Indexes Always overrides the index property Always Drop & Create, the system property defines how DAC will handle all bitmap indexes for all containers in the data warehouse schema. To workaround this limitation:
24
Log in into your repository through DAC user interface, click on the Design button under the top menu, and select the Indices tab in the right pane. Click on the Query sub-tab and get the list of all indexes defined on the target table. Check both the check boxes Always Drop & Create and Inactive against the indexes, which should not be dropped during incremental runs. Important: You must uncheck the Inactive checkbox for these indexes before the next initial load; otherwise DAC will not create them after the initial load completion. Since the Inactive property is used both for true inactive indexes and "hidden from incremental load" indexes, the property Always Drop & Create could be used for convenience to distinguish between two different categories.
If you choose to keep some bitmap indexes in place during incremental runs, consider creating the indexes with the storage parameter PCTFREE value to at least 50 or higher. Oracle RDBMS packs bitmap indexes in a data block much more tightly compared to B*Tree indexes. When an update, insert, or delete occurs on table columns with enabled indexes, the bitmap indexes quality will degrade. The higher value of PCTFREE will mitigate the impact to some degree. 4. Additional considerations for handling bitmap indexes during incremental loads. All bitmap indexes should be dropped for transaction fact tables, with over 20 million records, that will have a large volume of data updates and inserts, such as over 0.5 1 percent of total records, during an incremental run. For large tables with a small number of bitmap indexes, consider dropping and recreating the bitmap indexes since the time to rebuild would be short. For large tables with few data updates, the indexes can be enabled during incremental runs without significant performance degradations.
25
-COMMIT;
AND AND AND AND AND AND AND AND AND AND AND AND AND
tbl_ref.soft_del_flg = 'N' tbl_ref.app_wid = '&&APP_ID' tbl_ref.obj_wid = tbl.row_wid tbl_ref.obj_ref_wid = ind.table_wid ind.app_wid = app.row_wid ind.inactive_flg = 'N' all_ind.index_name = ind.name all_ind.table_name = tbl.name all_ind.distinct_keys <= 1 all_ind.uniqueness = 'NONUNIQUE' all_ind.num_rows >= 1 ind.type_cd = 'Query' all_ind.owner = '&&DWH_OWNER');
-- Drop the indexes in the schema: spool drop_dist_indexes.sql SELECT 'DROP INDEX ' || owner|| '.' || index_name || ' ;' FROM all_indexes WHERE distinct_keys <=1 and and uniqueness = 'NONUNIQUE' owner='&&DWH_OWNER'; spool off; -- Execute the spooled SQL file to drop the identified indexes: -- @drop_dist_indexes.sql
2. Create the following scripts on DAC tier in the directory <dac_home>/bifoundation/dac/scripts pre_sql.sql
INSERT INTO myobj_usage SELECT * FROM v$object_usage; COMMIT: EXIT;
pre_etl.bat
<ORACLE_HOME>/bin/sqlplus <dwh_user>/<dwh_pwd>@<dwh_db> @<dac_home>/bifoundation/dac/scripts/pre_sql.sql
3. Set "Script before every ETL" System parameter in DAC to pre_etl.bat. 4. Create a backup copy of <dac_home>/bifoundation/dac/CustomSQLs/CustomSQL.xml 5. Open CustomSQL.xml and replace <SqlQuery name = "ORACLE_CREATE_INDEX">, <SqlQuery name = "ETL_ORACLE_CREATE_INDEX"> and <SqlQuery name = "QUERY_ORACLE_CREATE_INDEX"> sections with:
<SqlQuery name = "ORACLE_CREATE_INDEX"> BEGIN execute immediate 'CREATE %1 INDEX
26
ON (
%2 %3
%4 ) NOLOGGING'; execute immediate 'ALTER INDEx %2 MONITORING USAGE'; END; </SqlQuery> <SqlQuery name = "ETL_ORACLE_CREATE_INDEX"> BEGIN execute immediate 'CREATE %1 INDEX %2 ON %3 ( %4 ) NOLOGGING'; execute immediate 'ALTER INDEX %2 MONITORING USAGE'; END; </SqlQuery> <SqlQuery name = "QUERY_ORACLE_CREATE_INDEX"> BEGIN execute immediate 'CREATE %1 INDEX %2 ON %3 ( %4 ) NOLOGGING PARALLEL'; execute immediate 'ALTER INDEX %2 MONITORING USAGE'; END; </SqlQuery>
6. If you implement index monitoring for the first time after completing ETLs, execute the following PL/SQL block to enable monitoring for all indexes:
DECLARE CURSOR c1 IS SELECT index_name FROM user_indexes WHERE index_name NOT IN (SELECT index_name FROM v$object_usage WHERE MONITORING = 'YES'); BEGIN FOR rec IN c1 LOOP EXECUTE IMMEDIATE 'alter index '||rec.index_name||' monitoring usage'; END LOOP; END;
To query the unused indexes in your data warehouse execute the following SQL:
SELECT DISTINCT index_name FROM myobj_usage WHERE used = 'NO';
Important!!! There are two known cases when optimizer uses indexes but DOES NOT mark as used with Index Usage Monitoring turned on: DML operations against Parent table (such as DELETE or UPDATE), associated with a Child table via the child table Foreign Key (FK) and the FK Normal Index on the Child table, do use the Child table FK index, but Oracle does not report them as used in v$object_usage. Note that BITMAP indexes are correctly flagged as used in the same scenario and reported in v$object_usage.
27
Optimizer may use extended statistics for computing correct table selectivity, using composite indexes, and yet, not report them in v$object_usage. Such case may not be a critical one for BI Analytics warehouse, since it doesnt use composite BITMAP indexes, while composite NORMAL indexes are used on surrogate keys (unique indexes) and critical columns, used in ETL or OBIEE queries.
Make sure you carefully review the reported unused indexes prior to dropping them in the database and disabling in DAC repository. After identifying redundant indexes, disabling them in DAC and dropping in your data warehouse, follow the steps below to turn off index monitoring: 1. Restore <dac_home>/bifoundation/dac/CustomSQLs/CustomSQL.xml from its backup copy. 2. Reset "Script before every ETL" System parameter in DAC 3. Execute the following PL/SQL block to disable index monitoring:
DECLARE CURSOR c1 IS SELECT index_name FROM user_indexes WHERE index_name IN (SELECT index_name FROM v$object_usage WHERE MONITORING = 'YES'); BEGIN FOR rec IN c1 LOOP EXECUTE IMMEDIATE 'alter index '||rec.index_name||' nomonitoring usage'; END LOOP; END;
Important!!! Make sure you monitor the index usage for the extended period of at least 1-2 months before deciding which additional indexes could be disabled in DAC and dropped in your target schema.
28
WHERE
w_etl_table tbl, w_etl_app app ind_ref.obj_type = 'W_ETL_INDEX' AND ind_ref.soft_del_flg = 'N' AND ind_ref.app_wid = :APP_ID AND ind_ref.obj_wid = ind.row_wid AND tbl_ref.obj_type = 'W_ETL_TABLE' AND tbl_ref.soft_del_flg = 'N' AND tbl_ref.app_wid = :APP_ID AND tbl_ref.obj_wid = tbl.row_wid AND tbl_ref.obj_ref_wid = ind.table_wid AND ind.app_wid = app.row_wid AND ind.inactive_flg = 'N' AND ind.isunique = 'N' AND ind.type_cd = 'Query' AND (ind.DRP_CRT_ALWAYS_FLG = 'Y' OR ind.DRP_CRT_BITMAP_FLG = 'Y')
Disable the identified query indexes PRIOR to starting the first ETL run:
SQL> UPDATE w_etl_index SET inactive_flg = 'Y' WHERE row_wid IN (SELECT obj_wid FROM psr_initial_query_idx); SQL> commit;
Execute your first ETL run. Enable all preserved indexes PRIOR to starting the second ETL run:
SQL> UPDATE w_etl_index SET inactive_flg = 'N' WHERE row_wid IN (SELECT obj_wid FROM psr_initial_query_idx); SQL> commit;
Execute your second ETL run. DAC will recreate all disabled query indexes.
29
The proposed partitioning guidelines assume that the majority of incremental ETL volume data (~90%) is new records, which end up in the one or two latest partitions. Depending on the chosen range granularity, you may consider rebuilding local indexes for the most impacted latest partitions: Monthly range: you are advised to maintain two latest partitions, i.e. define index and table actions for PREVIOUS and CURRENT partitions Quarterly range: you may consider maintaining just one, CURRENT partition. Yearly range: you are recommended to maintain only one, CURRENT partition.
The following table summarizes the recommended partitioning keys for some large Oracle BI Applications Fact tables: Area Financials Financials Financials Financials Financials Financials Sales Sales Sales Sales Procurement Table Name W_AP_XACT_F W_AR_XACT_F W_GL_REVN_F W_GL_COGS_F W_TAX_XACT_F W_GL_OTHER_F W_SALES_ORDER_LINE_F W_SALES_PICK_LINE_F W_SALES_INVOICE_LINE_F W_SALES_SCHEDULE_LINE_F W_PURCH_SCHEDULE_LINE_F Partitioning Key POSTED_ON_DT_WID POSTED_ON_DT_WID POSTED_ON_DT_WID POSTED_ON_DT_WID POSTED_ON_DT_WID ACCT_PERIOD_END_DT_WID ORDERED_ON_DT_WID ACT_PICKED_ON_DT_WID INVOICED_ON_DT_WID ORDERED_ON_DT_WID ORDERED_ON_DT_WID
30
Siebel Sales
W_REVN_F
CLOSE_DT_WID
Consider implementing composite range-to-range partitioning for Financials and Projects large fact tables using the following partitioning and sub-partitioning keys: Area Table Name Partitioning Key Sub-partitioning Key
Financials W_GL_LINKAGE_INFORMATION_G DISTRIBUTION_SOURCE POSTED_ON_DT_WID (*) Financials W_GL_BALANCE_F Projects Projects Projects W_PROJ_EXP_LINE_F W_PROJ_COST_LINE_F W_PROJ_REVENUE_LINE_F CHANGED_ON_DT CHANGED_ON_DT CHANGED_ON_DT CHANGED_ON_DT BALANCE_DT_WID EXPENDITURE_DT_WID PROJ_ACCOUNTING_DT_WID GL_ACCOUNTING_DT_WID
(*) Implementing sub-partitioning for W_GL_LINKAGE_INFORMATION_G is recommended only if end users compress inactive sub-partitions with historic data to reclaim space. There are no queries which would benefit from partitioning on POSTED_ON_DT_WID column. Create a partitioned table in Data Warehouse You can pre-create a partitioned table prior to the initial load, or load data into the regular table and then create its partitioned copy and migrate the summarized data. If you have already completed the initial load into a regular table and then decided to partition it, you DO NOT need to re-run the initial load. You can consider two options to convert a table into a partitioned one: (a) create table as select, or (b) create table exchange partition syntax and then split partitions. The internal tests showed that the first option, create table as select, is simpler and faster. The second option would be preferred in high availability data warehouses when you have to carry out partitioning with end users accessing the data. The example below uses the following tables for converting into partitioned objects: W_WRKFC_EVT_MONTH_F - range-partitioning W_PROJ_EXP_LINE_F - composite range-range partitioning.
1. Rename the original table SQL> rename W_WRKFC_EVT_MONTH_F to W_WRKFC_EVT_MONTH_F_ORIG; 2. Create the partitioned table, using range partitioning by year: SQL> create table W_WRKFC_EVT_MONTH_F partition by range (EVENT_YEAR)( partition PART_MIN values less than (2006), partition PART_2006 values less than (2007), partition PART_2007 values less than (2008), partition PART_2008 values less than (2009), partition PART_2009 values less than (2010), partition PART_2010 values less than (2011), partition PART_MAX values less than (maxvalue) ) tablespace BIAPPS_DATA nologging parallel enable row movement as select * from W_WRKFC_EVT_MONTH_F_ORIG;
31
EVENT_YEAR column in the example above uses number(4) precision, so the table partition values are defined using format YYYY. If you choose WID column for a partitioning key, then you have to define your partition ranges using format YYYYMMDD. If you implement composite range-range partitioning, use the following sample syntax: SQL> create table W_PROJ_EXP_LINE_F
partition by range (CHANGED_ON_DT) subpartition by range (EXPENDITURE_DT_WID) (partition PART_MIN values less then (TO_DATE('01-JAN-2008','DD-MON-YYYY')) ( subpartition PART_MIN_MIN values less than (19980000) , subpartition PART_MIN_1998 values less than (19990000) , subpartition PART_MIN_1999 values less than (20010000) , subpartition PART_MIN_2001 values less than (20020000) , subpartition PART_MIN_2002 values less than (20030000) , subpartition PART_MIN_2003 values less than (20040000) , subpartition PART_MIN_2004 values less than (20050000) , subpartition PART_MIN_2005 values less than (20060000) , subpartition PART_MIN_2006 values less than (20070000) , subpartition PART_MIN_2007 values less than (20080000) , subpartition PART_MIN_2008 values less than (20090000) , subpartition PART_MIN_2009 values less than (20100000) , subpartition PART_MIN_MAX values less than (maxvalue) ) , partition PART_200801 values less than (TO_DATE('01-APR-2008','DD-MON-YYYY')) ( subpartition PART_200801_MIN values less than (19980000) , subpartition PART_200801_1998 values less than (19990000) , subpartition PART_200801_1999 values less than (20010000) , subpartition PART_200801_2001 values less than (20020000) , subpartition PART_200801_2002 values less than (20030000) , subpartition PART_200801_2003 values less than (20040000) , subpartition PART_200801_2004 values less than (20050000) , subpartition PART_200801_2005 values less than (20060000) , subpartition PART_200801_2006 values less than (20070000) , subpartition PART_200801_2007 values less than (20080000) , subpartition PART_200801_2008 values less than (20090000) , subpartition PART_200801_2009 values less than (20100000) , subpartition PART_200801_MAX values less than (MAXVALUE) ) ... ... , partition PART_MAX values less than (maxvalue) ( subpartition PART_MAX_MIN values less than (19980000) , subpartition PART_MAX_1998 values less than (19990000) , subpartition PART_MAX_1999 values less than (20010000) , subpartition PART_MAX_2001 values less than (20020000) , subpartition PART_MAX_2002 values less than (20030000) , subpartition PART_MAX_2003 values less than (20040000) , subpartition PART_MAX_2004 values less than (20050000) , subpartition PART_MAX_2005 values less than (20060000) , subpartition PART_MAX_2006 values less than (20070000) , subpartition PART_MAX_2007 values less than (20080000) , subpartition PART_MAX_2008 values less than (20090000) , subpartition PART_MAX_2009 values less than (20100000) , subpartition PART_MAX_MAX values less than (maxvalue) ) ) nologging parallel enable row movement as (select * from W_PROJ_EXP_LINE_F_ORIG);
The composite range-range example uses Quarter for partitioning and Year for sub-partitioning ranges. EXPENDITURE_DT_WID column has number(8) precision, so the table partition values are defined using format YYYYMMDD.
32
Important: You must use the exact format YYYY, YYYYQQ or YYYYMMDD for partitioning by Year, Quarter or Month correspondingly. Make sure you check partitioning column data type prior to partitioning a table. 3. Drop / Rename indexes on renamed table To drop indexes on the renamed table: SQL> spool drop_ind.sql SQL> SELECT 'DROP INDEX '|| INDEX_NAME||';' FROM USER_INDEXES WHERE TABLE_NAME = 'W_WRKFC_EVT_MONTH_F_ORIG'; SQL> spool off SQL> @drop_ind.sql If you want to keep indexes on the original renamed table until successful partitioning conversion completion, then use the following commands: SQL> spool rename_ind.sql SQL> SELECT ALTER INDEX || INDEX_NAME || rename to || INDEX_NAME || _ORIG; FROM USER_INDEXES WHERE TABLE_NAME = W_WRKFC_EVT_MONTH_F_ORIG; SQL> spool off SQL> @rename_ind.sql 4. Create Global and Local indexes. 4.1. Execute the following queries as DAC Repository owner: SQL> spool indexes.sql SQL> SELECT 'CREATE ' ||DECODE(ISUNIQUE,'Y','UNIQUE ') ||DECODE(ISBITMAP,'Y','BITMAP ') ||'INDEX ' ||I.NAME ||CHR(10) ||' ON ' ||T.NAME ||' (' ||MAX(DECODE(POSTN,1,C.NAME||' ASC')) ||CHR(10) ||MAX(DECODE(POSTN,2,' ,'||C.NAME||' ASC')) ||MAX(DECODE(POSTN,3,' ,'||C.NAME||' ASC')) ||MAX(DECODE(POSTN,4,' ,'||C.NAME||' ASC')) ||MAX(DECODE(POSTN,5,' ,'||C.NAME||' ASC')) ||MAX(DECODE(POSTN,6,' ,'||C.NAME||' ASC')) ||MAX(DECODE(POSTN,7,' ,'||C.NAME||' ASC')) ||') tablespace USERS_IDX ' ||CHR(10) ||DECODE(ISUNIQUE,'Y','GLOBAL','LOCAL') ||' NOLOGGING;' FROM W_ETL_TABLE T, W_ETL_INDEX I, W_ETL_INDEX_COL C WHERE T.ROW_WID = I.TABLE_WID AND T.NAME = 'W_WRKFC_EVT_MONTH_F' AND I.ROW_WID = C.INDEX_WID AND I.INACTIVE_FLG = 'N' GROUP BY T.NAME,I.NAME,ISBITMAP,ISUNIQUE; SQL> spool off; The script creates indexes with maximum seven positions. If you have indexes with more than seven column positions, then update modify "MAX(DECODE(POSTN...))" sentence. Run the spooled file indexes.sql in warehouse schema. SQL> @indexes.sql
33
Configure Informatica to support partitioned tables Enable Row Movement Set skip_unusable_indexes = TRUE in DataWarehouse Relational Connection in Informatica Workflow Manager. Open Workflow Manager -> Connections -> Relational -> edit DataWarehouse -> Update Connection Environment SQL: ALTER SESSION SET SKIP_UNUSABLE_INDEXES=TRUE; Configure DAC to support partitioned tables Create new source system parameters Important: This example below shows how to set up rebuilding indexes and maintaining statistics for last two PREVIOUS and CURRENT partitions for range partitioning by year. You should consider implementing PREVIOUS and CURRENT partitions only for monthly or more granular ranges. If you choose quarterly or yearly range, then you can maintain CURRENT partition only. Maintaining PREVIOUS partition for partitioning by a quarter or a year may introduce unnecessary overhead and extend your incremental ETL execution time. Define the following source system parameters: Select Design Menu Click on Source System Parameters tab in the right pane Click New Button and define two new parameters with the following attributes: Name: $$CURRENT_YEAR_WID Data Type: SQL Value (click on checkbox icon to define the following parameters): Logical Data Source: DBConnection_OLAP Enter the following SQL:
SELECT TO_CHAR(ROW_WID) FROM W_YEAR_D WHERE W_CURRENT_CAL_YEAR_CODE = 'Current'
Name: $$PREVIOUS_YEAR_WID Data Type: SQL Value (click on checkbox icon to define the following parameters): Logical Data Source: DBConnection_OLAP Enter the following SQL:
SELECT TO_CHAR(ROW_WID) FROM W_YEAR_D WHERE W_CURRENT_CAL_YEAR_CODE = 'Previous'
Important: Make sure you select the correct Logical Data Source, DBConnection_OLAP, which points to your target data warehouse, when you define these new system parameters. If you choose monthly partitions, then use the following names and values:
34
Name: $$PREVIOUS_MONTH_WID Value: SELECT TO_CHAR(ROW_WID) FROM W_MONTH_D WHERE W_CURRENT_CAL_MONTH_CODE ='Previous' Name: $$CURRENT_MONTH_WID Value: SELECT TO_CHAR(ROW_WID) FROM W_MONTH_D WHERE W_CURRENT_CAL_MONTH_CODE = 'Current' If you choose Quarterly partitions, then use the following names / values: Name: $$PREVIOUS_QTR_WID Value: SELECT TO_CHAR(ROW_WID) FROM W_QTR_D WHERE W_CURRENT_CAL_QTR_CODE = 'Previous' Name: $$CURRENT_QTR_WID Value: SELECT TO_CHAR(ROW_WID) FROM W_QTR_D WHERE W_CURRENT_CAL_QTR_CODE = 'Current' Note: If you need to maintain more than two partitions during the incremental ETLs, then you can create more variables and repeat the steps for them below. For example: Name: $$THIRD_MONTH_WID Value: SELECT TO_CHAR(ROW_WID-1) FROM W_MONTH_D WHERE W_CURRENT_CAL_MONTH_CODE
='Previous'
Update Index Action Framework Create the following Index Actions in DAC Action Framework: 1. Year Partitioning: Disable Local Index Parameter Navigate to Tools -> Seed Data -> Actions -> Index Actions -> New Enter Name: Year Partitioning: Disable Local Index Click on Check Icon in Value field Click on Add button in the new open window Define PREVIOUS_YEAR_WID Local Index SQL: Name: Disable PREVIOUS_YEAR_WID Local Indexes Type: SQL Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
alter index getIndexName() modify partition PART_@DAC_$$PREVIOUS_YEAR_WID unusable
Important!!! Do not use semicolon (;) at the end of SQLs in Text Area. Click Add button to define the second SQL command. Define CURRENT_YEAR_WID Local Index SQL: Name: Disable CURRENT_YEAR_WID Local Index Type: SQL
35
Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
alter index getIndexName() modify partition PART_@DAC_$$CURRENT_YEAR_WID unusable
Note: If you use Quarterly or Monthly partition range, then use PREVIOUS_MONTH_WID / CURRENT_MONTH_WID or PREVIOUS_QTR_WID / CURRENT_QTR_WID in Action names and SQLs. Important!!! If you implement partitioning by Year, Quarter, Month, then you need to define separate actions for each range. 2. Year Partitioning: Enable Local Index Parameter Click New in Index Actions window to create a new parameter Enter Name: Year Partitioning: Enable Local Index Click on Check Icon in Value field Click on Add button in the new open window Define the following two values: Name Enable PREVIOUS_YEAR_WID Local Index Type: SQL Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
alter index getIndexName() rebuild partition PART_@DAC_$$PREVIOUS_YEAR_WID nologging
Name Enable CURRENT_YEAR_WID Local Index Type: SQL Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
alter index getIndexName() rebuild partition PART_@DAC_$$CURRENT_YEAR_WID nologging
Note: If you Quarterly or Monthly partition range, then use PREVIOUS_MONTH_WID / CURRENT_MONTH_WID or PREVIOUS_QTR_WID / CURRENT_QTR_WID in Action names and SQLs. 3. Year Partitioning: Enable Local Sub-Partitioned Index Parameter (for composite partitioning only) Click New in Index Actions window to create a new parameter Enter Name: Year Partitioning: Enable Local Index Click on Check Icon in Value field Click on Add button in the new open window Define the following value:
36
Name Enable Local Sub-partitioned Index Type: Stored Procedure Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
DECLARE CURSOR C1 IS SELECT DISTINCT SUBPARTITION_NAME FROM USER_IND_SUBPARTITIONS WHERE INDEX_NAME='getIndexName()' AND STATUS = 'UNUSABLE'; BEGIN FOR REC IN C1 LOOP EXECUTE IMMEDIATE 'alter index getIndexName() rebuild subpartition '||REC.SUBPARTITION_NAME||''; END LOOP; END
4. Year Partitioning: Create Local Bitmap Index Parameter Click New in Index Actions window to create a new parameter Enter Name: Year Partitioning: Create Local Bitmap Index Click on Check Icon in Value field Click on Add button in the new open window Define the following value: Name Create Local Bitmap Indexes Type: SQL Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
Create bitmap index getIndexName() on getTableName()(getUniqueColumns()) tablespace getTableSpace() local parallel nologging
Save the changes. 5. Year Partitioning: Create Local B-Tree Index Parameter Click New in Index Actions window to create a new parameter Enter Name: Year Partitioning: Create Local B-Tree Index Click on Check Icon in Value field Click on Add button in the new open window Define the following value: Name Create Local B-Tree Index Type: SQL Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
37
Save the changes. 6. Year Partitioning: Create Global Unique Index Parameter Click New in Index Actions window to create a new parameter Enter Name: Year Partitioning: Create Global Unique Index Click on Check Icon in Value field Click on Add button in the new open window Define the following value: Name Create Local B-Tree Indexes Type: SQL Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
Create unique index getIndexName() on getTableName()(getUniqueColumns()) tablespace getTableSpace() global parallel nologging
Save the changes. Update Table Action Framework Create the following Table Action in DAC Action Framework: 1. Year Partitioning: Gather Partition Stats Parameter Navigate to Tools -> Seed Data -> Actions -> Table Actions -> New Enter Name: Year Partitioning: Gather Partition Stats Click on Check Icon in Value field Click on Add button in the new open window Define the following value: Name: Gather Partition Stats Type: Stored Procedure Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
DECLARE CURSOR C1 IS SELECT DISTINCT UTP.PARTITION_NAME FROM USER_IND_PARTITIONS UIP, USER_PART_INDEXES UPI, USER_TAB_PARTITIONS UTP WHERE UIP.INDEX_NAME=UPI.INDEX_NAME AND UIP.STATUS = 'USABLE' AND UTP.TABLE_NAME=UPI.TABLE_NAME AND UTP.PARTITION_POSITION=UIP.PARTITION_POSITION AND UPI.TABLE_NAME = 'getTableName()'
38
AND UTP.PARTITION_NAME IN ('PART_@DAC_$$CURRENT_YEAR_WID','PART_@DAC_$$PREVIOUS_YEAR_WID'); BEGIN FOR REC IN C1 LOOP DBMS_STATS.GATHER_TABLE_STATS( NULL, TABNAME => 'getTableName()', CASCADE => FALSE, PARTNAME => REC.PARTITION_NAME, ESTIMATE_PERCENT => DBMS_STATS.AUTO_SAMPLE_SIZE, GRANULARITY => 'PARTITION', METHOD_OPT => 'FOR ALL INDEXED COLUMNS SIZE AUTO', DEGREE => DBMS_STATS.DEFAULT_DEGREE); END LOOP; END;
Note: If you Quarterly or Monthly partition range, then use PREVIOUS_MONTH_WID / CURRENT_MONTH_WID or PREVIOUS_QTR_WID / CURRENT_QTR_WID in Action names and SQLs. 2. Quarter Composite Partitioning: Gather Partition Stats Parameter (for composite partitioning only) Navigate to Tools -> Seed Data -> Actions -> Table Actions -> New Enter Name: Quarter Composite Partitioning: Gather Partition Stats Click on Check Icon in Value field Click on Add button in the new open window Define the following value: Name: Gather Partition Stats Type: Stored Procedure Database Connection: target Valid Database Platform: ORACLE Enter the following command in the lower right Text Area:
DECLARE CURSOR C1 IS SELECT DISTINCT UTP.PARTITION_NAME FROM USER_IND_PARTITIONS UIP, USER_PART_INDEXES UPI, USER_TAB_PARTITIONS UTP WHERE UIP.INDEX_NAME=UPI.INDEX_NAME AND UIP.STATUS = 'USABLE' AND UTP.TABLE_NAME=UPI.TABLE_NAME AND UTP.PARTITION_POSITION=UIP.PARTITION_POSITION AND UPI.TABLE_NAME = 'getTableName()' AND UTP.PARTITION_NAME IN ('PART_@DAC_$$CURRENT_QTR_WID','PART_@DAC_$$PREVIOUS_QTR_WID'); BEGIN FOR REC IN C1 LOOP DBMS_STATS.GATHER_TABLE_STATS( NULL, TABNAME => 'getTableName()', CASCADE => FALSE, PARTNAME => REC.PARTITION_NAME, ESTIMATE_PERCENT => DBMS_STATS.AUTO_SAMPLE_SIZE, GRANULARITY => 'PARTITION', METHOD_OPT => 'FOR ALL INDEXED COLUMNS SIZE AUTO', DEGREE => DBMS_STATS.DEFAULT_DEGREE); END LOOP;
39
END;
Important!!! DO NOT change Drop / Create Always or Drop / Create Always Bitmap properties for the modified indexes. Un-checking these properties would signal DAC to skip any actions, defined in Index Action Framework. Attach Index Action to the desired indexes Retrieve all local indexes on partitioned tables. Navigate to Design -> Indices -> Query ->Table Name 'W_WRKFC_EVT_MONTH_F', check Is Bitmap checkbox -> Go. Important!!! Make sure you exclude the selected global index from the index query result set. The global index must NOT have any assigned index action tasks. Right click your mouse on the generated list (Upper right pane) and select Add Actions Select Drop Index from Action Type field Select Incremental from Load Type field Click on Checkbox icon in Action field Select Year Partitioning: Disable Local Indexes Action Name Click OK in Choose Action window Click OK in Add Actions window. Right click your mouse on the generated list (Upper right pane) and select Add Actions one more time Select Create Index from Action Type field Select Incremental from Load Type field Click on Checkbox icon in Action field Select Year Partitioning: Enable Local Indexes Action Name Click OK in Choose Action window Click OK in Add Actions window.
The steps above apply to all indexes, retrieved by your query. If you want to attach the defined Index Actions for an individual index, then select the desired index in the right upper pane, and click on Actions sub-tab in the lower pane. Then click New button in the lower pane and fill in the appropriate values in the new line. Repeat the same steps above to attach Year Partitioning: Create Local Bitmap Index, Year Partitioning: Create Local B-Tree Index and Year Partitioning: Create Global Unique Index to the appropriate indexes, used in an initial ETL run.
Important: Make sure you choose Initial from Load Type field, when attaching Year Partitioning: Create Local Bitmap Index, Year Partitioning: Create Local B-Tree Index and Year Partitioning: Create Global Unique Index Index Action Tasks. Even though you select Drop/Create Index Action Type, DAC will override these actions with the steps, defined in Index Action Framework. Every time, DAC encounter Drop Index step for an updated index, it will make it unusable for the last two partitions, and for Create Index rebuild the index for the last two partitions. Attach Table Action to the converted partitioned table Retrieve the partitioned tables. Navigate to Design -> Tables -> Query -> Name 'W_WRKFC_EVT_MONTH_F' -> Go.
40
Right click your mouse on the generated list (Upper right pane) and select Add Actions Select Analyze Table from Action Type field Select Incremental from Load Type field Click on Checkbox icon in Action field Select Year Partitioning: Gather partition stats Action Name Click OK in Choose Action window Click OK in Add Actions window.
Important!!! Make sure you use Quarter Composite Partitioning: Gather Partition Stats parameter for composite range-range tables. If you want to attach the defined Table Action for an individual table, then select the desired table in the right upper pane, and click on Actions sub-tab in the lower pane. Then click New button in the lower pane and fill in the appropriate values in the new line. Whenever DAC encounter Analyze Table step for an updated table, it will override the default action by the set of steps from Table Action Framework. Unit test the changes for converted partitioned tables in DAC You can generate the list of actions for a single task, which populates a partitioned table, to validate the correct sequence of steps without executing them. Follow the steps below to unit test the sequence of steps for a partitioned table: Select Execute button from your top sub-menu Select your execution plan in the upper right pane Click Ordered tasks sub-tab in the lower right pane Retrieve the task which populates your partitioned table Click Unit test button in the lower right pane menu. Click Yes to proceed with unit testing. Validate the generated sequence of steps in the new output window. Important!!! DO NOT execute them in your data warehouse. Exit unit testing window.
Interval Partitioning
Oracle 11G introduced a new partitioning type, Interval Partitioning. Oracle automatically creates new partitions with pre-defined range interval. With Interval Partitioning there is no need to pre-create partitions for data in the future. The majority of recommended partitioning keys in Oracle BI Applications are using DATE format YYYYMMDD. For example, POSTED_ON_WID column is based on monthly range partitions with values less than 20041101, 20041201, 20050101, 20050201, etc. You can specify INTERVAL 100 for such range format. Oracle will skip creating partitions for ranges with no data. In the example with POSTED_ON_WID there is a very large gap between ranges 20041201 and 20050101, so Oracle wouldnt create any partitions in-between. For example, the syntax for creating an interval partitioned table:
41
SQL> create table W_WRKFC_EVT_MONTH_F partition by range (EVENT_YEAR) interval(100) ( partition PART_MIN values less than (19900101)) tablespace BIAPPS_DATA nologging parallel enable row movement as select * from W_WRKFC_EVT_MONTH_F_ORIG; You also need to use the following SQLs to assign to DAC variables: Name: $$PREVIOUS_MONTH_WID Value: SELECT partition_name FROM user_tab_partitions WHERE table_name = 'W_WRKFC_EVT_MONTH_F' AND partition_position = (SELECT MAX(partition_position)-1 FROM user_tab_partitions WHERE table_name = 'W_WRKFC_EVT_MONTH_F'); Name: $$CURRENT_MONTH_WID Value: SELECT partition_name FROM user_tab_partitions WHERE table_name = 'W_WRKFC_EVT_MONTH_F' AND partition_position = (SELECT MAX(partition_position) FROM user_tab_partitions WHERE table_name = 'W_WRKFC_EVT_MONTH_F'); Important!!! Make sure you remove PART_ prefix from partition names in DAC Action Framework scripts above. For example, use @DAC_$$PREVIOUS_MONTH_WID instead of PART_@DAC_$$PREVIOUS_MONTH_WID. Important!!! Oracle creates a new interval partition and partitioned local indexes, as soon as the first record exceeds the last partition range value. So during an ETL, when Oracle creates a new interval partition, you may expect possibly slower mapping performance, as all local indexes on the new partition will be enabled during the run. The impact may not be significant, since the DML operations with local indexes in place will be done only for a single day of incremental data. DAC will kick in its routine to turn off local indexes on the newly created partition during the next incremental ETL.
WRITER_1_*_1> WRT_8043 *****END LOAD SESSION***** WRITER_1_*_1> WRT_8006 Writer run completed. MANAGER> PETL_24031 ***** RUN INFO FOR TGT LOAD ORDER GROUP [1], CONCURRENT SET [1] ***** Thread [READER_1_1_1] created for [the read stage] of partition point [SQ_JOINER] has completed. Total Run Time = [10753.562755] secs Total Idle Time = [5467.169323] secs Busy Percentage = [49.159460]
42
Thread [TRANSF_1_1_1] created for [the transformation stage] of partition point [SQ_JOINER] has completed. Total Run Time = [5758.883913] secs Total Idle Time = [4606.931512] secs Busy Percentage = [20.003050] Thread work time breakdown: Thread [WRITER_1_*_1] created for [the write stage] of partition point [W_CAMP_HIST_F] has completed. Total Run Time = [10696.082997] secs Total Idle Time = [5244.599181] secs Busy Percentage = [50.967105] The Writer shows that all processed rows were updates, and Informatica reported Writer thread Busy Percentage =50%. Small volume updates can be sped up by ensuring indexes on columns in WHERE clause of UPDATE statement. In our example the following UPDATE statement in WRITER should have the index on ROW_WID column:
WRITER WRITER_1_*_1> WRT_8124 Target Table W_CAMP_HIST_F :SQL UPDATE statement: UPDATE W_CAMP_HIST_F SET PARTY_WID = ?, X_LAST_UPD_WID = ? WHERE ROW_WID = ?
Otherwise every single row update would perform Full Table Scan and result in very low throughput of few rows per second. Important!!! Make sure you have the required indexes for your Update transformations to use Index (if possible, Unique) Scans rather than expensive Full Table Scans for each update record. The additional improvements for long running update mappings can be achieved by parallelizing the concurrent updates in the same target table.
Note: No changes need to be done to the table definition in DAC. General recommendations for hash partitioning implementation: 1. When picking the partitioning key, consider using the unique keys, such as ROW_WID, INTEGRATION_ID, etc. If there are no unique keys, choose the column with the largest value of distinct keys.
43
2. Important!!! If there are any indexes on the original staging table, make sure you create them on the hash partitioned table as well. You dont need to create them as global or local; otherwise you would have to use Action Framework for them. 3. Create 4-6 hash partitions at most. Building more hash partitions and corresponding parallel sessions would not make the mapping running faster. The larger number of parallel sessions would increase the load on Informatica tier when building CDC Lookups for each hash partition, as well as Target database tier performing more concurrent updates.
44
b. Older, relatively static partitions can be good compression candidates 7. After compressing a table you need to rebuild all its indexes (ALTER INDEX . REBUILD syntax).
GUIDELINES FOR ORACLE OPTIMIZER HINTS USAGE IN ETL MAPPINGS Hash Joins versus Nested Loops in Oracle RDBMS
Though Oracle optimizer chooses the most efficient plan with the least cost for a query, sometimes database hints can help to improve efficiency and increase overall ETL performance, in spite of the higher estimated query cost, reported in very large volume Oracle Business Analytics Data Warehouses. If tables, used in a query, have indexes defined on the joining columns in a WHERE clause, the optimizer might choose Nested loop join over Hash join accessing a table using an index defined on a column, used in a join. Although this approach may start returning results sooner the overall time to fetch all the records could be considerably longer. Specifying the hint USE_HASH would change the execution plan to use a full table scan (in some cases the optimizer might still use indexes, such as index fast full scan) for a table involved in the query. Initial records fetch may take more time as hash joins are built in memory, but the overall time for fetching all the records would be reduced quite dramatically. Important: Oracle might take up to 8-10 hours just to build hashes in memory for very large tables (over 100 million records), so it is important not to kill the query. ETL is a batch process, measured by overall time to load all the records, so you should avoid using nested loops by incorporating hint USE_HASH for tables with volumes over ten million records. The real life example below provides the comparison between NESTED LOOPS and HASH JOIN execution. The numbers are applicable to the specific test case configuration, which would vary depending on hardware specifications and database settings. Table --------------------PAY_RUN_RESULT_VALUES PAY_RUN_RESULTS PAY_ASSIGNMENT_ACTIONS PAY_INPUT_VALUES_F PAY_ELEMENT_TYPES_F PAY_PAYROLL_ACTIONS PAY_ELEMENT_CLASSIFICATIONS PER_TIME_PERIODS No of Rows ---------900 Million 14 Million 50 Million 10000 10000 1445896 1897 52728
SELECT PAY_ASSIGNMENT_ACTIONS.ASSIGNMENT_ACTION_ID, PAY_ASSIGNMENT_ACTIONS.ASSIGNMENT_ID, PAY_ELEMENT_TYPES_F.INPUT_CURRENCY_CODE, PAY_ELEMENT_TYPES_F.OUTPUT_CURRENCY_CODE, PER_TIME_PERIODS.END_DATE, PER_TIME_PERIODS.START_DATE, PAY_PAYROLL_ACTIONS.PAY_ADVICE_DATE, PAY_PAYROLL_ACTIONS.LAST_UPDATE_DATE, PAY_PAYROLL_ACTIONS.LAST_UPDATED_BY, PAY_PAYROLL_ACTIONS.CREATED_BY, PAY_PAYROLL_ACTIONS.CREATION_DATE, PAY_RUN_RESULT_VALUES.INPUT_VALUE_ID, PAY_RUN_RESULT_VALUES.RUN_RESULT_ID, PAY_RUN_RESULT_VALUES.RESULT_VALUE, PAY_RUN_RESULTS.ELEMENT_TYPE_ID, PAY_INPUT_VALUES_F.LAST_UPDATE_DATE LAST_UPDATE_DATE1, PAY_ELEMENT_TYPES_F.LAST_UPDATE_DATE LAST_UPDATE_DATE2 FROM PAY_RUN_RESULT_VALUES, PAY_RUN_RESULTS, PAY_INPUT_VALUES_F, PAY_ASSIGNMENT_ACTIONS,
45
PAY_ELEMENT_TYPES_F, PAY_PAYROLL_ACTIONS, PAY_ELEMENT_CLASSIFICATIONS, PER_TIME_PERIODS WHERE (PAY_PAYROLL_ACTIONS.LAST_UPDATE_DATE >= TO_DATE('01/01/2007 00:00:00','MM/DD/YYYY HH24:MI:SS') OR PAY_INPUT_VALUES_F.LAST_UPDATE_DATE >= TO_DATE('01/01/2007 00:00:00','MM/DD/YYYY HH24:MI:SS') OR PAY_ELEMENT_TYPES_F.LAST_UPDATE_DATE >= TO_DATE('01/01/2007 00:00:00','MM/DD/YYYY HH24:MI:SS')) AND PAY_PAYROLL_ACTIONS.ACTION_STATUS = 'C' AND PAY_PAYROLL_ACTIONS.ACTION_POPULATION_STATUS = 'C' AND PAY_ASSIGNMENT_ACTIONS.ACTION_STATUS = 'C' AND PAY_INPUT_VALUES_F.UOM = 'M' AND PAY_RUN_RESULT_VALUES.RUN_RESULT_ID = PAY_RUN_RESULTS.RUN_RESULT_ID AND PAY_RUN_RESULT_VALUES.INPUT_VALUE_ID = PAY_INPUT_VALUES_F.INPUT_VALUE_ID AND PAY_RUN_RESULTS.ASSIGNMENT_ACTION_ID = PAY_ASSIGNMENT_ACTIONS.ASSIGNMENT_ACTION_ID AND PAY_RUN_RESULTS.ELEMENT_TYPE_ID = PAY_ELEMENT_TYPES_F.ELEMENT_TYPE_ID AND PAY_ASSIGNMENT_ACTIONS.PAYROLL_ACTION_ID = PAY_PAYROLL_ACTIONS.PAYROLL_ACTION_ID AND PAY_PAYROLL_ACTIONS.EFFECTIVE_DATE BETWEEN PAY_INPUT_VALUES_F.EFFECTIVE_START_DATE AND PAY_INPUT_VALUES_F.EFFECTIVE_END_DATE AND PAY_PAYROLL_ACTIONS.EFFECTIVE_DATE BETWEEN PAY_ELEMENT_TYPES_F.EFFECTIVE_START_DATE AND PAY_ELEMENT_TYPES_F.EFFECTIVE_END_DATE AND PAY_ELEMENT_CLASSIFICATIONS.CLASSIFICATION_ID = PAY_ELEMENT_TYPES_F.CLASSIFICATION_ID AND PER_TIME_PERIODS.TIME_PERIOD_ID = PAY_PAYROLL_ACTIONS.TIME_PERIOD_ID AND PAY_INPUT_VALUES_F.NAME = 'Pay Value' AND CLASSIFICATION_NAME NOT LIKE '%Information%' AND CLASSIFICATION_NAME NOT LIKE '%Employer%' AND CLASSIFICATION_NAME NOT LIKE '%Balance%' AND PAY_RUN_RESULTS.SOURCE_TYPE IN ('I', 'E')
The Explain Plan for the query is below: Plan hash value: 1498624813
Id 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Operation SELECT STATEMENT CONCATENATION NESTED LOOPS HASH JOIN TABLE ACCESS BY INDEX ROWID NESTED LOOPS HASH JOIN TABLE ACCESS FULL MERGE JOIN SORT JOIN HASH JOIN MERGE JOIN SORT JOIN TABLE ACCESS FULL FILTER SORT JOIN TABLE ACCESS FULL TABLE ACCESS FULL FILTER SORT JOIN TABLE ACCESS FULL INDEX RANGE SCAN TABLE ACCESS FULL TABLE ACCESS BY INDEX ROWID INDEX UNIQUE SCAN NESTED LOOPS HASH JOIN NESTED LOOPS NESTED LOOPS NESTED LOOPS NESTED LOOPS NESTED LOOPS Name Rows 60 55 59 PAY_ASSIGNMENT_ACTIONS 7 38937 5503 PAY_ELEMENT_CLASSIFICATIONS 1626 5505 3369 3369 3527 15 PAY_INPUT_VALUES_F 15 PAY_PAYROLL_ACTIONS PER_TIME_PERIODS PAY_ELEMENT_TYPES_F PAY_ASSIGNMENT_ACTIONS_N50 PAY_RUN_RESULTS PAY_RUN_RESULT_VALUES PAY_RUN_RESULT_VALUES_PK 96393 96393 52728 TempS Cost (%CPU) Time pc 14040 111K (2) 00:22:23 Bytes 12870 12980 8064K 147 7604K 961K 47154 806K 355K 355K 292K 675 675 3765K 11M 3765K 1184K 83423 83304 7 47490 9053 13 9039 8931 8930 8579 156 155 8424 7424 349 106 105 3 20007 3 2 19634 19630 19524 14863 8538 6974 6740 (2) (2) (0) (1) (4) (0) (4) (4) (4) (4) (3) (2) 00:16:42 00:16:40 00:00:01 00:09:30 00:01:49 00:00:01 00:01:49 00:01:48 00:01:48 00:01:43 00:00:02 00:00:02
(4) 00:01:42 (5) 00:01:30 (1) 00:00:05 (3) (2) (0) (4) (0) (0) (1) (1) (1) (1) (1) (1) (1) 00:00:02 00:00:02 00:00:01 00:04:01 00:00:01 00:00:01 00:03:56 00:03:56 00:03:55 00:02:59 00:01:43 00:01:24 00:01:21
654 27468 654 27468 35 9986K 190M 1 14 1 4 936 4 820 1460 232K 1552 225K 1579 198K 223 24084 234 19890
46
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 ROWID ROWID
TABLE ACCESS FULL TABLE ACCESS BY INDEX INDEX RANGE SCAN TABLE ACCESS BY INDEX
PAY_INPUT_VALUES_F PAY_PAYROLL_ACTIONS PAY_PAYROLL_ACTIONS_N5 PER_TIME_PERIODS PER_TIME_PERIODS_PK PAY_ASSIGNMENT_ACTIONS PAY_ASSIGNMENT_ACTIONS_N50 PAY_RUN_RESULTS PAY_RUN_RESULTS_N50 PAY_RUN_RESULT_VALUES PAY_RUN_RESULT_VALUES_PK PAY_ELEMENT_TYPES_F PAY_ELEMENT_CLASSIFICATION _S PAY_ELEMENT_CLASSIFICATION _PK
45 9640 23 147 20 14 404K 29 234 205 191 20 31737 27993 3348 2720 630 630 37560 37560 23 147
155 6585 341 1 0 7 3 4 2 3 2 105 1 0 8809 8808 8805 4 8699 7829 7612 7580 156 155 7424 7423 1 0 7 3 2 105 3 2 1 0
(2) 00:00:02 (1) 00:01:20 (1) 00:00:05 (0) 00:00:01 (0) (0) (0) (0) (0) (0) (0) (2) 00:00:01 00:00:01 00:00:01 00:00:01 00:00:01 00:00:01 00:00:01 00:00:02
INDEX UNIQUE SCAN TABLE ACCESS BY INDEX ROWID INDEX RANGE SCAN TABLE ACCESS BY INDEX ROWID INDEX RANGE SCAN TABLE ACCESS BY INDEX ROWID INDEX UNIQUE SCAN TABLE ACCESS FULL INDEX UNIQUE SCAN
TABLE ACCESS BY INDEX ROWID NESTED LOOPS NESTED LOOPS HASH JOIN TABLE ACCESS BY INDEX ROWID NESTED LOOPS NESTED LOOPS NESTED LOOPS MERGE JOIN SORT JOIN TABLE ACCESS FULL FILTER SORT JOIN TABLE ACCESS FULL TABLE ACCESS BY INDEX ROWID INDEX UNIQUE SCAN TABLE ACCESS BY INDEX ROWID INDEX RANGE SCAN INDEX RANGE SCAN TABLE ACCESS FULL TABLE ACCESS BY INDEX ROWID INDEX UNIQUE SCAN TABLE ACCESS BY INDEX ROWID INDEX UNIQUE SCAN
(0) 00:00:01 (0) 00:00:01 (4) (4) (4) (0) (4) (4) (5) (5) (3) (2) 00:01:46 00:01:46 00:01:46 00:00:01 00:01:45 00:01:34 00:01:32 00:01:31 00:00:02 00:00:02
PAY_RUN_RESULTS
PAY_INPUT_VALUES_F PAY_PAYROLL_ACTIONS PER_TIME_PERIODS PER_TIME_PERIODS_PK PAY_ASSIGNMENT_ACTIONS PAY_ASSIGNMENT_ACTIONS_N50 PAY_RUN_RESULTS_N50 PAY_ELEMENT_TYPES_F PAY_RUN_RESULT_VALUES PAY_RUN_RESULT_VALUES_PK PAY_ELEMENT_CLASSIFICATIONS PAY_ELEMENT_CLASSIFICATION_ PK
(5) 00:01:30 (5) 00:01:30 (0) 00:00:01 (0) 00:00:01 (0) 00:00:01 (0) (0) (2) (0) (0) (0) 00:00:01 00:00:01 00:00:02 00:00:01 00:00:01 00:00:01
404K 14 29
(0) 00:00:01
The query took more than 48 hours to execute and produced 128 million records even though the first record was fetched within 1.5 hours of the execution. The reported throughput achieved is 700 RPS. Note: The optimizer chose to access the tables through index paths, and then joined the result sets using Nested Loops. After adding the hint USE_HASH(PAY_RUN_RESULT_VALUES PAY_RUN_RESULTS PAY_INPUT_VALUES_F PAY_ASSIGNMENT_ACTIONS PAY_ELEMENT_TYPES_F PAY_PAYROLL_ACTIONS PAY_ELEMENT_CLASSIFICATIONS PER_TIME_PERIODS) to the preceding query, the optimizer produced the following execution plan: Plan hash value: 3421230164
Id 0 1 2 3 4 5 6 Operation SELECT STATEMENT HASH JOIN HASH JOIN TABLE ACCESS FULL HASH JOIN HASH JOIN HASH JOIN Name Rows 10 10 10 15 103K 1624 1700 Bytes TempSpc 2340 2340 2050 675 15M 231K 204K Cost (%CPU) 932K (5) 932K (5) 932K (5) 155 (2) 932K (5) 167K (3) 166K (3) Time 03:06:29 03:06:29 03:06:28 00:00:02 03:06:27 00:33:28 00:33:23
PAY_INPUT_VALUES_F
47
7 8 9 10 11 12 13 14 15
TABLE ACCESS FULL HASH JOIN HASH JOIN TABLE ACCESS FULL TABLE ACCESS FULL TABLE ACCESS FULL TABLE ACCESS FULL TABLE ACCESS FULL TABLE ACCESS FULL
PAY_ELEMENT_TYPES_F
10527 431K 670K 51M 682K 39M PAY_PAYROLL_ACTIONS 96393 3765K PAY_ASSIGNMENT_ACTIONS 10M 203M PAY_RUN_RESULTS 9986K 190M PER_TIME_PERIODS 52728 1184K PAY_RUN_RESULT_VALUES 912M 11G PAY_ELEMENT_CLASSIFICATIONS 1626 47154
47M 4896K
Even though the estimated cost went up, the query completed much faster. Below is the summary of two executions: Query No Hints (nested loops) Hash Join hint CPU Cost 111K 923K First records Fetch Start Time After 1 hour 30 min After 5 hours Reported Informatica Throughput 700 rows / sec 3000 rows / sec Mapping Execution Time 48 hours 10 hours
SCA, SCM, SDE_ORA_PartyOrganizationDimension Initial OM, PRJ _Customer_Full SCA, SCM, SDE_ORA_PartyOrganizationDimension Incr. OM, PRJ _Customer PRJ FIN, PRJ, SCA, OM FIN, OM, PRJ, SCA SIL_GLAccountDimension_SCDUpdate SDE_ORA_PartyContactStaging SDE_ORA_INVENTORYPRODUCTDIM ENSION_FULL Incr. Incr. Initial
SIL_PartyDimension_Person
Initial
48
Incr. Incr.
EBS Supply Chain 11.5.10 SDE_ORA_PurchaseReceiptFact SDE_ORA_StandardCostGeneral_Full SIL_ExpenseFact_FULL SIL_APInvoiceDistributionFact_Full Initial / Incr. Initial / Incr. Initial Initial /*+ FULL(RCV_TRANSACTIONS) */ /+ USE_HASH(MTL_SYSTEM_ITEMS_B)/ /*+ USE_HASH(W_PROJECT_D) */ /*+ USE_HASH(W_AP_INV_DIST_FS PO_PLANT_LOC PO_RCPT_LOC OPERATING_UNIT_ORG PAYABLES_ORG PURCHASE_ORG W_LEDGER_D INV_TYPE DIST_TYPE SPEND_TYPE APPROVAL_STATUS PAYMENT_STATUS W_AP_TERMS_D W_PROJECT_D EXPENDITURE_ORG CREATED_BY CHANGED_BY W_XACT_SOURCE_D W_Financial_Resource_D W_GL_ACCOUNT_D W_PARTY_D W_SUPPLIER_ACCOUNT_D) */ /*+ FULL(M) */ /*+ USE_HASH(PPV1 PPV2 POR1 POR2 PPEVS1 PPE1 PPE2 PPA2) */ $$HINT1 /*+ USE_HASH(PA_TASKS PA_TASK_TYPES PA_PROJ_ELEMENT_VERSIONS PA_PROJ_ELEMENTS PA_PROJECT_STATUSES PA_PROJ_ELEM_VER_STRUCTURE PA_PROJECTS_ALL PA_PROJECT_TYPES_ALL PA_PROJ_ELEM_VER_SCHEDULE) */ $$HINT2 /*+ USE_HASH(PA_PROJECTS_ALL PA_PROJECT_TYPES_ALL PA_TASKS) */ $$HINT3 /*+ USE_HASH(PE PEV PPS) */ SIL_PRODUCTTRANSACTIONFACT SIL_PURCHASECOSTFACT SIL_APINVOICEDISTRIBUTIONFACT Initial Initial Incr. /*+ USE_HASH(SRC_PRO_D TO_PRO_D) */ /*+ USE_HASH(W_PROJECT_D) */ Apply hint to Lkp_W_AP_INV_DIST_F query: /*+ INDEX(TARGET_TABLE) */ EBS Human Resources R12 SDE_ORA_PayrollFact_Full Initial $$HINT1: /*+ USE_HASH( PAY_RUN_RESULT_VALUES PAY_RUN_RESULTS PAY_INPUT_VALUES_F PAY_ASSIGNMENT_ACTIONS PAY_ELEMENT_TYPES_F PAY_PAYROLL_ACTIONS PAY_ELEMENT_CLASSIFICATIONS PER_TIME_PERIODS ) */ $$HINT2: /*+ ORDERED USE_HASH( PAY_RUN_RESULT_VALUES PAY_RUN_RESULTS PAY_INPUT_VALUES_F PAY_ASSIGNMENT_ACTIONS PAY_ELEMENT_TYPES_F PAY_PAYROLL_ACTIONS PAY_ELEMENT_CLASSIFICATIONS PER_TIME_PERIODS ) */ $$HINT3: /*+ FULL(PER_ALL_ASSIGNMENTS_F) FULL(PER_ALL_PEOPLE_F) */ SDE_ORA_PayrollFact_Agg_Items_Deri Initial ve_Full PLP_RECRUITMENTHIREAGGREGAT E_LOAD PLP_WorkforceEventFact_Month Incr. Initial /*+ parallel(W_PAYROLL_FS,4)*/ $$HINT1: /*+ USE_HASH (FACT MONTH PERF LOC SOURCE AGE EMP)*/ /*+ FULL(suph) */ EBS Financials R12 SDE_ORA_APTransactionFact_Liability Distribution Incr. /*+ parallel(AP_INVOICE_DISTRIBUTIONS_ALL,4) use_hash(AP_INVOICES_ALL AP_INVOICE_DISTRIBUTIONS_ALL
SDE_ORA_BOMHeaderDimension_Full
Initial
49
PO_HEADERS_ALL PO_DISTRIBUTIONS_ALL PO_LINES_ALL)*/ SDE_ORA_Stage_GLJournals_Derive SDE_ORA_CustomerFinancialProfileDi mension SDE_ORA_ARTransactionFact_CreditM emoApplication PLP_APIncrActivityLoad Incr. Initial / Incr. Incr. /*+ PARALLEL (W_ORA_GL_JOURNALS_F_TMP, 4) */ /*+ USE_HASH (HZ_PARTIES)*/ /*+ USE_HASH(AR_PAYMENT_SCHEDULES_ALL RA_CUSTOMER_TRX_ALL RA_CUSTOMER_TRX_ALL1 AR_PAYMENT_SCHEDULES_ALL1 AR_DISTRIBUTIONS_ALL) */ /*+ index(W_AP_XACT_F, W_AP_XACT_F_M1) */ /*+ full(W_GL_ACCOUNT_D) full(W_STATUS_D) full(W_AP_XACT_F) full(W_XACT_TYPE_D) full(D1) full(D2) full( D3)*/ EBS Projects R12 SDE_ORA_ProjectFundingHeader SDE_ORA_ProjectInvoiceLine_Fact SDE_ORA_ProjectCostLine_Fact Initial / Incr. Initial Initial /*+ USE_HASH(PA_PROJECTS_ALL PA_TASKS PA_AGREEMENTS_ALL PA_SUMMARY_PROJECT_FUNDINGS) */ /*+ USE_HASH(pa_draft_invoice_items pa_tasks pa_draft_invoices_all pa_projects_all pa_agreements_all pa_lookups) */ /*+ USE_HASH(pa_cost_distribution_lines_all pa_expenditure_items_all pa_expenditures_all pa_implementations_all pa_implementations_all_1 gl_sets_of_books pa_project_assignments pa_resource_list_members pa_lookups pa_projects_all pa_project_types_all pa_expenditure_types) */ /*+ INDEX(LOOKUP_TABLE W_PARTY_D_M3) */
Incr.
SIL_ProjectFundingHeader_Fact
Incr.
EBS Order Management (Enterprise Sales) 11.5.10 SIL_SalesPickLinesFact_Full SIL_SalesOrderLinesFact_Full SIL_SalesInvoiceLinesFact_Full SIL_SalesScheduleLinesFact_Full Initial Initial Initial Initial /*+ FULL(A18) FULL(A19) FULL(A20) FULL(A21) FULL(A22) */ /*+ FULL(A18) FULL(A19) FULL(A20) FULL(A21) FULL(A22) */ /*+ FULL(A18) FULL(A19) FULL(A20) FULL(A21) FULL(A22) */ /*+ FULL(A18) FULL(A19) FULL(A20) FULL(A21) FULL(A22) */ EBS Service 11.5.10 SDE_ORA_EntitlementDimension SDE_ORA_AgreeDimension SDE_ORA_AbsenceEvent SIL_ActivityFact_Full Initial Initial Initial Initial /*+ parallel(OKC_K_LINES_TL,4) parallel (OKC_K_LINES_B,4) */ /*+ NO_MERGE(fndv) */ /*+ use_hash(per_absence_attendances per_all_assignments_f per_absence_attendance_types per_abs_attendance_reasons ) */ /*+ use_hash(W_ACTIVITY_FS W_FS_ACT_CST_FS W_SOURCE_D W_ENTLMNT_D W_AGREE_D W_REGION_D W_SRVREQ_D W_ASSET_D) */ PSFT HCM 8.9, 9.x SDE_PSFT_UserDimension_PersonalInf Initial ormation SDE_PSFT_SupplierAccountDimension Initial /*+ use_hash(login person address names perdata bus_email alt_email bus_phones cell_phones fax_phones pgr_phones) */ /*+ use_hash(v vaddr vcont vphn) */
You may consider using the recommended hints for the mappings above for other versions only after careful testing and benchmarking ETL runtime and performance. These hints are not included into the packaged mappings. Each mapping may have $$HINT placeholders, defined in DAC. You can consider applying them to your environments after verifying mappings execution with the hints in your test environment. You can manually define $$HINT variables in your DAC and Informatica repositories by following the steps below: Connect to Informatica PowerCenter 8.6 Designer Check out the selected mapping and drag it to Mapplet Designer palette
50
Navigate to Mapplets menu -> Parameters and Variables Click on the Add New Variable icon Fill in the following fields in a new line: o o o o o o Name: $$HINT1, 2, etc. Type: Parameter Datatype: String Precision: make sure you specify the sufficient precision to cover your hint value Click OK Save the changes and check in the mapping into the Informatica repository
Connect to Informatica PowerCenter 8.6 Workflow Manager Check out the corresponding session and drag it to Task Developer palette Open the session Click on Mapping tab and select SQ (SQL Qualifier) under Sources folder in the left pane Click on Select Query attribute value Insert the defined $$HINT? Variable Save the changes Connect to DAC client Select the custom container Click on Design button and select Tasks menu in the right pane Retrieve the task which corresponds to the selected Informatica mapping Click on Parameters menu in the lower pane Fill in the fields in a new line: o o o o o Name: use the exact variable name defined in Informatica above Data Type: Text Load Type: select the load type from the list of values Value: enter the hint value here Save the changes
Verify the changes by inspecting the session log for the select mapping during the next ETL. Important: DAC 10.1.3.4.1 invokes Informatica PowerCenter 8.6 command line API with <lpf> option. Some of the recommended hints can be very long and not fit into a single line. As a result, Informatica may not pick the valid parameter values. If your DAC and Informatica servers share the same machine, you can resolve the issue by implementing the following steps: Connect to your machine, running DAC and Informatica servers Open <DAC_HOME>\Conf\infa_command.xml Replace each occurrence of <-lpf> with <-paramfile> in the configuration file
51
Save the changes Restart DAC server and test the solution.
The last step computes statistics on the table to make sure that Oracle Cost Based Optimizer (CBO) builds the best execution plan for the next task. However, during the initial loads that process very large data volumes, the staging table may become so large (hundreds of millions of rows), that the Analyze Table job would take many hours to complete. Oracle RDBMS offers a faster, yet accurate enough alternative to use dynamic sampling instead of gathering table statistics. The purpose of dynamic sampling is to improve server performance by determining more accurate estimates for predicate selectivity and statistics for tables and indexes. Oracle CBO determines whether a query would benefit from dynamic sampling at the query compile time. Oracle Optimizer would issue a recursive SQL statement to scan a small random sample of the table's blocks, and to apply the relevant single table predicates to estimate selectivity for each predicate. In some cases sample cardinality can also be used to estimate table cardinality. The internal tests, performed on large staging tables, show that optimizer can produce efficient execution plans, utilizing dynamic sampling feature at much shorter time compared to gathering table stats using conventional methods. Below are the details of one of the internal benchmark tests: Hardware configuration: 8 CPU cores x 16Gb RAM x 2Tb NAS server with Linux 64bit OS Target Database: Oracle 10.2.0.3 64bit Test configuration: query involves a large staging table with over 100 Million rows, joined with two smaller dimension tables
Test Scenarios No statistics were collected on the staging table. Computed statistics on the staging table using DBMS_STATS package.
Statistics / Sampling Execution Time Dynamic sampling: 10.6 sec Statistics computing: 53 min 26 sec
The overall run time for the second case was approximately 45 minutes longer compared to the dynamic sampling scenario. The optimizer estimated the identical run time for both cases execution plans. Enabling Dynamic Sampling at the system level may cause additional performance overhead, so it should be selectively applied only to the mappings, which run the queries against the large staging table by inserting Dynamic Sampling hints into the appropriate mapping SQLs. Refer to the publication Oracle Database Performance Tuning Guide (10g Release 2) for more details. Note that the DAC version released with Oracle Business Intelligence Applications Version 7.9.6 does not disable computing statistics at a table level. To workaround this limitation, you can abort the execution plan in DAC, mark the task Analyze Table for your staging table as Completed and restart the Execution Plan.
52
then replace <IDX_TABLESPACE> with APPS_TS_TX_IDX prior to running the DDL. If your source system is EBS 11i release 11.5.9 or lower and it has not been migrated to OATM*, replace <IDX_TABLESPACE> with <PROD>X, where <PROD> is an owner of the table which will be indexed on LAST_UPDATE_DATE column. DDL script for custom index creation:
CREATE index AP.OBIEE_AP_EXP_REP_HEADERS_ALL ON AP.AP_EXPENSE_REPORT_HEADERS_ALL(LAST_UPDATE_DATE) CREATE index AP.OBIEE_AP_INVOICE_PAYMENTS_ALL ON tablespace <IDX_TABLESPACE> ; tablespace <IDX_TABLESPACE> ; AP.AP_INVOICE_PAYMENTS_ALL(LAST_UPDATE_DATE)
CREATE index AP.OBIEE_AP_PAYMENT_SCHEDULES_ALL ON AP.AP_PAYMENT_SCHEDULES_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AP.OBIEE_AP_INVOICES_ALL ON AP.AP_INVOICES_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AP.OBIEE_AP_HOLDS_ALL ON AP.HOLDS_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AP.OBIEE_AP_AE_HEADERS_ALL ON AP.AP_AE_HEADERS_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index CST.OBIEE_CST_COST_TYPES ON CST.CST_COST_TYPES(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index GL.OBIEE_GL_JE_HEADERS ON GL.GL_JE_HEADERS(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ;
53
CREATE index AR.OBIEE_HZ_ORGANIZATION_PROFILES ON AR.HZ_ORGANIZATION_PROFILES(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_CONTACT_POINTS ON AR.HZ_CONTACT_POINTS(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_CUST_SITE_USES_ALL ON AR.HZ_CUST_SITE_USES_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_LOCATIONS ON AR.HZ_LOCATIONS(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_RELATIONSHIPS ON AR.HZ_RELATIONSHIPS(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_CUST_ACCT_SITES_ALL ON AR. HZ_CUST_ACCT_SITES_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_CUST_ACCOUNT_ROLES ON AR.HZ_CUST_ACCOUNT_ROLES(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_PARTY_SITES ON AR.HZ_PARTY_SITES(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_HZ_PERSON_PROFILES ON AR.HZ_PERSON_PROFILES(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index ONT.OBIEE_OE_ORDER_HEADERS_ALL ON ONT.OE_ORDER_HEADERS_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index ONT.OBIEE_OE_ORDER_HOLDS_ALL ON ONT.OE_ORDER_HOLDS_ALL(LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index PER.OBIEE_PAY_INPUT_VALUES_F ON PER.PAY_INPUT_VALUES_F (LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index PER.OBIEE_PAY_ELEMENT_TYPES_F ON PER.PAY_ELEMENT_TYPES_F (LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index PO.OBIEE_RCV_SHIPMENT_LINES ON PO.RCV_SHIPMENT_LINES (LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index PO.OBIEE_RCV_SHIPMENT_HEADERS ON PO.RCV_SHIPMENT_HEADERS (LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index AR.OBIEE_AR_CASH_RECEIPTS_ALL ON AR.AR_CASH_RECEIPTS_ALL (LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index WSH.OBIEE_WSH_DELIVERY_DETAILS ON WSH.WSH_DELIVERY_DETAILS (LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ; CREATE index WSH.OBIEE_WSH_NEW_DELIVERIES ON WSH.WSH_NEW_DELIVERIES (LAST_UPDATE_DATE) tablespace <IDX_TABLESPACE> ;
There is one more custom index, recommended for Supply Chain Analytics on AP_NOTES.SOURCE_OBJECT_ID column:
CREATE index AP.OBIEE_AP_NOTES ON AP.AP_NOTES (SOURCE_OBJECT_ID) tablespace <IDX_TABLESPACE> ;
Important: Make sure you use FND_STATS to compute statistics on the newly created indexes and update statistics on newly indexed table columns in the EBS database. Important: Since all indexes in this section have the prefix OBIEE_ and do not follow standard Oracle EBS Index naming conventions, Autopatch might fail during future upgrades if Oracle EBS introduces indexes on LAST_UPDATE_DATE columns for these tables. In such cases conflicting OBIEE_ indexes should be dropped and Autopatch restarted.
54
then replace <IDX_TABLESPACE> with APPS_TS_TX_IDX prior to running the DDL. If you source system is EBS 11i release 11.5.9 or lower and it has not been migrated to OATM*, replace <IDX_TABLESPACE> with <PROD>X, where <PROD> is an owner of the table which will be indexed on LAST_UPDATE_DATE column. DDL script for custom index creation:
CREATE index PO.RCV_TRANSACTIONS_N23 ON PO.RCV_TRANSACTIONS (LAST_UPDATE_DATE) INITIAL 4K NEXT 2M MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 2 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index PO.PO_DISTRIBUTIONS_N13 ON PO.PO_DISTRIBUTIONS_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 2M MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 2 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index PO.PO_LINE_LOCATIONS_N11 ON PO.PO_LINE_LOCATIONS_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 2M MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 2 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index PO.PO_LINES_N10 ON PO.PO_LINES_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 4K MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 2 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index PO.PO_REQ_DISTRIBUTIONS_N6 ON PO.PO_REQ_DISTRIBUTIONS_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 250K MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 4 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index PO.PO_REQUISITION_LINES_N17 ON PO.PO_REQUISITION_LINES_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 250K MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 4 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index PO.PO_HEADERS_N9 ON PO.PO_HEADERS_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 1M MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 2 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index PO.PO_REQUISITION_HEADERS_N6 ON PO.PO_REQUISITION_HEADERS_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 250K MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 4 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ; CREATE index AR.RA_CUSTOMER_TRX_N14 ON AR.RA_CUSTOMER_TRX_ALL (LAST_UPDATE_DATE) INITIAL 4K NEXT 4M MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 0 INITRANS 4 MAXTRANS 255 PCTFREE 10 tablespace <IDX_TABLESPACE> ;
55
Important: Make sure you use FND_STATS to compute statistics on the newly created indexes and update statistics on newly indexed table columns in the EBS database. Since all custom indexes above follow Oracle EBS index standard naming conventions, any future upgrades would not be affected. *) Oracle Applications Tablespace Model (OATM): Oracle EBS release 11.5.9 and lower uses two tablespaces for each Oracle Applications product, one for the tables and one for the indexes. The old tablespace model standard naming convention for tablespaces is a product's Oracle schema name with the suffixes D for Data tablespaces and X for Index tablespaces. For example, the default tablespaces for Oracle Payables tables and indexes are APD and APX, respectively. Oracle EBS 11.5.10 and R12 use the new Oracle Applications Tablespace Model. OATM uses 12 locally managed tablespaces across all products. Indexes on transaction tables are held in a separate tablespace APPS_TS_TX_IDX, designated for transaction table indexes. Customers running pre-11.5.10 releases can migrate to OATM using OATM Migration utility. Refer to Oracle Metalink Note 248857.1 for more details.
Prod AP AP AP AP AR AR AR AR BOM
Table Name AP_EXPENSE_REPORT_LINES_ALL AP_INVOICE_DISTRIBUTIONS_ALL AP_AE_LINES_ALL AP_PAYMENT_HIST_DISTS AR_PAYMENT_SCHEDULES_ALL AR_RECEIVABLE_APPLICATIONS_ALL RA_CUST_TRX_LINE_GL_DIST_ALL RA_CUSTOMER_TRX_LINES_ALL BOM_COMPONENTS_B
56
BOM_STRUCTURES_B CST_ITEM_COSTS GL_BALANCES GL_DAILY_RATES GL_JE_LINES MTL_MATERIAL_TRANSACTIONS MTL_SYSTEM_ITEMS_B OE_ORDER_LINES_ALL PAY_PAYROLL_ACTIONS RCV_SHIPMENT_LINES
57
Elapsed: 00:02:06.26
58
4 6 8 10 12 14 16 17 18
access("T476739"."ROW_WID"="T631953"."CONSIGNED_TYPE_WID") access(ROWID=ROWID) filter("T476739"."W_XACT_TYPE_CODE"<>'CONSIGNED-CONSUMED') access("T473562"."ROW_WID"="T631953"."SHIPMENT_TYPE_WID") access(ROWID=ROWID) filter("T473562"."W_XACT_TYPE_CODE"<>'PREPAYMENT') access("T257401"."ROW_WID"="T631953"."INVENTORY_PROD_WID") access("T278452"."ROW_WID"="T631953"."CYCLE_STATUS_WID") filter(("T278452"."W_STATUS_CLASS"='PURCH_CYCLE' OR "T278452"."ROW_WID"=0) AND "T278452"."W_SUBSTATUS_CODE"<>'CANCELLED') 19 - access("T31328"."ROW_WID"="T631953"."ORDERED_ON_DT_WID") 22 access("T31328"."PER_NAME_YEAR"='2010'
2. Create a Materialized View. This query can be rewritten to move the aggregation logic into a Materialized View: Note: Consider using the same aliases to physical tables in your MV as in the original physical SQL. CREATE MATERIALIZED VIEW CUST_W_PURCH_SCHED_LINE_F_MV1 BUILD IMMEDIATE REFRESH COMPLETE ENABLE QUERY REWRITE AS SELECT t31328.per_name_year, t31328.CAL_MONTH, t31328.MONTH_NAME, t631953.inventory_prod_wid, t631953.approval_status_wid, t631953.cycle_status_wid, t631953.shipment_type_wid, t631953.consigned_type_wid, t631953.delete_flg, sum(t631953.line_amt) line_amt, sum(t631953.cancelled_amt) cancelled_amt, sum((t631953.line_amt - t631953.cancelled_amt )* t631953.global1_exchange_rate) amt, SUM ( CASE WHEN t263758.w_status_code = 'APPROVED' THEN (t631953.line_amt - t631953.cancelled_amt) * t631953.global1_exchange_rate ELSE 0 END ) AS amt0 FROM w_purch_schedule_line_f t631953, w_day_d t31328, w_status_d t263758 WHERE t631953.ordered_on_dt_wid = t31328.row_wid AND t263758.row_wid = t631953.approval_status_wid GROUP BY t31328.per_name_year, t31328.CAL_MONTH, t31328.MONTH_NAME, t631953.inventory_prod_wid, t631953.approval_status_wid, t631953.cycle_status_wid, t631953.shipment_type_wid, t631953.consigned_type_wid, t631953.delete_flg; / Elapsed: 00:01:17.08 The MV will be populated as soon as you execute CREATE MATERIALIZED VIEW DDL. The subsequent refreshes will be handled via DBMS_MVIEW.MVIEW_REFRESH. Note: Starting from Oracle 10g, query rewrite is now possible when your SELECT statements contain analytic
59
functions, full outer joins, and set operations such as UNION, MINUS or INTERSECT. Important!!! Depending on the logic complexity and data volumes collected in an MV you can consider adding indexes on MV columns for improving MV query performance as well. 3. Compute statistics on each created MV: BEGIN DBMS_STATS.GATHER_TABLE_STATS(USER, 'CUST_W_PURCH_SCHED_LINE_F_MV1', method_opt => 'FOR ALL COLUMNS'); END; / 4. Verify the use of MV and query rewrite in the original physical SQL by re-running the query and checking its plan: Plan hash value: 3197775814
-------------------------------------------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 51 | 7089 | 97151 (1)| 00:29:09 | | 1 | HASH GROUP BY | | 51 | 7089 | 97151 (1)| 00:29:09 | | 2 | NESTED LOOPS | | | | | | | 3 | NESTED LOOPS | | 48291 | 6555K| 97147 (1)| 00:29:09 | |* 4 | HASH JOIN | | 48291 | 4291K| 412 (6)| 00:00:08 | | 5 | VIEW | index$_join$_006 | 108 | 1080 | 3 (34)| 00:00:01 | |* 6 | HASH JOIN | | | | | | | 7 | BITMAP CONVERSION TO ROWIDS | | 108 | 1080 | 1 (0)| 00:00:01 | |* 8 | BITMAP INDEX FULL SCAN | IDX_XACT_TYPE_D | | | | | | 9 | INDEX FAST FULL SCAN | W_XACT_TYPE_D_P1 | 108 | 1080 | 1 (0)| 00:00:01 | |* 10 | HASH JOIN | | 48522 | 3838K| 408 (5)| 00:00:08 | | 11 | VIEW | index$_join$_005 | 108 | 1080 | 3 (34)| 00:00:01 | |* 12 | HASH JOIN | | | | | | | 13 | BITMAP CONVERSION TO ROWIDS| | 108 | 1080 | 1 (0)| 00:00:01 | |* 14 | BITMAP INDEX FULL SCAN | IDX_XACT_TYPE_D | | | | | | 15 | INDEX FAST FULL SCAN | W_XACT_TYPE_D_P1 | 108 | 1080 | 1 (0)| 00:00:01 | |* 16 | HASH JOIN | | 48755 | 3380K| 405 (5)| 00:00:08 | |* 17 | TABLE ACCESS FULL | W_STATUS_D | 5 | 115 | 2 (0)| 00:00:01 | |* 18 | MAT_VIEW REWRITE ACCESS FULL| CUST_W_PURCH_SCHED_LINE_F_MV1 | 112K| 5250K| 401 (5)| 00:00:08 | |* 19 | INDEX UNIQUE SCAN | W_INV_PROD_D_P1 | 1 | | 1 (0)| 00:00:01 | | 20 | TABLE ACCESS BY INDEX ROWID | W_INVENTORY_PRODUCT_D | 1 | 48 | 2 (0)| 00:00:01 | --------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id): -------------------------------------------------4 - access("T476739"."ROW_WID"="CUST_W_PURCH_SCHED_LINE_F_MV1"."CONSIGNED_TYPE_WID") 6 - access(ROWID=ROWID) 8 - filter("T476739"."W_XACT_TYPE_CODE"<>'CONSIGNED-CONSUMED') 10 - access("T473562"."ROW_WID"="CUST_W_PURCH_SCHED_LINE_F_MV1"."SHIPMENT_TYPE_WID") 12 - access(ROWID=ROWID) 14 - filter("T473562"."W_XACT_TYPE_CODE"<>'PREPAYMENT') 16 - access("T278452"."ROW_WID"="CUST_W_PURCH_SCHED_LINE_F_MV1"."CYCLE_STATUS_WID") 17 - filter(("T278452"."W_STATUS_CLASS"='PURCH_CYCLE' OR "T278452"."ROW_WID"=0) AND "T278452"."W_SUBSTATUS_CODE"<>'CANCELLED') 18 - filter("CUST_W_PURCH_SCHED_LINE_F_MV1"."PER_NAME_YEAR"='2010' AND "CUST_W_PURCH_SCHED_LINE_F_MV1"."DELETE_FLG"='N') 19 - access("T257401"."ROW_WID"="CUST_W_PURCH_SCHED_LINE_F_MV1"."INVENTORY_PROD_WID")
Line #18 confirms that optimizer chose the newly created MV in the latest execution plan for the original SQL. 5. Troubleshoot Query Rewrite You can use the DBMS_MVIEW.EXPLAIN_REWRITE procedure to find out why your query failed to rewrite. 1. Create the REWRITE_TABLE table by running the following SQL: SQL> @<ORACLE_HOME>\rdbms\admin\utlxrw.sql REWRITE_TABLE table columns for your reference: STATEMENT_ID MV_OWNER ID for the query MV's schema
60
MV_NAME SEQUENCE QUERY QUERY_BLOCK_NO REWRITTEN_TXT MESSAGE PASS MV_IN_MSG MEASURE_IN_MSG JOIN_BACK_TBL JOIN_BACK_COL ORIGINAL_COST REWRITTEN_COST FLAGS
Name of the MV Seq # of error message User query Block # of the current sub query Rewritten query message EXPLAIN_REWRITE error message Query Rewrite pass # MV in current message Measure in current message Join back table in current message Join back column in current message Cost of original query Cost of rewritten query. It shows a zero if there was no rewrite of a query or if a different materialized view was used Associated flags
2. Execute DBMS_MVIEW.EXPLAIN_REWRITE EXPLAIN_REWRITE procedure provides the details for query rewrite failure, or if it rewrites, which materialized view(s) will be used: BEGIN DBMS_MVIEW.EXPLAIN_REWRITE(QUERY => 'Your query statement', MV => 'Your MV name, STATEMENT_ID => Your statement label); END;
You can use the following query to show EXPLAIN_REWRITE log SELECT FROM WHERE AND sequence, message, original_cost, rewritten_cost REWRITE_TABLE mv_name = 'Your MV name statement_id = Your statement label;
In our example, to check whether optimizer picks CUST_W_PURCH_SCHED_LINE_F_MV1 Materialized View run: SQL> DECLARE 2 QUERY VARCHAR2(4000); 3 MV_NAME VARCHAR2(30) := 'CUST_W_PURCH_SCHED_LINE_F_MV1'; 4 STATEMENT_ID VARCHAR2(30) := 'Test#1 '||User; 5 BEGIN 6 QUERY := 'SELECT SUM(CASE 7 WHEN T263758.W_STATUS_CODE = ''APPROVED'' THEN 8 (T631953.LINE_AMT - T631953.CANCELLED_AMT) * 9 T631953.GLOBAL1_EXCHANGE_RATE 10 ELSE 11 0 12 END) AS c1, 13 T31328.PER_NAME_YEAR AS c2, 14 T31328.CAL_MONTH AS c3, 15 SUBSTR(T31328.MONTH_NAME, 1, 3) AS c5, 16 NVL(T257401.XV_LOB, ''Unknown'') AS c6 17 FROM W_INVENTORY_PRODUCT_D T257401, 18 W_DAY_D T31328,
61
19 W_STATUS_D T263758, 20 W_STATUS_D T278452, 21 W_XACT_TYPE_D T473562, 22 W_XACT_TYPE_D T476739, 23 W_PURCH_SCHEDULE_LINE_F T631953 24 WHERE (T31328.ROW_WID = T631953.ORDERED_ON_DT_WID AND 25 T257401.ROW_WID = T631953.INVENTORY_PROD_WID AND 26 T263758.ROW_WID = T631953.APPROVAL_STATUS_WID AND 27 T278452.ROW_WID = T631953.CYCLE_STATUS_WID AND 28 T473562.ROW_WID = T631953.SHIPMENT_TYPE_WID AND 29 T31328.PER_NAME_YEAR = ''2010'' AND 30 T476739.ROW_WID = T631953.CONSIGNED_TYPE_WID AND 31 T631953.DELETE_FLG = ''N'' AND 32 T278452.W_SUBSTATUS_CODE <> ''CANCELLED'' AND 33 T473562.W_XACT_TYPE_CODE <> ''PREPAYMENT'' AND 34 (T278452.ROW_WID IN (0) OR 35 T278452.W_STATUS_CLASS IN (''PURCH_CYCLE'')) AND 36 T476739.W_XACT_TYPE_CODE <> ''CONSIGNED-CONSUMED'') 37 GROUP BY T31328.CAL_MONTH, 38 T31328.PER_NAME_YEAR, 39 SUBSTR(T31328.MONTH_NAME, 1, 3), 40 NVL(T257401.XV_LOB, ''Unknown'')'; 41 42 DBMS_MVIEW.EXPLAIN_REWRITE(QUERY => QUERY, MV => MV_NAME, STATEMENT_ID => STATEMENT_ID); 43 END; 44 / PL/SQL procedure successfully completed SQL> SQL> SELECT sequence, message, original_cost, rewritten_cost 2 FROM REWRITE_TABLE 3 WHERE mv_name = 'CUST_W_PURCH_SCHED_LINE_F_MV1' 4 AND statement_id = 'Test#1 ' || User 5 /
SEQUENCE --------1 2 MESSAGE ORIGINAL_COST REWRITTEN_COST -------------------------------------------------------------------------------- ------------- -------------QSM-01151: query was rewritten 13 9 QSM-01033: query rewritten with materialized view, CUST_W_PURCH_SCHED_LINE_F_MV1 13 9
The log tells that the query is successfully rewritten with Materialized View CUST_W_PURCH_SCHED_LINE_F_MV1.
Starting with Oracle 10g, you can use a hint, /*+ REWRITE_OR_ERROR */, which will stop the execution of a SQL statement if query rewrite cannot be done: SQL> select /*+ REWRITE_OR_ERROR */ * from dual; select /*+ REWRITE_OR_ERROR */ * from dual ORA-30393: a query block in the statement did not rewrite The most common cause for unsuccessful query rewrite is not matching columns and / or aggregate functions used in MVs. There are other Query Rewrite restrictions, documented in Oracle Database manuals.
62
The following PLSQL call ensures COMPLETE refresh for MV W_PURCH_SCHED_LINE_F_MV1: BEGIN END; DBMS_MVIEW.REFRESH('CUST_W_PURCH_SCHED_LINE_F_MV1', 'C');
Important!!! Make sure you add the call to DBMS_STATS to compute statistics FOR ALL COLUMNS SIZE AUTO on each MV as part of DAC Execution plan customization. If you created any indexes on MV, they will not be dropped / created during MV refresh, so you need to use CASDADE = TRUE to update index statistics as well. The following sections describe step-by-step instructions for integrating MV refresh into DAC Execution Plan. Create Materialized View Refresh Task Action Open DAC Client and navigate to Tools -> Seed Data -> Actions -> Task Actions Click New Button to create a new Task Refresh Materialized View and Click Save to save the record. Click on Check Box icon in Value field to open Value screen Click Add button and enter the following values in the right upper pane: o o o o o
BEGIN
Name: Refresh MV Type: SQL Database Connection: target Table Type: All Target Valid Database Platforms: Oracle
Enter the following text in SQL Statement tab in the right lower pane:
DBMS_MVIEW.REFRESH('getTableName()', 'C');
DBMS_STATS.GATHER_TABLE_STATS(ownname => 'getTableOwner()', tabname=> 'getTableName()', cascade => TRUE, estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO', degree => DBMS_STATS.DEFAULT_DEGREE); END;
Note: If there are no indexes defined on an MV, then you dont need DBMS_STATS call in the SQL Statement, as DAC will compute its statistics but use CASCADE => FALSE. Click OK to save the changes.
Register Materialized Views Click Design Button -> Table tab in the right pan Click New -> Define your custom MV as a table in DAC Save changes.
Define Related Tables Search for your Fact or Aggregate table, you used in your MV query definition (W_PURCH_SCHEDULE_LINE_F in our example, in the Tables View. Click Related Tables Tab in the lower right pane and add your MV as the related table to the original Fact.
63
Rebuild Execution Plan Reassemble your Subject Areas and rebuild your Execution plan to pick the new dependencies. Refer to BI Apps Administration Guide, chapter "Customizing DAC Objects and Designing Subject Areas" for more details.
Depending on the queries complexity the amount of physical reads also could be much higher for wide tables with more than 255 columns. The described limitation would have critical impact on Oracle BI Applications Dashboards performance.
64
The time to execute periodic incremental loads depends on a number of factors, such as number of source databases, each source database incremental volume, hardware specifications, environment configuration, etc. As the result, incremental loads may not always complete within a predefined blackout window and cause extended downtime. Global businesses, operating 24 hours around oclock not always could afford few hours downtime. Such customers can consider implementing high availability solution using Oracle Data Guard with a physical Standby database.
High Availability with Oracle Data Guard and Physical Standby Database
Oracle Data Guard configuration contains a primary database and supports up to nine standby databases. A standby database is a copy of a production database, created from its backup. There are two types of standby databases, physical and logical. A physical standby database must be physically identical to its primary database on a block-for-block basis. Data Guard synchronizes a physical standby database with its primary one by applying the primary database redo logs. The standby database must be kept in recovery mode for Redo Apply. The standby database can be opened in read-only mode in-between redo synchronizations. The advantage of a physical standby database is that Data Guard applies the changes very fast using low-level mechanisms and bypassing SQL layers. A logical standby database is created as a copy of a primary database, but it later can be altered to a different structure. Data Guard synchronizes a logical standby database by transforming the data from the primary database redo logs into SQLs and executing them in the standby database. A logical standby database has to be open all the times to allow Data Guard to perform SQL updates. Important: A primary database must run in ARCHIVELOG mode all the times. Data Guard with Physical Standby Database option provides both efficient and comprehensive disaster recovery as well as reliable high availability solution to Oracle BI Applications customers. Redo Apply for Physical Standby option synchronizes a Standby Database much faster compared to SQL Apply for Logical Standby. OBIEE does not require write access to BI Applications Data Warehouse for either executing end user logical SQL queries or developing additional contents in RPD or Web Catalog. The internal benchmarks on a low-range outdated hardware have showed four times faster Redo Apply on a physical standby database compared to ETL execution on a primary database: Step Name SDE_ORA_SalesProductDimension_Full SDE_ORA_CustomerLocationDimension_Full SDE_ORA_SalesOrderLinesFact_Full W_SALES_ORDER_LINE_F_U1 Index Row Count 2621803 4221350 22611530 Redo Size 621 Mb 911 Mb 12791 Mb 610 Mb ETL SQL time on Primary DB 01:59:31 04:11:07 09:17:19 00:24:31 Redo Apply time 00:10:20 00:16:35 03:16:04 00:08:23
65
The target hardware was configured intentionally on a low-range Sun server, with both Primary and Standby databases deployed on the same server, to imitate heavy incremental load. The modern production systems with primary and standby database, deployed on separate servers, are expected to deliver up to 8-10 times better Redo Apply time on a physical standby database, compared to the ETL execution time on the primary database. The diagram below describes Data Guard configuration with Physical Standby database: The primary instance runs in FORCE LOGGING mode and serves as a target database for routine incremental ETL or any maintenance activities such as patching or upgrade. The Physical Standby instance runs in read-only mode during ETL execution on the Primary database. When the incremental ETL load into the Primary database is over, DBA schedules the downtime or blackout window on the Standby database for applying redo logs. DBA shuts down OBIEE tier and switches the Physical Standby database into RECOVERY mode. DBA starts Redo Apply in Data Guard to apply the generated redo logs to the Physical Standby Database. DBA opens Physical Standby Database in read-only mode and starts OBIEE tier: SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; SQL> ALTER DATABASE OPEN;
66
Easy-to-manage switchover and failover capabilities in Oracle Data Guard allow quick role reversals between primary and standby, so customers can consider switching OBIEE from the Standby to Primary, and then start applying redo logs to the Standby instance. In such configuration the downtime can be minimized to two short switchovers: Switch OBIEE from Standby to Primary after ETL completion into Primary database, and before starting Redo Apply into Standby database. Switch OBIEE from Primary to Standby before starting another ETL.
Additional considerations for deploying Oracle Data Guard with Physical Standby for Oracle BI Applications: 1. FORCE LOGGING mode would increase the incremental load time into a Primary database, since Oracle would logging index rebuild DDL queries. 2. Primary database has to be running in ARCHIVELOG mode to capture all REDO changes. 3. Such deployment results in more complex configuration; it also requires additional hardware to keep two large volume databases and store daily archived logs. However it offers these benefits: 1. High Availability Solution to Oracle BI Applications Data Warehouse 2. Disaster recovery and complete data protection 3. Reliable backup solution
Source IBM 9117-570 8 x 1.9 GHz 64Gb Target IBM 9117-570 8 x 1.9 GHz 64Gb ETL IBM 9115-505 4 x 1.6 GHz 8Gb
IBM AIX 5.3 Siebel CRM 8.0 / Oracle 10.2.0.4 64-bit IBM AIX 5.3 Oracle 11.1.0.7 64-bit
500Gb Local HDD IBM AIX 5.3 Informatica 8.6 SP4 / OBIEE 10.1.3.4
ETL Load type: Full Load of two years of historic data. ETL run time: 11 hours 26 min The following table contains the execution details for the longest mappings in the full ETL run: Session Name SDE_PartyPersonDimension SIL_ResponseFact_Full Run Time 2:01:37 1:57:28 Success Rows Read Write Throughput, Throughput, rows / sec rows / sec 21294734 3943 4480 32245373 4594 5746
67
SIL_PartyPersonDimension_Full SDE_ResponseFact SIL_PartyPersonDimension_UpdateCampaignOfferInfo SIL_ActivityFact_Full SDE_ResponseDimension SIL_ResponseDimension_Full SDE_ActivityFact SIL_PartyDimension_Person SIL_RevenueFact_Full SIL_PersonFact_Full SIL_CampaignHistoryFact_Full
1:21:29 0:54:44 0:53:20 0:52:16 0:48:25 0:46:11 0:45:03 0:44:28 0:42:20 0:42:12 0:37:45
21294735 32245373 4109910 10505208 32271503 32271504 10505208 21294734 5626059 9151737 10490109
4657 10334 1416 3395 11753 11909 3948 8100 2251 3671 4711
4696 11959 1397 4426 12509 12318 4728 9877 2923 6740 5867
16 x 900Mhz UltraSparc 16Tb NetApp Network 32Gb II CPUs Attached Storage (NAS) 16Gb 2Tb Netapp NAS Storage 4Gb 200Gb Local HDD
Sun Solaris Oracle EBS R12 / Oracle 9 10.2.0.3 64-bit Windows 2003 Windows 2003 Oracle 11.1.0.7 64-bit Informatica 8.6 SP4 / OBIEE 10.1.3.4
Dell 2 x quad-core 3.6 Ghz PE6850 Intel Xeon CPUs Dell 2 x dual-core 3.4 Ghz PE2850 Intel Xeon CPUs
ETL Load type: Full Load of seven years of historic data. The following table contains the execution details for the longest Projects mappings in the full ETL run: Session Name SIL_ProjectCostLine_Fact SIL_ProjectExpLine_Fact SIL_ProjectRevenueLine_Fact SDE_ORA_ProjectRevenueLine SDE_ORA_ProjectCostLine SDE_ORA_ProjectExpLine SIL_ProjectTaskDimension SIL_ProjectRevenueHdr_Fact_Full SDE_ORA_ProjectInvoiceLine_Fact SDE_ORA_Project_Tasks Run Time 24:31:59 14:21:31 11:51:12 8:16:54 7:40:36 4:38:22 1:08:45 0:56:05 0:54:16 0:38:44 Success Rows Read Write Throughput, Throughput, rows / sec rows / sec 128723375 1459 1496 117891397 2283 2363 68597993 1609 1685 68648978 2339 2884 129439913 4690 7102 117918424 7074 7161 7187362 1757 1783 1740225 523 1697 3076049 955 957 7187362 3142 7704
68
Source
Sun E6500
16 x 400Mhz UltraSparc 16Tb NetApp Network 20Gb II CPUs Attached Storage (NAS)
Sun Solaris Oracle EBS R12 / Oracle 9 10.2.0.3 64-bit Oracle 11.1.0.7 64-bit / Linux Informatica 8.6 SP4 / RedHat 3.4 OBIEE 10.1.3.4
Target Dell 2 x quad-core 1.86 Ghz 16Gb 1Tb Netapp NAS Storage & ETL PE2950 Intel Xeon CPUs
ETL Load type: Full Load of seven years of historic data. The following table contains the execution details for the longest Sales mappings in the full ETL run: Session Name SIL_SalesInvoiceLinesFact_Full SIL_SalesOrderLinesFact_Full SIL_SalesScheduleLinesFact_Full SDE_ORA_SalesInvoiceLinesFact_Full SDE_ORA_SalesOrderLinesFact_Full PLP_SalesCycleLinesFact_Load_Full SDE_ORA_SalesScheduleLinesFact_Full SIL_SalesBookingLinesFact_Load_OrderLine_Debt PLP_SalesOrderLinesFact_RollupAmt_Update_Full SDE_ORA_SalesPickLinesFact_Full SIL_SalesPickLinesFact_Full PLP_SalesOrderLinesAggregate_Load_Full PLP_SalesInvoiceLinesAggregate_Load_Full SDE_ORA_SalesProductDimension_Full SDE_ORA_SalesCycleLinesFact_HoldDurationExtract SIL_SalesProductDimension_Full Run Time 9:50:02 8:45:51 8:45:08 7:44:06 5:52:47 4:17:19 4:04:34 3:08:54 2:48:34 2:43:05 1:42:34 2:11:12 1:40:52 1:06:16 0:48:23 0:22:17 Success Rows Read Write Throughput, Throughput, rows / sec rows / sec 61076675 1729 3357 44797448 1423 2194 44912891 1428 2204 61076675 2194 2494 44797448 2130 2482 44797448 2910 5363 44912891 3071 3397 44797448 3967 3968 4377020 521 471 6101903 627 783 6101903 997 1494 7128617 911 5690 2519900 419 8630 2620885 664 665 2246234 978 74875 2620886 2186 2170
16 x 400Mhz UltraSparc 16Tb NetApp Network 20Gb II CPUs Attached Storage (NAS)
Sun Solaris Oracle EBS R12 / Oracle 9 10.2.0.3 64-bit Oracle 11.1.0.7 64-bit / Linux Informatica 8.6 SP4 / RedHat 3.4 OBIEE 10.1.3.4
Target Dell 2 x quad-core 1.86 Ghz 16Gb 1Tb Netapp NAS Storage & ETL PE2950 Intel Xeon CPUs
ETL Load type: Full Load of seven years of historic data. The following table contains the execution details for the longest Supply Chain mappings in the full ETL run: Session Name SIL_APInvoiceDistributionFact_Full Run Time 9:40:13 Success Rows Read Write Throughput, Throughput, rows / sec rows / sec 82351451 2371 2464
69
SDE_ORA_APInvoiceDistributionFact_Full SDE_ORA_EmployeeExpenseFact_Full SIL_ExpenseFact_Full SIL_ProductTransactionFact_Full SDE_ORA_ProductTransactionFact_Full SDE_ORA_PartyContactStaging_Full SDE_ORA_PurchaseReceiptFact_Full SDE_ORA_CustomerLocationDimension_Full SDE_ORA_InventoryProductDimension_Full SIL_PurchaseCostFact_Full SDE_ORA_CustomerFinancialProfileDimension_Full SIL_PurchaseScheduleLinesFact_Full SDE_ORA_PurchaseCostFact_Full SIL_PurchaseOrderFact_Full SDE_ORA_PurchaseRequisitionLinesFact_Full SIL_RequisitionLinesCostFact_Full SDE_ORA_PurchaseScheduleLinesFact_Full SDE_ORA_RequisitionLinesCostFact_Full SDE_ORA_PurchaseOrderFact_Full SIL_InventoryProductDimension_Full SIL_PurchaseRequisitionLinesFact_Full SIL_CustomerFinancialProfileDimension_Full SIL_PurchaseReceiptFact_Full
7:55:10 5:17:33 5:12:05 4:37:47 4:20:57 3:06:30 1:58:32 1:32:53 1:31:25 1:17:32 1:09:07 0:59:24 0:52:47 0:52:18 0:37:10 0:31:15 0:30:13 0:26:31 0:26:14 0:22:42 0:19:19 0:18:52 0:18:25
82351451 40789178 40789180 19955307 19955307 27123133 3147105 4224659 5241770 2922581 4678902 2837469 2922581 2859692 2520984 2581337 2837469 2581337 2859692 2620886 2520984 2855450 3147105
2894 2145 2189 1202 1280 2439 450 761 5553 632 1309 803 931 923 1145 1410 1586 1663 1868 1976 2257 2640 2953
4063 2394 2500 1985 3531 8032 2565 915 6138 806 1775 941 1400 1216 1970 1980 2395 2934 2449 2143 2697 2684 3470
CONCLUSION
This document consolidates the best practices and recommendations for improving performance for Oracle Business Intelligence Applications Version 7.9.6.This list of areas for performance improvements is not complete. If you observe any performance issues with your Oracle BI Applications implementation, make sure you trace various components, and carefully benchmark any recommendations or solutions discussed in this article or other sources, before implementing the changes in the production environment.
70
Oracle Business Intelligence Applications Version 7.9.6.x Performance Recommendations April 2011
Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: Phone: +1.650.506.7000 Fax: +1.650.506.7200 oracle.com Copyright 2011, Oracle. All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
71