Skip Headers

Oracle® Database Sample Schemas
10g Release 1 (10.1)

Part Number B10771-01
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
Feedback

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

Manually Installing the Sample Schemas

This section describes how to install the Sample Schemas manually.

Schema Dependencies

Various dependencies have been established among the schemas. Therefore, when you create the schemas manually, you must create them in the following order: HR, OE, PM, IX, and SH.

Use this sequence to create the schemas:

  1. Create the HR schema.

  2. Create the OE schema: The HR schema must already be present, and you must know the password for the HR schema so that you can grant HR object privileges to OE. Some HR tables are visible to the OE user through the use of private synonyms. In addition, some OE tables have foreign key relationships to HR tables.


    Note:

    The OE schema requires the database to be enabled for spatial data. You can accomplish this during installation or afterward using the Database Configuration Assistant.

  3. Create the PM schema: Foreign key relationships require that the OE schema already exist when the PM schema is created. You need to know the password for OE to grant to PM the right to establish and use these foreign keys.


    Note:

    The PM schema requires the database to be enabled for the Java Virtual Machine (JVM) and interMedia. You can accomplish this during installation or afterward using the Database Configuration Assistant.

  4. Create the IX schema: The information exchange schema IX is based on order entry data in OE. Again, foreign key relationships require that the OE schema already be present when the IX schema is created. You need to know the password for OE to grant to IX the right to establish and use these foreign keys.

  5. Create the SH schema. The SH schema logically depends on the OE schema, although nothing prevents you from creating this schema on its own, without the four other schemas.

Installing the Human Resources (HR) Schema

All scripts necessary to create this schema reside in $ORACLE_HOME/demo/schema/human_resources.

You need to call only one script, hr_main.sql, to create all objects and load the data. Running hr_main.sql accomplishes the following tasks:

  1. Prompts for passwords and tablespace names used within the scripts.

  2. Removes any previously installed HR schema.

  3. Creates the user HR and grants the necessary privileges.

  4. Connects as HR.

  5. Calls the scripts that create and populate the schema objects.

For a complete listing of the scripts and their functions, please refer to Table 4-1.

A pair of optional scripts, hr_dn_c.sql and hr_dn_d.sql, is provided as a schema extension. To prepare the Human Resources schema for use with the Directory capabilities of Oracle Internet Directory, run the hr_dn_c.sql create script. If you want to return to the initial setup of the HR schema, use the script hr_dn_d.sql to reverse the effects of hr_dn_c.sql and remove the column added by this extension.

The file used to drop the HR schema is hr_drop.sql.

Installing the Order Entry (OE) Schema and its Online Catalog (OC) Subschema

All scripts necessary to create this schema reside in $ORACLE_HOME/demo/schema/order_entry.

You need to call only one script, oe_main.sql, to create all objects and load the data. Running oe_main.sql accomplishes the following tasks:

  1. Prompts for passwords and tablespace names used within the scripts.

  2. Removes any previously installed OE schema.

  3. Creates the user OE and grants the necessary privileges.

  4. Connects as OE.

  5. Calls the scripts that create and populate the schema objects.

For a complete listing of the scripts and their functions, please refer to Table 4-2.

The files used to drop the OE schema and OC subschema are oe_drop.sql and oc_drop.sql.

Installing the Product Media (PM) Schema

All files necessary to create this schema reside in $ORACLE_HOME/demo/schema/product_media.

You need to call only one script, pm_main.sql, to create all objects and load the data. Running pm_main.sql accomplishes the following tasks:

  1. Prompts for passwords and tablespace names used within the scripts, as well as datafile and log file directories.

  2. Removes any previously installed PM schema.

  3. Creates the user PM and grants the necessary privileges.

  4. Connects as PM.

  5. Calls the following scripts that create and populate the schema objects.

For a complete listing of the scripts and their functions, please refer to Table 4-3.

The file used to drop the PM schema is pm_drop.sql.


Note:

The SQL*Loader data file pm_p_lob.dat contains hard-coded absolute path names that have been set during installation. Before attempting to load the data in a different environment, you should first edit the path names in this file.

Installing the Information Exchange (IX) Schema

All files necessary to create this schema reside in $ORACLE_HOME/demo/schema/info_exchange.

You need to call only one script, ix_main.sql, to create all objects and load the data. Running ix_main.sql accomplishes the following tasks:

  1. Prompts for passwords and tablespace names used within the scripts.

  2. Removes any previously installed IX schema.

  3. Creates the user IX and grants the necessary privileges.

  4. Connects as IX.

  5. Calls the scripts that create and populate the schema.

For a complete listing of the scripts and their functions, please refer to Table 4-4.

The file used for dropping all queues in an orderly fashion is ix_drop.sql.

Installing the Sales History (SH) Schema

All files necessary to create this schema reside in $ORACLE_HOME/demo/schema/sales_history.

You need to call only one script, sh_main.sql, to create all objects and load the data. Running sh_main.sql accomplishes the following tasks:

  1. Prompts for passwords and tablespace names used within the scripts, as well as datafile and log file directories.

  2. Removes any previously installed SH schema.

  3. Creates the user SH and grants the necessary privileges.

  4. Connects as SH.

  5. Calls the scripts that create and populate the schema objects.

For a complete listing of the scripts and their functions, please refer to Table 4-5.


Note:

The dimension tables PROMOTIONS, CUSTOMERS, PRODUCTS and the fact table SALES are loaded by SQL*Loader. Then, two directory paths are created inside the database to point to the load and log file locations. This allows the loading of the table COSTS by using the external table sales_transactions_ext.

A pair of optional scripts, sh_olp_c.sql and sh_olp_d.sql, is provided as a schema extension. To prepare the Sales History schema for use with the advanced analytic capabilities of OLAP Services, run the sh_olp_c.sql create script. If you want to return to the initial setup of the SH schema, use the script sh_olp_d.sql to erase the effects of sh_olp_c.sql and reinstate dimensions as they were before.

The file used to drop the SH schema is sh_drop.sql.