Database Template

Initialization Parameters


Name Value
background_dump_dest /u02/oracle/product/82/admin/ORA82/bdump
compatible 8.1.7
control_files ("/u03/app/oracle/product/9i/OID/dbs/control01.ctl", "/u03/app/oracle/product/9i/OID/dbs/control02.ctl", "/u03/app/oracle/product/9i/OID/dbs/control03.ctl")
db_block_buffers 44295
db_block_size 8192 or 16K
db_domain  
db_name ORADW
db_file_multiblock_read_count
8
distributed_transactions 10
instance_name ORA82
java_pool_size 20971520
job_queue_processes 4
large_pool_size 614400
log_buffer 163840
log_checkpoint_interval 10000
log_checkpoint_timeout 1800
max_enabled_roles 30
open_cursors 300
open_links 4
processes 150
remote_login_passwordfile EXCLUSIVE
shared_pool_size 118122KB
sort_area_retained_size 65536
sort_area_size 65536
user_dump_dest /u02/oracle/product/82/admin/ORA82/udump

Data Files


Datafiles
/u03/app/oracle/product/9i/OID/dbs/system01.dbf
/u03/app/oracle/product/9i/OID/dbs/indx01.dbf
/u03/app/oracle/product/9i/OID/dbs/temp01.dbf
/u03/app/oracle/product/9i/OID/dbs/drsys01.dbf
/u03/app/oracle/product/9i/OID/dbs/tools01.dbf
/u03/app/oracle/product/9i/OID/dbs/users01.dbf
/u03/app/oracle/product/9i/OID/dbs/cmwlite01.dbf
/u03/app/oracle/product/9i/OID/dbs/rbs01.dbf

Control Files


Controlfile
/u03/app/oracle/product/9i/OID/dbs/control01.ctl
/u03/app/oracle/product/9i/OID/dbs/control02.ctl
/u03/app/oracle/product/9i/OID/dbs/control03.ctl

Redo Log Groups


Group Size(K)
1 500
2 500
3 500

Create the Data Warehouse

To create the database, rerun dbca and use the template ORADWH.

Review the .ORA Files

The installation added entries in your tnsnames.ora and listener.ora files.
  1. Open the $ORACLE_HOME/network/admin/tnsnames.ora file. You should see something like the following entry:

  2. ORADWH.WORLD =
    (DESCRIPTION =
      (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = TCP)(HOST = mymachine)(PORT = 1521))
      )
      (CONNECT_DATA =
        (SERVICE_NAME = oradwh.world)
      )
    )

  3. Open the $ORACLE_HOME/network/admin/listener.ora file. You should see something like the following entry:

  4. (SID_DESC =
        (GLOBAL_DBNAME = oradwh.world)
        (ORACLE_HOME = /u02/oracle/product/82)
        (SID_NAME = oradwh)
      )

Add a Plan Table to the Data Warehouse

se Oracle TopSessions to analyze different execution plans. While connected as SYSTEM, create the Plan Table needed by Oracle TopSessions.
  1. Start a SQL*Plus session, enter the following commands:

  2. sqlplus system/manager@ oradwh.world;
    @?/rdbms/admin/utlxplan
     

  3. Make sure that Oracle TopSessions is working correctly by launching it from the desktop and connecting to the Data Warehouse database. Select Start-> Programs -> Oracle - Ora81Home -> Diagnostics Pack -> TopSessions.
  4. At the login script, enter the username and password as system/manager, enter the service as oradwh.world, and click OK.
  5. TopSessions should start with no error messages. Close TopSessions.

Add Specific Data Warehousing Initialization Parameters to the Database

The new Data Warehouse database has been automatically configured by the Oracle Database Configuration Assistant for typical data warehousing requirements. However, there are some additional initialization parameters that can be added to further improve your configuration.
  1. First, stop the Data Warehouse database.
  2. sqlplus system/manager@oradwh as SYSDBA

    connect internal;

    shutdown;
  3. Edit the database initialization file $ORACLE_HOME/dbs/initoradwh.ora.The Oracle Database Configuration Assistant has already set some of the following data warehouse parameters. It also depends on the changes you made during your database template creation.
shared_pool_size = 15728640
In general, shared pool size should be equal to approximately 20% of the total physical memory.
    db_block_buffers = 2048
    The number of database block buffers should be equal to approximately 2% of the total physical memory. The actual parameter value can be calculated as

    (2% of physical memory)/db_block_size).
    db_block_size = 8192
    Database blocks should be large in data warehouses. This improves performance of operations involving scans of large amounts of data. (Check if your Operating Systems supports 16k)
    sort_area_size = 66560
    For queries, sort area size should remain relatively small, even for large databases. However, sort area size should be increased while building indexes.
  1. Add the following lines:

  2. job_queue_processes = 1
    open_links = 4
In Oracle 8i, Materialized Views refreshes require at least one job queue process.
hash_area_size = 8388608
Hash joins perform better with a larger hash area size. In a database that has a significant number of joins, up to 75% of the physical memory can be dedicated for hash joins.
Parallel query parameters have been greatly simplified in Oracle9i.
The following parameters are recommended for both new data warehouses and existing data warehouses that are being upgraded to Oracle9i:
parallel_automatic_tuning = true
parallel_threads_per_cpu = 4
This parameter determines the default number of parallel query processes. Typically, two parallel processes per CPU provide good performance. However, for systems with a smaller number of CPUs, more parallel processes may be desired.
optimizer_mode = "all_rows"
always_anti_join = hash
All data warehouses should use the cost-based optimizer.
All advanced performance features, such as star query support, hash joins, and bitmap indexes are accessible only via the cost-based optimizer.
The following parameters may provide better performance for certain environments:
always_semi_join = hash
hash_multiblock_io_count = 8
 

One of the major benefits of creating and maintaining materialized views is the ability to take advantage of query rewrite, which transforms a SQL statement expressed in terms of tables or views into a statement accessing one or more materialized views that are defined on the detail tables.
To enable query rewrite set:

query_rewrite_enabled = true
query_rewrite_integrity = trusted

To get the best possible performance for star queries, it is important to follow some basic guidelines. A bitmap index should be built on each of the foreign key columns of the fact table or tables. The initialization parameter STAR_TRANSFORMATION_ENABLED should be set to TRUE.
This enables an important optimizer feature for star-queries. It is set to FALSE by default for backwards-compatibility.

star_transformation_enabled = true

To collect and analyze the summary event set, you must do the following(optional):
Set six initialization parameters to collect data via Oracle Trace.
Enabling these parameters incurs some additional overhead at database connection, but is otherwise transparent.

oracle_trace_collection_name = oraclesm
oracle_trace_collection_path= location
oracle_trace_collection_size = 0
oracle_trace_enbable = true
oracle_trace_facility_name = oraclesm
oracle_trace_facility_name = location

  1. Save the file.
  2. Restart the database.

Load The Data Warehouse with some Example Data

For the data warehouse example, you need some data and a star schema.Use the Sales History schema (described later in this lesson) provided with Oracle9i.

Create a new tablespace called demo size 200MB. From a SQL*Plus session, run this script: sh_main.sql.
It creates the SH schema and also creates and populates the following tables:

 
Table
Number of Rows
customers
50.000
countries
19
products
10.000
sales
1.016.271
times
1461
promotions
500
channels
5
This script can also be used to re-create the data warehouse, if necessary.
You are now ready to examine the data warehouse schema itself.