更新: 2026年2月2日 インストールするサンプルスキーマをv23.3に更新
最近、GitHubからダウンロードできるオラクル・データベースのサンプル・スキーマが更新されました。以前よりもインストールが容易になった、とのことなので確認してみます。
1年以上前にサンプル・スキーマをAutonomous Databaseにインストールしようとした記事があります。その時点のサンプル・スキーマと比較すると、bus_intelligence、info_exchange、shippingのサンプルが無くなっています。また、order_entry、product_mediaは含まれていますが、これらは更新されていないようです。
customer_orders、human_resources、sales_historyの3つサンプルは更新され、それぞれ個別にインストールできるようになりました。
Autonomous Databaseでは、sales_history(スキーマSH)はバンドルされているため、customer_orders、human_resourcesがインストールできるサンプルになります。
サンプル・スキーマのGitHubリポジトリは以下になります。
https://github.com/oracle-samples/db-sample-schemas
今回はOracle AI Database 26ai Freeにサンプル・スキーマをインストールしてみます。PDBとしてFREEPDB1が作成済みで、このPDBにインストールします。
サンプル・スキーマのバージョン23.3のアーカイブをダウンロードします。
curl -OL https://github.com/oracle-samples/db-sample-schemas/archive/refs/tags/v23.3.zip[oracle@localhost ~]$ curl -OL https://github.com/oracle-samples/db-sample-schemas/archive/refs/tags/v23.3.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0
100 11.6M 0 11.6M 0 0 872k 0 --:--:-- 0:00:13 --:--:-- 2851k
[oracle@localhost ~]$
unzip v23.1.zip
[oracle@localhost ~]$ unzip v23.3.zip
Archive: v23.3.zip
e3325a83e56c516815844025418a96ecaf219751
creating: db-sample-schemas-23.3/
extracting: db-sample-schemas-23.3/.gitignore
inflating: db-sample-schemas-23.3/LICENSE.txt
inflating: db-sample-schemas-23.3/README.md
inflating: db-sample-schemas-23.3/README.txt
inflating: db-sample-schemas-23.3/SECURITY.md
creating: db-sample-schemas-23.3/customer_orders/
inflating: db-sample-schemas-23.3/customer_orders/README.md
[中略]
inflating: db-sample-schemas-23.3/sales_history/sh_create.sql
inflating: db-sample-schemas-23.3/sales_history/sh_install.sql
inflating: db-sample-schemas-23.3/sales_history/sh_populate.sql
inflating: db-sample-schemas-23.3/sales_history/sh_uninstall.sql
inflating: db-sample-schemas-23.3/sales_history/supplementary_demographics.csv
inflating: db-sample-schemas-23.3/sales_history/times.csv
[oracle@localhost ~]$
ls
[oracle@localhost ~]$ cd db-sample-schemas-23.3/
[oracle@localhost db-sample-schemas-23.3]$ ls
customer_orders LICENSE.txt product_media README.txt SECURITY.md
human_resources order_entry README.md sales_history
[oracle@localhost db-sample-schemas-23.3]$
[oracle@localhost customer_orders]$ sqlplus system@localhost/freepdb1
SQL*Plus: Release 23.26.0.0.0 - Production on Mon Feb 2 14:09:09 2026
Version 23.26.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: ******
Last Successful login time: Fri Jan 30 2026 14:05:58 +09:00
Connected to:
Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
SQL> @co_install
Thank you for installing the Oracle Customer Orders Sample Schema.
This installation script will automatically exit your database session
at the end of the installation or if any error is encountered.
The entire installation will be logged into the 'co_install.log' log file.
Enter a password for the user CO: ******
Enter a tablespace for CO [USERS]:
Do you want to overwrite the schema, if it already exists? [YES|no]:
****** Creating CUSTOMERS table ....
Table created.
****** Creating STORES table ....
Table created.
****** Creating PRODUCTS table ....
Table created.
****** Creating ORDERS table ....
Table created.
[中略]
Installation
-------------
Verification:
Table provided actual
----------- ---------- ----------
customers 392 392
stores 23 23
products 46 46
orders 1950 1950
shipments 1892 1892
order_items 3914 3914
inventory 566 566
Thank you!
--------------------------------------------------------
The installation of the sample schema is now finished.
Please check the installation verification output above.
You will now be disconnected from the database.
Thank you for using Oracle Database!
Disconnected from Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
[oracle@localhost customer_orders]$
[oracle@localhost human_resources]$ sqlplus system@localhost/freepdb1
SQL*Plus: Release 23.26.0.0.0 - Production on Mon Feb 2 14:11:13 2026
Version 23.26.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: *******
Last Successful login time: Mon Feb 02 2026 14:09:11 +09:00
Connected to:
Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
SQL> @hr_install
Thank you for installing the Oracle Human Resources Sample Schema.
This installation script will automatically exit your database session
at the end of the installation or if any error is encountered.
The entire installation will be logged into the 'hr_install.log' log file.
Enter a password for the user HR: ******
Enter a tablespace for HR [USERS]:
Do you want to overwrite the schema, if it already exists? [YES|no]:
****** Creating REGIONS table ....
Table created.
Index created.
Table altered.
****** Creating COUNTRIES table ....
Table created.
[中略]
Installation
-------------
Verification:
Table provided actual
----------- ---------- ----------
regions 5 5
countries 25 25
departments 27 27
locations 23 23
employees 107 107
jobs 19 19
job_history 10 10
Thank you!
--------------------------------------------------------
The installation of the sample schema is now finished.
Please check the installation verification output above.
You will now be disconnected from the database.
Thank you for using Oracle Database!
Disconnected from Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
[oracle@localhost human_resources]$
[oracle@localhost sales_history]$ sqlplus system@localhost/freepdb1
SQL*Plus: Release 23.26.0.0.0 - Production on Mon Feb 2 14:13:45 2026
Version 23.26.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: ********
Last Successful login time: Mon Feb 02 2026 14:11:15 +09:00
Connected to:
Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
SQL> @sh_install
Thank you for installing the Oracle Sales History Sample Schema.
This installation script will automatically exit your database session
at the end of the installation or if any error is encountered.
The entire installation will be logged into the 'sh_install.log' log file.
Enter a password for the user SH: ********
Enter a tablespace for SH [USERS]:
Do you want to overwrite the schema, if it already exists? [YES|no]:
Start time: 02-FEB-26 02.13.56.589735 PM +09:00
****** Creating COUNTRIES table ....
Table created.
****** Creating CUSTOMERS table ....
Table created.
****** Creating PROMOTIONS table ....
Table created.
****** Creating PRODUCTS table ....
Table created.
[中略]
Installation
-------------
Verification:
Table provided actual
-------------------------- ---------- ----------
channels 5 5
costs 82112 0
countries 35 35
customers 55500 0
products 72 72
promotions 503 0
sales 918843 0
times 1826 0
supplementary_demographics 4500 0
Thank you!
--------------------------------------------------------
The installation of the sample schema is now finished.
Please check the installation verification output above.
You will now be disconnected from the database.
Thank you for using Oracle Database!
Disconnected from Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
[oracle@localhost sales_history]$
## INSTALL INSTRUCTIONS
1. Run `perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat` in this folder
2. Connect as privileged user with rights to create another user (`SYSTEM`, `ADMIN`, etc.)
3. Run the `oe_main.sql` script passing on the following parameters:
1. `OE` schema name password
2. The tablespace name where to install the schema into
3. The temporary tablespace name for the `OE` user
4. The password of the `HR` user
5. The `SYS` password
6. The full path of this parent directory
7. The full path of a directory where to write the install log file to
8. The version number `3`
9. The connect string for the database you connected to
**Note:** If the `OE` schema already exists, it is removed/dropped and
a fresh `OE` schema is installed.
[oracle@localhost db-sample-schemas-23.3]$ export PATH=$ORACLE_HOME/perl/bin:$PATH
[oracle@localhost db-sample-schemas-23.3]$ perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' */*.sql */*.dat
[oracle@localhost db-sample-schemas-23.3]$
[oracle@localhost order_entry]$ sqlplus sys@localhost/freepdb1 as sysdba
SQL*Plus: Release 23.26.0.0.0 - Production on Mon Feb 2 14:22:06 2026
Version 23.26.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: ********
Connected to:
Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
SQL> @oe_main
specify password for OE as parameter 1:
Enter value for 1: ******
specify default tablespeace for OE as parameter 2:
Enter value for 2: USERS
specify temporary tablespace for OE as parameter 3:
Enter value for 3: TEMP
specify password for HR as parameter 4:
Enter value for 4: ******
specify password for SYS as parameter 5:
Enter value for 5: ******
specify directory path for the data files as parameter 6:
Enter value for 6: /home/oracle/db-sample-schemas-23.3/order_entry/
writeable directory path for the log files as parameter 7:
Enter value for 7: /home/oracle/
specify version as parameter 8:
Enter value for 8: v3
specify connect string as parameter 9:
Enter value for 9: localhost/freepdb1
DROP USER oe CASCADE
*
ERROR at line 1:
ORA-01918: user 'OE' does not exist
Help: https://docs.oracle.com/error-help/db/ora-01918/
old 1: CREATE USER oe IDENTIFIED BY &pass
new 1: CREATE USER oe IDENTIFIED BY oracle
User created.
old 1: ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new 1: ALTER USER oe DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS
User altered.
[中略]
Type body altered.
Type body altered.
PL/SQL procedure successfully completed.
Connected.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
SQL>
[oracle@localhost product_media]$ sqlplus sys@localhost/freepdb1 as sysdba
SQL*Plus: Release 23.26.0.0.0 - Production on Mon Feb 2 14:27:29 2026
Version 23.26.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Enter password: ******
Connected to:
Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free
Version 23.26.0.0.0
SQL> @pm_main
specify password for PM as parameter 1:
Enter value for 1: *****
specify default tablespeace for PM as parameter 2:
Enter value for 2: USERS
specify temporary tablespace for PM as parameter 3:
Enter value for 3: TEMP
specify password for OE as parameter 4:
Enter value for 4: oracle
specify password for SYS as parameter 5:
Enter value for 5: oracle
specify directory path for the PM data files as parameter 6:
Enter value for 6: /home/oracle/db-sample-schemas-23.3/product_media/
specify directory path for the PM load log files as parameter 7:
Enter value for 7: /home/oracle/
specify work directory path as parameter 8:
Enter value for 8: /home/oracle/db-sample-schemas-23.3/product_media/
specify connect string as parameter 9:
Enter value for 9: localhost/freepdb1
DROP USER pm CASCADE
*
ERROR at line 1:
ORA-01918: user 'PM' does not exist
Help: https://docs.oracle.com/error-help/db/ora-01918/
old 1: CREATE USER pm IDENTIFIED BY &pass
new 1: CREATE USER pm IDENTIFIED BY oracle
User created.
old 1: ALTER USER pm DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new 1: ALTER USER pm DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS
User altered.
old 1: ALTER USER pm TEMPORARY TABLESPACE &ttbs
new 1: ALTER USER pm TEMPORARY TABLESPACE TEMP
User altered.
[中略]
Path used: Conventional
Commit point reached - logical record count 15
Commit point reached - logical record count 16
Table PRINT_MEDIA:
4 Rows successfully loaded.
Table TEXTDOCS_NESTEDTAB:
12 Rows successfully loaded.
Check the log file:
/home/oracle/pm_p_lob.log
for more information about the load.
PL/SQL procedure successfully completed.
SQL>