# Oracle Install sample schemas 21c

After the successful installation of oracle 19c or 21c on your windows 10 operating system. You have to create databases, tables, views, stored procedures, etc before you can start practicing the oracle.

If you are an absolute beginner then, a sample database might be a great help in the journey of learning the oracle database.

## Oracle Install sample schemas 21c

In this tutorial, we will show you step-by-step guidelines with the necessary screenshots to download, install and execute the oracle sample database.

The database is offered by the oracle to allow beginners and intermediate developers to quickly access a ready-made database. Below is the list of all the schemas that we will install on the oracle database:

• HR (Human Resources)
• OC (Online Catalog)
• OE (Order Entry)
• SH (Sales History)
• PM (Product Media)

It is not mandatory to install all the above-mentioned schemas on your device. You can choose to proceed with specific ones as well. This tutorial will cover both ways.

## Oracle Install all Sample Schemas

Step 1: Click on the link db-sample-schemas to visit oracle’s official GitHub page and from there download the source code under the Assets.

The latest version is for 21c and we are going to same the same but in case you want it for other versions then scroll down on the same GitHub page.

Step 2: Once the file is downloaded, extract it and then move all the files and folders inside C:\oracle21c\oracle_base\demo\schema\ this path may appear different in your system if you have not followed our blog on how to install oracle 21c.

Step 3: Open the mksample.sql file in edit mode and replace all the __SUB__CWD with the path C:\oracle21c\oracle_base\demo\schema\ also, change the forward-slash to backward slashes for only those rows which are shown in the below image.

After making the necessary changes file will look like the below image.

Step 4: Repeat the step 3 for all the main files present inside these schemas:

• \bus_intelligence\bi_main.sql
• \customer_orders\co_main.sql
• \human_resources\hr_main.sql
• \info_exchange\ix_main.py
• \order_entry\oe_main.sql
• \product_media\pm_main.sql
• \sales_history\sh_main.sql
• \shipping\qs_main.sql

Step 5: Log in to the oracle database with sysdba role and execute the below query.

-- login with sysdba role
/ as sysdba

-- install sample database
@C:\oracle21c\oracle_base\demo\schema\mksample.sql systempwd syspwd hrpwd oepwd pmpwd ixpwd shpwd bipwd USERS TEMP C:\oracle21c\oracle_base\demo\schema\log\ localhost:1521/orclpdb1

Parameters in Syntax:-

• @C:\oracle21c\oracle_base\demo\schema\mksample.sql path for mksample.sql file. This file has instructions to install all the tables and schemas
• Installation of schema requires system password, sys password, and password for that schema. we have provided passwords with the initials of the schema followed by PWD. So systempwd, syspwd are system and sys passwords whereas hrpwd, oepwd, ixpwd, shpwd, bipwd are the passwords for respective schemas.
• USERS is the tablespace name
• TEMP is the temporary table name
• C:\oracle21c\oracle_base\demo\schema\log\ it is the location to store log files
• localhost:1521/orclpdb1 these are the connection details (host:port/<container>or<pdb>)

## Oracle Install Single Sample Schemas

Oracle provides a wide variety of sample schemas so that users can practice the functionalities of oracle. These schemas are full-fledged with constraints and provide a good experience.

Out of available sample schemas, HR (Human Resource) is one of the popular schemas used by most developers to learn and teach the concepts of oracle.

In this section, we will learn how to install the HR (Human Resource) sample schema on the windows 10 operating system.

Step 1: Download the sample schema from the Official GitHub account of oracle. After downloading extract the file inside C:\oracle21c\oracle_base\demo\schema\

Step 2: Open hr_main.sql inside the human resource folder and replace all the __SUB__CWD with the path C:\oracle21c\oracle_base\demo\schema\.

Step 3: Start sqlplus and login as a sysdba user. Move to the container or pdb where you want to create the human resource database.

-- Log in to sqlplus with sysdba
/ as sysdba

-- move to container or pdb
Alter session set container=orclpdb1;

Step 4: Run the below command to create an HR(Human Resource) schema in your oracle database.

@C:\oracle21c\oracle_base\demo\schema\human_resources\hr_main.sql systempwd syspwd hrpwd  USERS TEMP C:\oracle21c\oracle_base\demo\schema\log\ localhost:1521/orclpdb1
• @C:\oracle21c\oracle_base\demo\schema\human_resources\hr_main.sql this is the location of the hr_main.sql file. This holds the step-by-step commands to create, insert, update, and delete the hr schema in oracle.
• The database requires a system, sys, and schema password. systempwd, syspwd, hrpwd are the passwords.
• We are using default tablespace i.e. USERS
• We are using a temporary user as TEMP
• C:\oracle21c\oracle_base\demo\schema\log\ this is the location to store the log files
• localhost:1521/orclpdb1 these are the connection details (host:port/<container>or<pdb>)

In this tutorial, we have learned how to install a sample schema in oracle 21c. We have covered both single schema installation and multiple schema installation.

Also, take a look at some more Oracle tutorials.