Oracle Sample Database
On this page
- Meta Description
- Target Keywords
- 1. HR (Human Resources) Schema
- 2. SH (Sales History) Schema
- 3. OE (Order Entry) Schema
- 4. PM (Product Media) Schema
- 5. IX (Information Exchange) Schema
- 6. CO (Customer Orders) Schema
- 7. SCOTT (Classic Legacy Schema)
- 8. Summary Table: At-a-Glance
- 9. How to Download the Sample Schemas
- Final Tips & Best Practices
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:Prompts for password, tablespace, and overwrite options.
@sh_install.sql
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
Schema | Era | Use Case | Installation Path |
---|---|---|---|
HR | Beginner | Employees, departments | hr_main.sql in human_resources/ |
SH | Intermediate | Sales analytics, BI | sh_install.sql |
OE | Intermediate | Orders, e‑commerce | oe_main.sql |
PM | Intermediate | Multimedia, media types | pm_main.sql |
IX | Advanced | Data exchange, AQ | via mksample |
CO | Modern | JSON, B2C sales | co_install.sql |
SCOTT | Legacy | Basic SQL demos | scott.sql or manual DDL |
9. How to Download the Sample Schemas
- Navigate to the GitHub releases page: https://github.com/oracle/db-sample-schemas/releases/latest
- Download the ZIP/TAR and extract to
$ORACLE_HOME/demo/schema
. - 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.