Sample Schemas
Sample Schemas
Sample Schemas
Table of Contents
Search
Download
Table of Contents
Expand AllCollapse All
List of Tables
Title and Copyright Information
Preface
1 Introduction to Sample Schemas
2 Installing Sample Schemas
o 2.1 Installing HR Schema Only
2.1.1 Installing HR Schema Using Database Configuration Assistant
2.1.2 Manually Installing the HR Schema
2.1.3 Uninstalling HR Schema
o 2.2 Installing Sample Schemas from GitHub
2.2.1 Resetting Sample Schemas
2.2.2 Uninstalling Sample Schemas
3 Schema Diagrams
4 Sample Schema Scripts and Object Descriptions
Index
Previous
Next
During a complete installation of Oracle Database, the HR schema can be installed either
manually or automatically when creating a database using the dbca option. All the other sample
schemas must be installed manually via the scripts available on GitHub.
By installing any of the Oracle Database sample schemas, you will drop any previously installed
schemas that use the following user names: HR, OE, PM, SH, IX, BI.
Data contained in any of these schemas will be lost if you run any of the installation scripts
described in this section. You should not use the sample schemas for your personal or business
data and applications. They are meant to be used for demonstration purposes only.
At the end of the installation process, a dialog box displays the accounts that have been created
and their lock status. By default, sample schemas are locked and their passwords are expired.
Before you can use a locked account, you must unlock it and reset its password. You can unlock
the accounts at this point in the installation process. Alternatively, after the installation
completes, you can unlock the schemas and reset their passwords by using the ALTER USER ...
ACCOUNT UNLOCK statement. For example:
See Also:
"Guidelines for Securing Passwords" in Oracle Database Security Guide for guidelines related to
creating secure passwords
You need to call only one script, hr_main.sql, to create all the objects and load the data. The
following steps provide a summary of the installation process:
1. Log on to SQL*Plus as SYS and connect using the AS SYSDBA privilege.
5. SQL> @?/demo/schema/human_resources/hr_main.sql
See Also:
2.1.3 Uninstalling HR Schema
If you need to remove the HR schema, run the following script on the SQL* Plus command line.
sqlplus system/systempw@connect_string
@drop_hr.sql
2.2 Installing Sample Schemas from GitHub
Starting with Oracle Database 12c Release 2, only the HR sample schema SQL scripts are
available in the $ORACLE_HOME/demo/schema/human_resources directory. If you want to use
sample schemas other than HR, such as OE, OC, PM, and SH schemas, you must download them
from the GitHub repository.
sqlplus system/systempw@connect_string
@mksample systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp
/your/path/to/log/ connect_string
In most situations, there is no difference between installing a Sample Schema for the first time or
reinstalling it over a previously installed version. The *_main.sql scripts drop the schema users
and all of their objects.
systempwd
SYSTEM
connect_string
sqlplus system/systempw@connect_string
@drop_sch.sql
Previous
Next
Was this page helpful?
© Oracle
About Oracle
Contact Us
Products A-Z
Terms of Use & Privacy
Cookie Preferences
Ad Choices