Skip to content

Commit 453bfac

Browse files
gvenzlgithub-actions[bot]mostafavtpChrisSaxonOra
authored
23.1 sample schema release (#15)
* Introducing 21c HR schema version Signed-off-by: Gerald Venzl <[email protected]> * Fix ReadMe typo Signed-off-by: Gerald Venzl <[email protected]> * Fix ReadMe typo Signed-off-by: Gerald Venzl <[email protected]> * Fix ReadMe typo Signed-off-by: Gerald Venzl <[email protected]> * Update release date Signed-off-by: Gerald Venzl <[email protected]> * Update release date Signed-off-by: Gerald Venzl <[email protected]> * Fix ReadMe.md typo Signed-off-by: Gerald Venzl <[email protected]> * Fix ReadMe.txt typo Signed-off-by: Gerald Venzl <[email protected]> * Use full word file names Signed-off-by: Gerald Venzl <[email protected]> * Use full word file names Signed-off-by: Gerald Venzl <[email protected]> * Update comment section on user creation Signed-off-by: Gerald Venzl <[email protected]> * Standardize comments Signed-off-by: Gerald Venzl <[email protected]> * reduce privileges for schema Signed-off-by: Gerald Venzl <[email protected]> * Update template formatting Signed-off-by: Gerald Venzl <[email protected]> * Move user creation to install script Signed-off-by: Gerald Venzl <[email protected]> * Merge table and index creation into co_create.sql Signed-off-by: Gerald Venzl <[email protected]> * Add views creation into co_create Signed-off-by: Gerald Venzl <[email protected]> * Move constraints into co_create Signed-off-by: Gerald Venzl <[email protected]> * Move comments into co_create Signed-off-by: Gerald Venzl <[email protected]> * remove co_ddl.sql no longer needed Signed-off-by: Gerald Venzl <[email protected]> * Move inserts into co_populate.sql Signed-off-by: Gerald Venzl <[email protected]> * Move products into co_populate Signed-off-by: Gerald Venzl <[email protected]> * move stores into populate Signed-off-by: Gerald Venzl <[email protected]> * Move orders into populate Signed-off-by: Gerald Venzl <[email protected]> * Move shipments into populate Signed-off-by: Gerald Venzl <[email protected]> * Move order_items into populate Signed-off-by: Gerald Venzl <[email protected]> * Move inventory into populate Signed-off-by: Gerald Venzl <[email protected]> * insert into portion finished Signed-off-by: Gerald Venzl <[email protected]> * integrate identity column value restart into co_populate Signed-off-by: Gerald Venzl <[email protected]> * Remove dml setup files now part of co_populate Signed-off-by: Gerald Venzl <[email protected]> * Move drops into uninstall script Signed-off-by: Gerald Venzl <[email protected]> * formatting Signed-off-by: Gerald Venzl <[email protected]> * formatting Signed-off-by: Gerald Venzl <[email protected]> * change column definition Signed-off-by: Gerald Venzl <[email protected]> * Add installation verification Signed-off-by: Gerald Venzl <[email protected]> * Update data Signed-off-by: Gerald Venzl <[email protected]> * do not send NULL in INSERT INTO store queries Signed-off-by: Gerald Venzl <[email protected]> * Update HR ReadMes Signed-off-by: Gerald Venzl <[email protected]> * ReadMe updates Signed-off-by: Gerald Venzl <[email protected]> * Fix Typo in comment Signed-off-by: Gerald Venzl <[email protected]> * Fix Typo in comment Signed-off-by: Gerald Venzl <[email protected]> * Formatting and typo fix Signed-off-by: Gerald Venzl <[email protected]> * Formatting Signed-off-by: Gerald Venzl <[email protected]> * Use BEGIN/END blocks for INSERTs Signed-off-by: Gerald Venzl <[email protected]> * Add schema overwrite check Signed-off-by: Gerald Venzl <[email protected]> * Update schema overwrite check and position Signed-off-by: Gerald Venzl <[email protected]> * Update schema overwrite check and position Signed-off-by: Gerald Venzl <[email protected]> * Use exit instead of disconnect to keep parity with when errors occur Signed-off-by: Gerald Venzl <[email protected]> * Add installation description Signed-off-by: Gerald Venzl <[email protected]> * Retire OE schema Signed-off-by: Gerald Venzl <[email protected]> * Fix minor typos in HR/CO ReadMe's Signed-off-by: Gerald Venzl <[email protected]> * Archive BI schema Signed-off-by: Gerald Venzl <[email protected]> * Remove trailing space Signed-off-by: Gerald Venzl <[email protected]> * Archive PM schema Signed-off-by: Gerald Venzl <[email protected]> * Updated SH schema install Signed-off-by: Gerald Venzl <[email protected]> * Make ARCHIVED more prominent Signed-off-by: Gerald Venzl <[email protected]> * Remove IX schema Signed-off-by: Gerald Venzl <[email protected]> * Remove QS Signed-off-by: Gerald Venzl <[email protected]> * Remove old install scripts Signed-off-by: Gerald Venzl <[email protected]> * Update top level READMEs Signed-off-by: Gerald Venzl <[email protected]> * Update copyright to 2023 Signed-off-by: Gerald Venzl <[email protected]> * Update LICENSE.md Signed-off-by: Gerald Venzl <[email protected]> * Update contributing Signed-off-by: Gerald Venzl <[email protected]> * Fix typo Signed-off-by: Gerald Venzl <[email protected]> * co_main.sql no longer used Signed-off-by: Gerald Venzl <[email protected]> * Remove empty line in CUSTOMERS table DDL Signed-off-by: Gerald Venzl <[email protected]> * Fix typos in ReadMes Signed-off-by: Gerald Venzl <[email protected]> * Fix typo Signed-off-by: Gerald Venzl <[email protected]> * sample_queries.sql was never used Signed-off-by: Gerald Venzl <[email protected]> * Retire BI schema, never used Signed-off-by: Gerald Venzl <[email protected]> * Update SQLcl requirement for SH Signed-off-by: Gerald Venzl <[email protected]> * Update ReadMes Signed-off-by: Gerald Venzl <[email protected]> * 23.1 release candidate Signed-off-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> * 23.1 release candidate (#13) * place some missing ";" place some missing ";" to end of commands that create error when executing file. * Retire OE schema Signed-off-by: Gerald Venzl <[email protected]> * Fix minor typos in HR/CO ReadMe's Signed-off-by: Gerald Venzl <[email protected]> * Archive BI schema Signed-off-by: Gerald Venzl <[email protected]> * Remove trailing space Signed-off-by: Gerald Venzl <[email protected]> * Archive PM schema Signed-off-by: Gerald Venzl <[email protected]> * Updated SH schema install Signed-off-by: Gerald Venzl <[email protected]> * Make ARCHIVED more prominent Signed-off-by: Gerald Venzl <[email protected]> * Remove IX schema Signed-off-by: Gerald Venzl <[email protected]> * Remove QS Signed-off-by: Gerald Venzl <[email protected]> * Remove old install scripts Signed-off-by: Gerald Venzl <[email protected]> * Update top level READMEs Signed-off-by: Gerald Venzl <[email protected]> * Update copyright to 2023 Signed-off-by: Gerald Venzl <[email protected]> * Update LICENSE.md Signed-off-by: Gerald Venzl <[email protected]> * Update contributing Signed-off-by: Gerald Venzl <[email protected]> * Fix typo Signed-off-by: Gerald Venzl <[email protected]> * co_main.sql no longer used Signed-off-by: Gerald Venzl <[email protected]> * Remove empty line in CUSTOMERS table DDL Signed-off-by: Gerald Venzl <[email protected]> * Fix typos in ReadMes Signed-off-by: Gerald Venzl <[email protected]> * Fix typo Signed-off-by: Gerald Venzl <[email protected]> * sample_queries.sql was never used Signed-off-by: Gerald Venzl <[email protected]> * Retire BI schema, never used Signed-off-by: Gerald Venzl <[email protected]> * Update SQLcl requirement for SH Signed-off-by: Gerald Venzl <[email protected]> * Update ReadMes Signed-off-by: Gerald Venzl <[email protected]> * 23.1 release candidate Signed-off-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: Gerald Venzl <[email protected]> Signed-off-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mostafavtp <[email protected]> Co-authored-by: Chris Saxon <[email protected]> Co-authored-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: Gerald Venzl <[email protected]> Signed-off-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mostafavtp <[email protected]> Co-authored-by: Chris Saxon <[email protected]>
1 parent 3b12adf commit 453bfac

File tree

140 files changed

+1078953
-2206713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1078953
-2206713
lines changed

CONTRIBUTING.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
1-
*Due to widespread dependence on these scripts in their current form,
2-
no pull requests for changes can be accepted.*
1+
# Contributing to Oracle Database Sample Schemas
2+
3+
Because these samples schemas are being used inside the Oracle Database Documentation
4+
and other resources larger contributions may not be accepted.
5+
We welcome minor corrections such as fixed for typos, formatting, etc.
6+
7+
Pull requests can be made under
8+
[The Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html)
9+
(OCA).
10+
11+
For pull requests to be accepted into this repository, the bottom of
12+
your commit message must have the following line using your name and
13+
e-mail address as it appears in the OCA Signatories list.
14+
15+
```
16+
Signed-off-by: Your Name <[email protected]>
17+
```
18+
19+
This can be automatically added to pull requests by committing with:
20+
21+
```
22+
git commit --signoff
23+
```
24+
25+
Only pull requests from committers that can be verified as having
26+
signed the OCA can be accepted.

LICENSE.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Copyright (c) 2015 Oracle
1+
```
2+
Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
23

34
Permission is hereby granted, free of charge, to any person obtaining
45
a copy of this software and associated documentation files (the
@@ -18,3 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1819
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1920
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2021
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
```

README.md

Lines changed: 48 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -1,186 +1,76 @@
11
# Oracle Database Sample Schemas
22

3-
Copyright (c) 2019 Oracle
4-
5-
Permission is hereby granted, free of charge, to any person obtaining
6-
a copy of this software and associated documentation files (the
7-
"Software"), to deal in the Software without restriction, including
8-
without limitation the rights to use, copy, modify, merge, publish,
9-
distribute, sublicense, and/or sell copies of the Software, and to
10-
permit persons to whom the Software is furnished to do so, subject to
11-
the following conditions:
12-
13-
The above copyright notice and this permission notice shall be
14-
included in all copies or substantial portions of the Software.
15-
16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23-
243
## 1. Introduction
254

26-
This repository contains a copy of the Oracle Database sample schemas
27-
that are installed with Oracle Database Enterprise Edition. These
28-
schemas are used in Oracle documentation to show SQL language
29-
concepts and other database features. The schemas themselves are
30-
documented in [Oracle Database Sample Schemas](https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=COMSC).
31-
32-
The schemas are:
33-
34-
- HR: *Human Resources*
35-
- OE: *Order Entry*
36-
- PM: *Product Media*
37-
- IX: *Information Exchange*
38-
- SH: *Sales History*
39-
- BI: *Business Intelligence*
5+
The [Oracle Database Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html) and other resources use these sample schemas to demonstrate the capabilities of [Oracle Database](https://www.oracle.com/database/) and the SQL and PL/SQL languages. You can download and install these schemas in your database environments to learn about Oracle Database functionality or try the examples in the documentation. **These schemas are provided for free.**
406

41-
*Due to widespread dependence on these scripts in their current form,
42-
no pull requests for changes can be accepted.*
7+
The following schemas are included:
438

44-
In addition, a new schema CO: [Customer Orders](https://github.com/oracle/db-sample-schemas/tree/master/customer_orders), is now also
45-
included in this repository. It is not automatically installed along with
46-
the rest of the schemas at this time. Follow instructions in that schema's
47-
[README](https://github.com/oracle/db-sample-schemas/blob/master/README.md) to install the CO schema.
48-
49-
## 2. Installation
50-
51-
*CAUTION*: The first step in installing sample schemas is to drop
52-
user accounts with the following names: HR, OE, PM, IX, SH and BI.
53-
Do not proceed with the installation if you have schemas with any
54-
of these names that you wish to keep.
55-
56-
The installation scripts are designed to run on an Oracle Database.
57-
Privileged database access is required during installation.
58-
59-
The instructions below work on Linux and similar operating systems.
60-
Adjust them for other platforms.
61-
62-
### 2.1. Clone this repository
63-
64-
Login as the Oracle Database software owner and clone the repository, for example
65-
66-
```shell
67-
cd $HOME
68-
git clone https://github.com/oracle/db-sample-schemas.git
69-
```
70-
71-
or download and extract the ZIP file:
72-
73-
```shell
74-
unzip db-sample-schemas.zip
75-
```
76-
77-
The schema directory should be owned by the Oracle Database software owner.
78-
79-
### 2.2. Change directory
80-
81-
```shell
82-
cd $HOME/db-sample-schemas
83-
```
84-
85-
### 2.3. Change all embedded paths to match your working directory
86-
87-
The installation scripts need your current directory embedded in
88-
various locations. Use a text editor or the following Perl script to
89-
make the changes, replacing occurrences of the token `__SUB__CWD__`
90-
with your current working directory, for example
91-
`/home/oracle/db-sample-schemas`
92-
93-
```shell
94-
perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat
95-
```
9+
- `HR`: Human Resources
10+
- `CO`: Customer Orders
11+
- `SH`: Sales History
12+
- `OE`: Order Entry (**archived**)
13+
- `PM`: Product Media (**archived**)
9614

97-
### 2.4. Set the Oracle environment
15+
### Archived schemas
9816

99-
Skip this step when running on a client machine (one without an Oracle
100-
Database installed).
17+
Archived schemas are provided for reference for examples in the documentation but are no longer actively maintained.
10118

102-
```shell
103-
source /usr/local/bin/oraenv
104-
```
19+
## 2. Installing the Sample Schemas
10520

106-
*Note*: Oracle's `sqlldr` utility needs to be in `$PATH` for correct
107-
loading of the Product Media (PM) and Sales History (SH) schemas.
21+
1. Go to the [latest (or appropriate) release of the sample schemas](https://github.com/oracle-samples/db-sample-schemas/releases) and download the `Source code (zip)` file.
22+
2. Extract the downloaded .zip file.
23+
3. Inside the sample schemas main directory, navigate to the sample schema directory that you want to install and run the `<schema_name>_install.sql` script. (**For more information about installing a schema, see the `README.md` file in the schema directory.**)
24+
4. Review the installation verification at the end of the installation or in the generated installation log file.
10825

109-
### 2.5. Run the installation script
26+
#### Example
11027

111-
Review the [README.txt](#README.txt) for information on passwords and
112-
pre-requirements. In particular, verify your default and temporary
113-
tablespace names, and choose a password for each schema.
28+
To install the `HR` schema, complete the following steps:
11429

115-
Start SQL*Plus and run the top level installation script as
116-
discussed in [README.txt](#README.txt):
30+
1. `cd` into the `human_resources` folder.
31+
2. Connect to the target database with a privileged user.
32+
3. Run the `hr_install.sql` script and provide inputs for the prompts.
11733

11834
```shell
119-
sqlplus system/systempw@connect_string
120-
@mksample systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp /your/path/to/log/ connect_string
35+
cd human_resources
36+
sql <system>@<connect_string>
37+
@hr_install.sql
12138
```
12239

123-
*Note*: Use an absolute path and also append a trailing slash to the log directory name.
124-
125-
Use your current SYSTEM and SYS passwords, and also your actual
126-
default and temporary tablespace names. The passwords for the new
127-
HR, OE, PM, IX, SH and BI users will be set to the values you
128-
specify.
129-
130-
*Reminder*: currently the CO schema will not be installed as part of this
131-
process.
132-
133-
Using a connect string permits connections to non-container databases and
134-
pluggable database using the same syntax.
135-
136-
An example of connect strings for databases with services noncdb and pdb:
137-
```
138-
localhost:1521/noncdb
139-
localhost:1521/pdb
140-
```
141-
142-
### 2.6. Review the installation logs
143-
144-
Review output in your log directory for errors.
40+
## 3. Uninstalling the Sample Schemas
14541

146-
## 3. Removing the Samples
42+
1. Navigate to the sample schema folder that you want to uninstall and run the `<schema_name>_uninstall.sql` script. (**For more information about uninstalling a schema, see the `README.md` file in the schema directory.**)
43+
2. Check the output for any errors during the uninstallation process.
14744

148-
*CAUTION*: This will drop user accounts named HR, OE, PM, IX, SH and BI.
149-
150-
### 3.1. Set the Oracle environment
151-
152-
Skip this step when running on a client machine (one without an Oracle
153-
Database installed).
154-
155-
```shell
156-
source /usr/local/bin/oraenv
157-
```
158-
159-
### 3.2. Run the schema removal script
45+
## Contributing
16046

161-
```shell
162-
sqlplus system/systempw@connect_string
163-
@drop_sch.sql
164-
```
47+
Due to widespread dependence on these sample schemas, pull requests are carefully reviewed and not easily accepted. For bugs and enhancement requests, please file a GitHub issue. When filing an issue, please remember that the more detailed the report is, the faster it can be addressed. If you think that you have found a security vulnerability, do not raise a GitHub issue and follow the instructions in our [security guide](./SECURITY.md).
16548

166-
When prompted, enter the SYSTEM password, a log file name, and connect string.
49+
## Security
16750

168-
### 3.3 Run the CO schema removal script
51+
Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process.
16952

170-
If you have installed the CO schema, run the following script to remove it.
53+
## License
17154

172-
```shell
173-
sqlplus system/systempw@connect_string
174-
@co_drop_user.sql
17555
```
176-
## Contributing
177-
178-
This project is not accepting external contributions at this time. For bugs or enhancement requests, please file a GitHub issue unless it’s security related. When filing a bug remember that the better written the bug is, the more likely it is to be fixed. If you think you’ve found a security vulnerability, do not raise a GitHub issue and follow the instructions in our [security policy](./SECURITY.md).
56+
Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
17957
180-
## Security
181-
182-
Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process
58+
Permission is hereby granted, free of charge, to any person obtaining
59+
a copy of this software and associated documentation files (the
60+
"Software"), to deal in the Software without restriction, including
61+
without limitation the rights to use, copy, modify, merge, publish,
62+
distribute, sublicense, and/or sell copies of the Software, and to
63+
permit persons to whom the Software is furnished to do so, subject to
64+
the following conditions:
18365
184-
## License
66+
The above copyright notice and this permission notice shall be
67+
included in all copies or substantial portions of the Software.
18568
186-
Copyright (c) 2019, 2023 Oracle and/or its affiliates.
69+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
70+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
71+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
72+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
73+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
74+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
75+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
76+
```

0 commit comments

Comments
 (0)