Data Warehousing Guide - Oracle

[Pages:36]Oracle? Database

Data Warehousing Guide

21c

F31840-10 February 2022

Oracle Database Data Warehousing Guide, 21c

F31840-10

Copyright ? 2001, 2022, Oracle and/or its affiliates.

Primary Author: Padmaja Potineni

Contributors: Hermann Baer, Mark Bauer, Subhransu Basu, Nigel Bayliss, Donna Carver, Maria Colgan, Benoit Dageville, Luping Ding, Bud Endress, Bruce Golbus, John Haydu, Keith Laker, Paul Lane, Chun-Chieh Lin, William Lee, George Lumpkin, David McDermid, Alex Melidis, Valarie Moore, Ananth Raghavan, Jack Raitto, Andy Rivenes, Lei Sheng, Wayne Smith, Sankar Subramanian, Margaret Taft, Murali Thiyagarajan, Jean-Francois Verrier, Andreas Walter, Andy Witkowski, Min Xiao, Tsae-Feng Yu, Fred Zemke, Mohamed Ziauddin, Frederick Kush

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software, software documentation, data (as defined in the Federal Acquisition Regulation), or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed, or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software," "commercial computer software documentation," or "limited rights data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed, or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government's use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle?, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Contents

Preface

Audience

xxvi

Documentation Accessibility

xxvi

Related Documents

xxvi

Conventions

xxvii

Part I Data Warehouse - Fundamentals

1 Introduction to Data Warehousing Concepts

1.1 What Is a Data Warehouse?

1-1

1.1.1 Key Characteristics of a Data Warehouse

1-3

1.2 Contrasting OLTP and Data Warehousing Environments

1-3

1.3 Common Data Warehouse Tasks

1-4

1.4 Data Warehouse Architectures

1-5

1.4.1 Data Warehouse Architecture: Basic

1-5

1.4.2 Data Warehouse Architecture: with a Staging Area

1-6

1.4.3 Data Warehouse Architecture: with a Staging Area and Data Marts

1-6

2 Data Warehousing Logical Design

2.1 Logical Versus Physical Design in Data Warehouses

2-1

2.2 Creating a Logical Design

2-1

2.2.1 What is a Schema?

2-2

2.3 About Third Normal Form Schemas

2-2

2.3.1 About Normalization

2-3

2.3.2 Design Concepts for 3NF Schemas

2-4

2.3.2.1 Identifying Candidate Primary Keys

2-5

2.3.2.2 Foreign Key Relationships and Referential Integrity Constraints

2-5

2.3.2.3 Denormalization

2-5

2.4 About Star Schemas

2-5

2.4.1 About Facts and Dimensions in Star Schemas

2-6

iii

2.4.1.1 About Fact Tables in Data Warehouses 2.4.1.2 About Dimension Tables in Data Warehouses 2.4.2 Design Concepts in Star Schemas 2.4.3 About Snowflake Schemas 2.5 Improved Analytics Using the In-Memory Column Store 2.5.1 About Improving Query Performance Using In-Memory Expressions 2.5.2 About Using In-Memory Virtual Columns to Improve Query Performance 2.5.3 About In-Memory Column Store and Automatic Data Optimization 2.6 Automatic Big Table Caching to Improve the Performance of In-Memory Parallel Queries

3 Data Warehousing Physical Design

3.1 Moving from Logical to Physical Design 3.2 About Physical Design

3.2.1 Physical Design Structures 3.2.1.1 About Tablespaces in Data Warehouses 3.2.1.2 About Partitioning in Data Warehouses 3.2.1.3 Index Partitioning in Data Warehouses 3.2.1.4 About Partitioning for Manageability 3.2.1.5 About Partitioning for Performance 3.2.1.6 About Partitioning for Availability

3.2.2 About Views in Data Warehouses 3.2.3 About Integrity Constraints in Data Warehouses 3.2.4 About Indexes and Partitioned Indexes in Data Warehouses 3.2.5 About Materialized Views in Data Warehouses 3.2.6 About Dimensions in Data Warehouses

3.2.6.1 About Dimension Hierarchies 3.2.6.2 Typical Dimension Hierarchy

4 Data Warehousing Optimizations and Techniques

4.1 Using Indexes in Data Warehouses 4.1.1 About Using Bitmap Indexes in Data Warehouses 4.1.1.1 About Bitmap Indexes and Nulls 4.1.1.2 About Bitmap Indexes on Partitioned Tables 4.1.2 Benefits of Indexes for Data Warehousing Applications 4.1.3 About Cardinality and Bitmap Indexes 4.1.4 How to Determine Candidates for Using a Bitmap Index 4.1.5 Using Bitmap Join Indexes in Data Warehouses 4.1.5.1 Four Join Models for Bitmap Join Indexes in Data Warehouses 4.1.5.2 Bitmap Join Index Restrictions and Requirements

2-7 2-8 2-8 2-10 2-11 2-12 2-13 2-13

2-14

3-1 3-1 3-2 3-2 3-3 3-4 3-5 3-5 3-6 3-6 3-6 3-7 3-7 3-7 3-8 3-9

4-1 4-1 4-2 4-2 4-3 4-3 4-5 4-5 4-6 4-8

iv

4.1.6 Using B-Tree Indexes in Data Warehouses 4.1.7 Using Index Compression 4.1.8 Choosing Between Local Indexes and Global Indexes 4.2 Using Integrity Constraints in a Data Warehouse 4.2.1 Overview of Constraint States 4.2.2 Typical Data Warehouse Integrity Constraints

4.2.2.1 UNIQUE Constraints in a Data Warehouse 4.2.2.2 FOREIGN KEY Constraints in a Data Warehouse 4.2.2.3 RELY Constraints in a Data Warehouse 4.2.2.4 NOT NULL Constraints in a Data Warehouse 4.2.2.5 Integrity Constraints and Parallelism in a Data Warehouse 4.2.2.6 Integrity Constraints and Partitioning in a Data Warehouse 4.2.2.7 View Constraints in a Data Warehouse 4.3 About Parallel Execution in Data Warehouses 4.3.1 Why Use Parallel Execution? 4.3.1.1 When to Implement Parallel Execution 4.3.1.2 When Not to Implement Parallel Execution 4.3.2 Automatic Degree of Parallelism and Statement Queuing 4.3.3 About In-Memory Parallel Execution in Data Warehouses 4.4 About Optimizing Storage Requirements in Data Warehouses 4.4.1 Using Data Compression to Improve Storage in Data Warehouses 4.5 Optimizing Star Queries and 3NF Schemas 4.5.1 Optimizing Star Queries 4.5.1.1 Tuning Star Queries 4.5.2 Using Star Transformation 4.5.2.1 Star Transformation with a Bitmap Index 4.5.2.2 Execution Plan for a Star Transformation with a Bitmap Index 4.5.2.3 Star Transformation with a Bitmap Join Index 4.5.2.4 Execution Plan for a Star Transformation with a Bitmap Join Index 4.5.2.5 How Oracle Chooses to Use Star Transformation 4.5.2.6 Star Transformation Restrictions 4.5.3 Optimizing Third Normal Form Schemas 4.5.3.1 3NF Schemas: Partitioning 4.5.3.2 3NF Schemas: Parallel Query Execution 4.5.4 Optimizing Star Queries Using VECTOR GROUP BY Aggregation 4.6 About Approximate Query Processing 4.6.1 Running Queries Containing Exact Functions Using SQL Functions that Return

Approximate Values 4.7 About Approximate Top-N Query Processing

4-8 4-9 4-9 4-10 4-10 4-11 4-11 4-12 4-13 4-13 4-14 4-14 4-14 4-14 4-15 4-16 4-16 4-16 4-18 4-18 4-19 4-19 4-20 4-20 4-20 4-21 4-22 4-23 4-23 4-24 4-24 4-25 4-25 4-28 4-29 4-30

4-31 4-32

v

Part II Optimizing Data Warehouses

5 Basic Materialized Views

5.1 Overview of Data Warehousing with Materialized Views 5.1.1 About Materialized Views for Data Warehouses 5.1.2 About Materialized Views for Distributed Computing 5.1.3 About Materialized Views for Mobile Computing 5.1.4 The Need for Materialized Views 5.1.5 Components of Summary Management 5.1.6 Data Warehousing Terminology 5.1.7 About Materialized View Schema Design 5.1.7.1 Schemas and Dimension Tables 5.1.7.2 Guidelines for Materialized View Schema Design 5.1.8 About Loading Data into Data Warehouses 5.1.9 Overview of Materialized View Management Tasks

5.2 Types of Materialized Views 5.2.1 About Materialized Views with Aggregates 5.2.1.1 Requirements for Using Materialized Views with Aggregates 5.2.2 About Materialized Views Containing Only Joins 5.2.2.1 Materialized Join Views FROM Clause Considerations 5.2.3 About Nested Materialized Views 5.2.3.1 Why Use Nested Materialized Views? 5.2.3.2 About Nesting Materialized Views with Joins and Aggregates 5.2.3.3 Nested Materialized View Usage Guidelines 5.2.3.4 Restrictions When Using Nested Materialized Views

5.3 Creating Materialized Views 5.3.1 Creating Materialized Views with Column Alias Lists 5.3.2 Creating Materialized Views Based on Hybird Partitioned Tables 5.3.3 About Materialized Views Names 5.3.4 About Storage And Table Compression for Materialized Views 5.3.5 About Build Methods for Materialized Views 5.3.6 About Enabling Query Rewrite for Materialized Views 5.3.7 About Query Rewrite Restrictions 5.3.7.1 About Materialized View Restrictions for Query Rewrite 5.3.7.2 General Query Rewrite Restrictions 5.3.8 About Refresh Options for Materialized Views 5.3.8.1 About Refresh Modes for Materialized Views 5.3.8.2 About Types of Materialized View Refresh 5.3.8.3 About Using Trusted Constraints and Materialized View Refresh 5.3.8.4 General Restrictions on Fast Refresh

5-1 5-2 5-2 5-2 5-3 5-4 5-5 5-6 5-6 5-7 5-8 5-9 5-10 5-10 5-12 5-13 5-14 5-15 5-15 5-16 5-16 5-17 5-17 5-18 5-19 5-20 5-20 5-21 5-21 5-22 5-22 5-22 5-23 5-23 5-24 5-25 5-26

vi

5.3.8.5 Restrictions on Fast Refresh on Materialized Views with Joins Only 5.3.8.6 Restrictions on Fast Refresh on Materialized Views with Aggregates 5.3.8.7 Restrictions on Fast Refresh on Materialized Views with UNION ALL 5.3.8.8 About Achieving Refresh Goals 5.3.8.9 Refreshing Nested Materialized Views 5.3.9 ORDER BY Clause in Materialized Views 5.3.10 Using Oracle Enterprise Manager to Create Materialized Views 5.3.11 Using Materialized Views with NLS Parameters 5.3.12 Adding Comments to Materialized Views 5.4 Creating Materialized View Logs 5.4.1 Using the FORCE Option With Materialized View Logs 5.4.2 Purging Materialized View Logs 5.5 Creating Materialized Views Based on Approximate Queries 5.6 Creating a Materialized View Containing Bitmap-based COUNT(DISTINCT) Functions 5.7 Registering Existing Materialized Views 5.8 Choosing Indexes for Materialized Views 5.9 Dropping Materialized Views 5.10 Analyzing Materialized View Capabilities 5.10.1 Using the DBMS_MVIEW.EXPLAIN_MVIEW Procedure 5.10.1.1 DBMS_MVIEW.EXPLAIN_MVIEW Declarations 5.10.1.2 Using MV_CAPABILITIES_TABLE 5.10.1.3 MV_CAPABILITIES_TABLE.CAPABILITY_NAME Details 5.10.1.4 MV_CAPABILITIES_TABLE Column Details

6 Advanced Materialized Views

6.1 About Partitioning and Materialized Views 6.1.1 About Partition Change Tracking 6.1.1.1 About Partition Key and Partition Change Tracking 6.1.1.2 About Join Dependent Expression and Partition Change Tracking 6.1.1.3 About Partition Markers and Partition Change Tracking 6.1.1.4 About Partial Rewrite in Partition Change Tracking 6.1.2 Partitioning a Materialized View 6.1.3 Partitioning a Prebuilt Table 6.1.3.1 Benefits of Partitioning a Materialized View 6.1.4 Rolling Materialized Views

6.2 About Materialized Views in Analytic Processing Environments 6.2.1 About Materialized Views and Analytic Views 6.2.2 About Materialized Views and Hierarchical Cubes 6.2.3 Benefits of Partitioning Materialized Views 6.2.4 About Compressing Materialized Views

5-26 5-27 5-28 5-29 5-29 5-30 5-30 5-30 5-31 5-31 5-32 5-33 5-33

5-34 5-35 5-36 5-37 5-37 5-37 5-38 5-38 5-41 5-42

6-1 6-1 6-3 6-3 6-4 6-5 6-5 6-6 6-7 6-7 6-7 6-8 6-8 6-9 6-9

vii

6.2.5 About Materialized Views with Set Operators 6.2.5.1 Examples of Materialized Views Using UNION ALL

6.3 About Materialized Views and Models 6.4 About Security Issues with Materialized Views

6.4.1 Querying Materialized Views with Virtual Private Database (VPD) 6.4.1.1 Using Query Rewrite with Virtual Private Database 6.4.1.2 Restrictions with Materialized Views and Virtual Private Database

6.5 Invalidating Materialized Views 6.6 Altering Materialized Views 6.7 Using Real-time Materialized Views

6.7.1 Overview of Real-time Materialized Views 6.7.1.1 Restrictions on Using Real-time Materialized Views 6.7.1.2 About Accessing Real-time Materialized Views

6.7.2 Creating Real-time Materialized Views 6.7.3 Converting an Existing Materialized View into a Real-time Materialized View 6.7.4 Enabling Query Rewrite to Use Real-time Materialized Views 6.7.5 Using Real-time Materialized Views During Query Rewrite 6.7.6 Using Real-time Materialized Views for Direct Query Access 6.7.7 Listing Real-time Materialized Views 6.7.8 Improving Real-time Materialized Views Performance

7 Refreshing Materialized Views

7.1 About Refreshing Materialized Views 7.1.1 About Complete Refresh for Materialized Views 7.1.2 About Fast Refresh for Materialized Views 7.1.3 About Partition Change Tracking (PCT) Refresh for Materialized Views 7.1.4 About the Out-of-Place Refresh Option 7.1.4.1 Types of Out-of-Place Refresh 7.1.4.2 Restrictions and Considerations with Out-of-Place Refresh 7.1.5 About ON COMMIT Refresh for Materialized Views 7.1.6 About ON STATEMENT Refresh for Materialized Views 7.1.7 About Manual Refresh Using the DBMS_MVIEW Package 7.1.8 Refreshing Specific Materialized Views with REFRESH 7.1.9 Refreshing All Materialized Views with REFRESH_ALL_MVIEWS 7.1.10 Refreshing Dependent Materialized Views with REFRESH_DEPENDENT 7.1.11 About Using Job Queues for Refresh 7.1.12 When Fast Refresh is Possible 7.1.13 Refreshing Materialized Views Based on Approximate Queries 7.1.14 About Refreshing Dependent Materialized Views During Online Table Redefinition 7.1.15 Recommended Initialization Parameters for Parallelism

6-9 6-10 6-11 6-12 6-12 6-13 6-13 6-14 6-14 6-15 6-15 6-16 6-16 6-17 6-18 6-19 6-19 6-22 6-23 6-24

7-1 7-4 7-4 7-4 7-5 7-5 7-6 7-6 7-7 7-7 7-8 7-9 7-10 7-11 7-11 7-12

7-12 7-13

viii

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download