Oracle Database Sample Schema 23c

Oracle stellt aktualisierte Sampel Schemas für 23c zur Verfügung, die offiziell ab Oracle 19c unterstützt sind. Ich habe die Scripts auch mit Oracle 12.2 erfolgreich getestet.

Die wichtigsten Neuheiten sind:

  • Dateninhalte für die Schemas „Human Resources“ (HR), „Sales History“ (SH) und „Customer Orders“ (CO) wurden aktualisiert.
    • HR und CO funktionieren sowohl in Oracle SE2 als auch EE
    • SH benötigt auf Grund von Partitioning zwingend eine Oracle EE
  • Die Installation der Schemas kann unabhängig voneinander erfolgen, wobei man nur noch einen Benutzer mit DBA Privilegien benötigt (SYS/SYSTEM sind nicht mehr notwendig).
  • Die Installationsscripts fragen nach, ob eine vorhandene, ältere Version des Schemas installiert ist und droppen diese gegeben falls.
  • Es wird kein SQL*Loader mehr benötigt, die Scripts laden die Daten mittels INSERT Statements.
  • Die Schemas „Order Entry“ (OE), „Product Media“ (PM) gelten als archiviert und werden nicht mehr gepflegt.

Oracle stellt die jeweils aktuellen Sample Schemas auf github unter https://github.com/oracle-samples/db-sample-schemas/releases zur Verfügung.

Beispielinstallation Oracle 23c HR Schema in Oracle 19c Datenbank

Während der Installation muss man ein Passwort für den Schema User angeben, einen Tablespace auswählen (oder den Default USERS bestätigen) und gegeben falls erlauben das vorhandene Schema zuerst zu droppen. Der Output wurde etwas gekürzt.

sqlplus system/***@localhost/pdb1

SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 21 11:07:52 2023
Version 19.10.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.

Last Successful login time: Mon Apr 03 2023 15:42:59 +02:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0

SYSTEM@oel7/pdb1.intern.dbmasters.at> @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]: yes
Old HR schema has been dropped.
******  Creating REGIONS table ....

Table created.
Index created.
Table altered.

******  Creating COUNTRIES table ....

Table created.
Table altered.

******  Creating LOCATIONS table ....

Table created.
Index created.
Table altered.
Sequence created.

******  Creating DEPARTMENTS table ....

Table created.
Index created.
Table altered.
Sequence created.

******  Creating JOBS table ....

Table created.
Index created.
Table altered.

******  Creating EMPLOYEES table ....

Table created.
Index created.
Table altered.
Table altered.
Sequence created.

******  Creating JOB_HISTORY table ....

Table created.
Index created.
Table altered.

******  Creating EMP_DETAILS_VIEW view ...

View created.

******  Creating indexes ...

Index created.
...
Index created.

******  Adding table column comments ...

Comment created.
...
Comment created.
Session altered.

****** Populating REGIONS table ....

PL/SQL procedure successfully completed.

****** Populating COUNTRIES table ....

PL/SQL procedure successfully completed.

****** Populating LOCATIONS table ....

PL/SQL procedure successfully completed.

****** Populating DEPARTMENTS table ....

Table altered.
PL/SQL procedure successfully completed.

****** Populating JOBS table ....

PL/SQL procedure successfully completed.

****** Populating EMPLOYEES table ....

PL/SQL procedure successfully completed.

****** Populating JOB_HISTORY table ....

PL/SQL procedure successfully completed.
Commit complete.
Table altered.
Procedure created.
Trigger created.
Trigger altered.
Procedure created.
Trigger created.
Commit complete.

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 Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0

Die Installation der anderen Sample Schemas folgt diesem Schema.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.