Skip Headers
Oracle® Database 2 Day + Data Warehousing Guide
11g Release 2 (11.2)

Part Number E10578-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

2 Setting Up Your Data Warehouse System

This section discusses how to initially configure your data warehouse environment. It includes the following topics:

General Steps for Setting up a Data Warehouse System

The procedures in this section describe how to configure Oracle Database for use as a data warehouse. Subsequently, you configure Oracle Warehouse Builder, which leverages Oracle Database and provides graphical user interfaces for designing data management strategies.

To set up a data warehouse system: 

  1. Size and configure your hardware as described in "Preparing the Environment".

  2. Install the Oracle Database software. See the installation instructions in Oracle Database 2 Day DBA or the installation guide for your platform, such as Oracle Database Installation Guide for Linux

  3. Optimize the Database for use as a data warehouse as described in "Setting Up a Database for a Data Warehouse".

  4. Access the Oracle Warehouse Builder software.

    Follow the instructions in "Accessing Oracle Warehouse Builder". Subsequently, you can install a demonstration to assist you in learning how to complete common data warehousing tasks using OWB.

Preparing the Environment

The basic components for a data warehousing architecture are almost the same as for an online transaction processing (OLTP) system. However, because of the sheer size and volume of data, the hardware configuration and data throughput requirements for a data warehouse are unique. The starting point for sizing a data warehouse is the throughput that you require from the system. When sizing, use one or more of the following criteria:

In general, you must estimate the highest throughput you need at any given point.

Hardware vendors can recommend balanced configurations for a data warehousing application and can help you with the sizing. Contact your preferred hardware vendor for more details.

Balanced Hardware Configuration

A properly sized and balanced hardware configuration is required to maximize data warehouse performance. The following sections discuss important considerations in achieving this balance:

How Many CPUs and What Clock Speed Do I Need?

Central processing units (CPUs) provide the calculation capabilities in a data warehouse. You must have sufficient CPU power to perform the data warehouse operations. Parallel operations are more CPU-intensive than the equivalent serial operations.

Use the estimated highest throughput as a guideline for the number of CPUs you need. As a rough estimate, use the following formula:

<number of CPUs> = <maximum throughput in MB/s> / 200

This formula assumes that a CPU can sustain up to about 200 MB per second. For example, if a system requires a maximum throughput of 1200 MB per second, then the system needs <number of CPUs> = 1200/200 = 6 CPUs. A configuration with 1 server with 6 CPUs can service this system. A 2-node clustered system could be configured with 3 CPUs in both nodes.

How Much Memory Do I Need?

Memory in a data warehouse is particularly important for processing memory-intensive operations such as large sorts. Access to the data cache is less important in a data warehouse because most of the queries access vast amounts of data. Data warehouses do not have the same memory requirements as mission-critical OLTP applications.

The number of CPUs provides a good guideline for the amount of memory you need. Use the following simplified formula to derive the amount of memory you need from the CPUs that you select:

<amount of memory in GB> = 2 * <number of CPUs>

For example, a system with 6 CPUs needs 2 * 6 = 12 GB of memory. Most standard servers fulfill this requirement.

How Many Disks Do I Need?

A common mistake in data warehouse environments is to size the storage based on the maximum capacity needed. Sizing that is based exclusively on storage requirements will likely create a throughput bottleneck.

Use the maximum throughput you require to find out how many disk arrays you need. Use the storage provider's specifications to find out how much throughput a disk array can sustain. Note that storage providers measure in Gb per second, and your initial throughput estimate is based on MB per second. An average disk controller has a maximum throughput of 2 Gb per second, which translates to a sustainable throughput of about (70% * 2 Gbit/s) /8 = 180 MB/s.

Use the following formula to determine the number of disk arrays you need:

  • <number of disk controllers> = <throughput in MB/s> / <individual controller throughput in MB/s>

For example, our system with 1200 MB per second throughput requires at least 1200 / 180 = 7 disk arrays.

Make sure you have enough physical disks to sustain the throughput you require. Ask your disk vendor for the throughput numbers of the disks.

How Do I Determine Sufficient I/O Bandwidth?

The end-to-end I/O system consists of more components than just the CPUs and disks. A well-balanced I/O system must provide approximately the same bandwidth across all components in the I/O system. These components include:

  • Host Bus Adapters (HBAs), the connectors between the server and the storage.

  • Switches, in between the servers and a Storage Area Network (SAN) or Network Attached Storage (NAS).

  • Ethernet adapters for network connectivity (GigE NIC or Infiniband). In a Oracle RAC environment, you need an additional private port for the interconnect between the nodes that you should not include when sizing the system for I/O throughput. The interconnect must be sized separately, taking into account factors such as internode parallel execution.

  • Wires that connect the individual components.

Each of the components has to be able to provide sufficient I/O bandwidth to ensure a well-balanced I/O system. The initial throughput you estimated and the hardware specifications from the vendors are the basis to determine the quantities of the individual components you need. Use the conversion in the following table to translate the vendors' maximum throughput numbers in bits into sustainable throughput numbers in bytes.

Table 2-1 Throughput Performance Conversion

Component Bits Bytes Per Second

HBA

2 Gbit

200 MB

16 Port Switch

8 * 2 Gbit

1200 MB

Fibre Channel

2 Gbit

200 MB

GigE NIC

1 Gbit

80 MB

Inf-2 Gbit

2 Gbit

160 MB


In addition to having sufficient components to ensure sufficient I/O bandwidth, the layout of data on the disk is key to success or failure. If you configured the system for sufficient throughput across all disk arrays, and if the data that a query will retrieve still resides on one disk, then you will not be able to get the required throughput. This is because the one disk will be the bottleneck. In order to avoid such a situation, stripe data across as many disks as possible, ideally all disks. A stripe size of 256 KB to 1 MB provides a good balance between multiblock read operations and data spread across multiple disks.

Verifying the Data Warehouse Hardware Configuration

Before you install Oracle Database, you should verify your setup on the hardware and operating-system level. The key point to understand is that if the operating system cannot deliver the performance and throughput you need, Oracle Database will never be able to perform according to your requirements. Two tools for verifying throughput are the dd utility and Orion, an Oracle-supplied tool.

About the dd Utility

A very basic way to validate the operating system throughput on UNIX or Linux systems is to use the dd utility. The dd utility is a common Unix program whose primary purpose is the low-level copying and conversion of raw data. dd is an abbreviation for "dataset definition." Because there is almost no overhead involved, the output from the dd utility provides a reliable calibration. Oracle Database can reach a maximum throughput of approximately 90 percent of what the dd utility can achieve.

Example: Using the dd Utility

To use the dd utility:

First, the most important options for using dd are:

bs=BYTES: Read BYTES bytes at a time; use 1 MB
count=BLOCKS: copy only BLOCKS input blocks
if=FILE: read from FILE; set to your device
of=FILE: write to FILE; set to /dev/null to evaluate read performance; 
  write to disk would erase all existing data!!!
skip=BLOCKS: skip BLOCKS BYTES-sized blocks at start of input

To estimate the maximum throughput Oracle Database will be able to achieve, you can mimic a workload of a typical data warehouse application, which consists of large, random sequential disk access.

The following dd command performs random sequential disk access across two devices reading a total of 2 GB. The throughput is 2 GB divided by the time it takes to finish the following command:

dd bs=1048576 count=200 if=/raw/data_1 of=/dev/null &
dd bs=1048576 count=200 skip=200 if=/raw/data_1 of=/dev/null &
dd bs=1048576 count=200 skip=400 if=/raw/data_1 of=/dev/null &
dd bs=1048576 count=200 skip=600 if=/raw/data_1 of=/dev/null &
dd bs=1048576 count=200 skip=800 if=/raw/data_1 of=/dev/null &
dd bs=1048576 count=200 if=/raw/data_2 of=/dev/null &
dd bs=1048576 count=200 skip=200 if=/raw/data_2 of=/dev/null &
dd bs=1048576 count=200 skip=400 if=/raw/data_2 of=/dev/null &
dd bs=1048576 count=200 skip=600 if=/raw/data_2 of=/dev/null &
dd bs=1048576 count=200 skip=800 if=/raw/data_2 of=/dev/null &

In your test, you should include all the storage devices that you plan to include for your database storage. When you configure a clustered environment, you should run dd commands from every node.

About the Orion Utility

Orion is a tool that Oracle provides to mimic an Oracle-like workload on a system in order to calibrate the throughput. Compared to the dd utility, Orion provides the following advantages:

  • Orion's simulation is closer to the workload the database will produce.

  • Orion enables you to perform reliable write and read simulations within one simulation.

Oracle recommends you use Orion to verify the maximum achievable throughput, even if a database has already been installed.

The types of supported I/O workloads are as follows:

  • small and random

  • large and sequential

  • large and random

  • mixed workloads

For each type of workload, Orion can run tests at different levels of I/O load to measure performance metrics such as MB per second, I/O per second, and I/O latency. A data warehouse workload is typically characterized by sequential I/O throughput, issued by multiple processes. You can run different I/O simulations depending upon which type of system you plan to build. Examples are the following:

  • daily workloads when users or applications query the system

  • the data load when users may or may not access the system

  • index and materialized view builds

  • backup operations

To download Orion software, point your browser to the following URL:

http://www.oracle.com/technology/software/tech/orion/index.html

Example: Using the Orion Utility

To invoke Orion:

$ orion -run simple -testname mytest -num_disks 8

Typical output is as follows:

Orion VERSION 10.2

Command line:
-run advanced -testname orion14 -matrix point -num_large 4 -size_large 1024
-num_disks 4 -type seq -num_streamIO 8 -simulate raid0 -cache_size 0 -verbose

This maps to this test:
Test: orion14
Small IO size: 8 KB
Large IO size: 1024 KB
IO Types: Small Random IOs, Large Sequential Streams
Number of Concurrent IOs Per Stream: 8
Force streams to separate disks: No
Simulated Array Type: RAID 0
Stripe Depth: 1024 KB
Write: 0%
Cache Size: 0 MB
Duration for each Data Point: 60 seconds
Small Columns:, 0
Large Columns:, 4
Total Data Points: 1

Name: /dev/vx/rdsk/asm_vol1_1500m    Size: 1572864000
Name: /dev/vx/rdsk/asm_vol2_1500m    Size: 1573912576
Name: /dev/vx/rdsk/asm_vol3_1500m    Size: 1573912576
Name: /dev/vx.rdsk/asm_vol4_1500m    Size: 1573912576
4 FILEs found.

Maximum Large MBPS=57.30 @ Small=0 and Large=4

In this example, the maximum throughput for this particular workload is 57.30 MB per second.

Setting Up a Database for a Data Warehouse

After you set up your environment and install Oracle Database software, ensure that you have the database parameters set correctly. Note that there are not many database parameters that have to be set.

As a general guideline, avoid changing a database parameter unless you have good reason to do so. You can use Oracle Enterprise Manager to set up your data warehouse. To view various parameter settings, navigate to the Database page, then click Server. Under Database Configuration, click Memory Parameters or All Inititalization Parameters.

How Should I Set the Memory Management Parameters?

Oracle Database memory has the following components:

  • Shared memory: Also called the system global area (SGA), this is the memory used by the Oracle instance.

  • Session-based memory: Also called program global area (PGA), this is the memory that is occupied by sessions in the database. It is used to perform database operations, such as sorts and aggregations.

Oracle Database can automatically tune the distribution of the memory components in two memory areas. You have a choice between two mutually exclusive options:

  • Set MEMORY_TARGET and MEMORY_MAX_TARGET

    Or:

  • Set SGA_TARGET and PGA_AGGREGATE_TARGET

    If you choose the first option, then you don't need to set other parameters. The database manages all memory for you. If you choose the second option, then you must specify a size for the SGA and a size for the PGA. The database does the rest.

    The PGA_AGGREGATE_TARGET parameter is the target amount of memory that you want the total PGA across all sessions to consume. As a starting point, you can use the following formula to define the PGA_AGGREGATE_TARGET value:

    • PGA_AGGREGATE_TARGET = 3 * SGA_TARGET. If you do not have enough physical memory for the PGA_AGGREGATE_TARGET to fit in memory, then reduce PGA_AGGREGATE_TARGET.

  • MEMORY_TARGET and MEMORY_MAX_TARGET

    The MEMORY_TARGET parameter enables you to set a target memory size and the related initialization parameter, MEMORY_MAX_TARGET, sets a maximum target memory size. The database then tunes to the target memory size, redistributing memory as needed between the system global area (SGA) and aggregate program global area (PGA). Because the target memory initialization parameter is dynamic, you can change the target memory size at any time without restarting the database. The maximum memory size serves as an upper limit so that you cannot accidentally set the target memory size too high. Because certain SGA components either cannot easily shrink or must remain at a minimum size, the database also prevents you from setting the target memory size too low.

Example: Setting an Initialization Parameter

You can set an initialization parameter by issuing an ALTER SYSTEM statement, as follows:

ALTER SYSTEM SET SGA_TARGET = 1024M;

What Other Initialization Parameter Settings Are Important?

A good starting point for a data warehouse is the data warehouse template database that you can select when you run the Database Configuration Assistant (DBCA). However, any database will be acceptable as long as you make sure you take the following initialization parameters into account:

  • COMPATIBLE

    TheCOMPATIBLE parameter identifies the level of compatibility that the database has with earlier releases. To benefit from the latest features, set the COMPATIBLE parameter to your database release number.

  • OPTIMIZER_FEATURES_ENABLE

    To benefit from advanced cost-based optimizer features such as query rewrite, make sure this parameter is set to the value of the current database version.

  • DB_BLOCK_SIZE

    The default value of 8 KB is appropriate for most data warehousing needs. If you intend to use table compression, then consider a larger block size.

  • DB_FILE_MULTIBLOCK_READ_COUNT

    The DB_FILE_MULTIBLOCK_READ_COUNT parameter enables reading several database blocks in a single operating-system read call. Because a typical workload on a data warehouse consists of many sequential I/Os, make sure you can take advantage of fewer large I/Os as opposed to many small I/Os. When setting this parameter, take into account the block size as well as the maximum I/O size of the operating system, and use the following formula:

    DB_FILE_MULTIBLOCK_READ_COUNT * DB_BLOCK_SIZE =
     <maximum operating system I/O size>
    

    Maximum operating-system I/O sizes vary between 64 KB and 1 MB.

  • PARALLEL_MAX_SERVERS

    The PARALLEL_MAX_SERVERS parameter sets a resource limit on the maximum number of processes available for parallel execution. Parallel operations need at most twice the number of query server processes as the maximum degree of parallelism (DOP) attributed to any table in the operation.

    Oracle Database sets the PARALLEL_MAX_SERVERS parameter to a default value that is sufficient for most systems. The default value for PARALLEL_MAX_SERVERS is as follows:

    (CPU_COUNT x PARALLEL_THREADS_PER_CPU x (2 if PGA_AGGREGATE_TARGET > 0; otherwise 1) x 5)
    

    This value might not be enough for parallel queries on tables with higher DOP attributes. Oracle recommends users who expect to run queries of higher DOP to set PARALLEL_MAX_SERVERS as follows:

    2 x DOP x <number_of_concurrent_users>
    

    For example, setting the PARALLEL_MAX_SERVERS parameter to 64 will allow you to run four parallel queries simultaneously, assuming that each query is using two slave sets with a DOP of eight for each set.

    If the hardware system is neither CPU-bound nor I/O bound, then you can increase the number of concurrent parallel execution users on the system by adding more query server processes. When the system becomes CPU- or I/O-bound, however, adding more concurrent users becomes detrimental to the overall performance. Careful setting of the PARALLEL_MAX_SERVERS parameter is an effective method of restricting the number of concurrent parallel operations.

  • PARALLEL_ADAPTIVE_MULTI_USER

    The PARALLEL_ADAPTIVE_MULTI_USER parameter, which can be TRUE or FALSE, defines whether or not the server will use an algorithm to dynamically determine the degree of parallelism for a particular statement depending on the current workload. To take advantage of this feature, set PARALLEL_ADAPTIVE_MULTI_USER to TRUE.

  • QUERY_REWRITE_ENABLED

    To take advantage of query rewrite against materialized views, you must set this parameter to TRUE. This parameter defaults to TRUE.

  • QUERY_REWRITE_INTEGRITY

    The default for the QUERY_REWRITE_INTEGRITY parameter is ENFORCED. The database will rewrite queries against only fully up-to-date materialized views, if it can base itself on enabled and validated primary, unique, and foreign key constraints.

    In TRUSTED mode, the optimizer trusts that the data in the materialized views is current and the hierarchical relationships declared in dimensions and RELY constraints are correct.

  • STAR_TRANSFORMATION_ENABLED

    To take advantage of highly optimized star transformations, make sure to set this parameter to TRUE.

Accessing Oracle Warehouse Builder

Oracle Warehouse Builder (OWB) enables you to design and deploy various types of data management strategies, including traditional data warehouses.

To enable OWB: 

  1. Ensure that you have access to either Enterprise or Standard Edition of Oracle Database.

    Oracle Database 11g comes with OWB server components pre-installed. This includes a schema for the OWB repository.

  2. To utilize the default OWB schema installed in Oracle Database, first unlock the schema as follows:

    Connect to SQL*Plus as the SYS or SYSDBA user. Enter the following commands:

    SQL> ALTER USER OWBSYS ACCOUNT UNLOCK;

    SQL> ALTER USER OWBSYS IDENTIFIED BY owbsys_passwd;

  3. Launch the Warehouse Builder Design Center.

    For Windows, select Start>Programs>Oracle>Warehouse Builder and then select Design Center.

    For UNIX and Linux, locate owb home/owb/bin/unix and then run owbclient.sh

  4. Define a workspace and assign a user to the workspace.

    In the single OWB repository, you can define multiple workspaces with each workspace corresponding to a set of users working on related projects. For instance, you could create a workspace for each of the following environments: development, test, and production.

    For simplicity, create one workspace called MY_WORKSPACE and assign a user.

    In the Design Center dialog box, click Show Details and then Workspace Management.

    The Repository Assistant appears.

    Follow the prompts and accept the default settings in the Repository Assistant to create a workspace and assign a user as the workspace owner.

  5. Log in to the Design Center with the user name and password you created.

Installing the Oracle Warehouse Builder Demonstration

In subsequent topics, this guide uses exercises from OBEs for Oracle Warehouse Builder to illustrate how to consolidate data from multiple flat file sources, transform the data, and load it into a new relational target. (OBE stands for Oracle By Example.)

The exercises and examples are available on Oracle Technology Network (OTN) at http://www.oracle.com/technology/obe/admin/owb_main.html. To facilitate your learning of the product, the demonstration provides you with flat file data and scripts that create various OWB objects. The OBE pages provide additional information about OWB and the latest information about the exercises.

To perform the OWB exercises presented in this guide:

  1. Download the OTN demonstration.

    The demonstration comprises a set of files in a zip archive called owbdemo_files.zip.

    The zip archive includes a SQL script, two files in comma-separated values format, and scripts written in Tcl.

  2. (Optional) Download xsales.zip from the same link, which includes XSALES table data.

  3. Edit the script owbdemoinit.tcl.

    The script owbdemoinit.tcl defines and sets variables used by the other tcl scripts. Edit the following variables to match the values in your computer environment:

    • set tempspace TEMP

    • set owbclientpwd workspace_owner

    • set sysuser sys

    • set syspwd pwd

    • set host hostname

    • set port portnumber

    • set service servicename

    • set project owb_project_name

    • set owbclient workspace_owner

    • set sourcedir drive:/newowbdemo

    • set indexspace USERS

    • set dataspace USERS

    • set snapspace USERS

    • set sqlpath drive:/oracle/11.1.0/db_1/BIN

    • set sid servicename

  4. Execute the Tcl scripts from the Warehouse Builder scripting utility, OMB Plus.

    For Windows, select Start>Programs>Oracle>Warehouse Builder and then select OMB*Plus.

    For UNIX, locate owb home/owb/bin/unix and then execute OMBPlus.sh

    At the OMB+> prompt, enter the following command to change to the directory containing the scripts:

    cd drive:\\newowbdemo\\

    Run all of the Tcl scripts in desired sequence by entering the following command:

    source loadall.tcl

  5. Launch the Design Center and log in to it as the workspace owner, using the credentials you specified in the script owbdemoinit.tcl.

  6. Verify that you successfully set up the OWB client to follow the demonstration.

    In the Design Center, expand the Locations node, which is on the right side and in the Connections Navigator. Expand Databases and then Oracle. The Oracle node should include the follow locations:

    OWB_REPOSITORY

    SALES_WH_LOCATION

When you successfully install the OWB demonstration, the Design Center displays with an Oracle module named EXPENSE_WH.