Oracle Sample Database

Meta Description

Discover Oracle sample databases like HR, OE, SH, SCOTT, and more—download them from GitHub or Oracle and install them in your Oracle environment to sharpen your skills.

Target Keywords

  • Oracle sample database
  • Oracle sample schemas download
  • Oracle HR OE SH sample schemas
  • Install Oracle sample schemas

1. HR (Human Resources) Schema

Why It Matters: Perfect for beginners. Learn basic tables like EMPLOYEES, DEPARTMENTS, and more. Download & Install:

  • Download installation scripts from Oracle’s GitHub: oracle/db-sample-schemas
  • To install (Oracle 12c+ and earlier):
    sqlplus sys as sysdba
    @?/demo/schema/human_resources/hr_main.sql
  • In Oracle 21c, HR isn’t shipped by default—manual install is required (docs).

2. SH (Sales History) Schema

Why Practice It: Contains star‑schema style tables—ideal for analytical and BI queries. Download & Install:

  • Grab the scripts from GitHub (same as above)
  • Requires SQLcl or SQL Developer:
    @sh_install.sql
    Prompts for password, tablespace, and overwrite options.

3. OE (Order Entry) Schema

Purpose: Great for intermediate-level exercises using orders, customers, products. Download & Install:

  • Available via GitHub repo
  • Run:
    @oe_main.sql [OE_pwd] [tablespace] [temp_ts] [HR_pwd] [SYS_pwd] [schema_path] [log_path] ... connect_string

4. PM (Product Media) Schema

What’s Inside: Multimedia metadata—great for exploring LOBs and media types. Download & Install:

  • Found in product_media/ directory:
    @pm_main.sql [PM_pwd] [tablespace] [temp_ts] [OE_pwd] [SYS_pwd] [schema_path] [log_path] ...

5. IX (Information Exchange) Schema

Use Case: Demonstrates messaging and B2B data exchange using advanced queuing. Download & Install:

  • Installation scripts in GitHub repository
  • Installed via @mksample or individual scripts.

6. CO (Customer Orders) Schema

Modern, JSON‑Enabled Example: A newer schema for e‑commerce and semi‑structured data. Download & Install:

  • Inside customer_orders/ folder:
    @co_install.sql

7. SCOTT (Classic Legacy Schema)

Why It’s Evergreen: Contains iconic EMP and DEPT tables using user SCOTT/TIGER. Download & Install:

  • Download from GitHub or other community repos
  • Or manually create user:
    ALTER USER scott IDENTIFIED BY tiger;

8. Summary Table: At-a-Glance

SchemaEraUse CaseInstallation Path
HRBeginnerEmployees, departmentshr_main.sql in human_resources/
SHIntermediateSales analytics, BIsh_install.sql
OEIntermediateOrders, e‑commerceoe_main.sql
PMIntermediateMultimedia, media typespm_main.sql
IXAdvancedData exchange, AQvia mksample
COModernJSON, B2C salesco_install.sql
SCOTTLegacyBasic SQL demosscott.sql or manual DDL

9. How to Download the Sample Schemas

  1. Navigate to the GitHub releases page: https://github.com/oracle/db-sample-schemas/releases/latest
  2. Download the ZIP/TAR and extract to $ORACLE_HOME/demo/schema.
  3. Run Perl replacement if needed:
    perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' */*.sql */*.dat

Final Tips & Best Practices

  • Install one schema per connection or drop dependencies first.
  • HR and SH can be installed individually; others may require the mksample script.
  • Run scripts with privileged user (SYS, SYSTEM) in SQL*Plus, SQLcl, or SQL Developer.
  • These are demo-only schemas—don’t use for production.