Skip to content

Commit d7cb931

Browse files
authored
Merge pull request #3 from ChrisSaxonOra/customer_orders
This adds the new customer orders sample schema.
2 parents 004d5f3 + 3a54b31 commit d7cb931

15 files changed

+7261
-0
lines changed

customer_orders/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Customer Orders Sample Schema
2+
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+
24+
## 1. Introduction
25+
26+
The following contains instructions to install the customer orders sample schema.
27+
28+
This requires Oracle Database 12.1.0.2 or higher.
29+
30+
## 2. Installing the Schema
31+
32+
The installation scripts are designed to run on a database host with
33+
Oracle Database 12.1.0.2 or higher. Privileged database access is required
34+
during installation.
35+
36+
### 2.1. Clone the sample schemas repository
37+
38+
Login as the Oracle Database software owner and clone the repository, for example
39+
40+
```shell
41+
cd $HOME
42+
git clone https://github.com/oracle/db-sample-schemas.git
43+
```
44+
45+
or download and extract the ZIP file:
46+
47+
```shell
48+
unzip db-sample-schemas.zip
49+
```
50+
51+
### 2.2. Change directory
52+
53+
```shell
54+
cd $HOME/db-sample-schemas/customer_orders
55+
```
56+
57+
### 2.4. Set the Oracle environment
58+
59+
```shell
60+
source /usr/local/bin/oraenv
61+
```
62+
63+
### 2.5. Run the installation script
64+
65+
Review the [README.txt](#README.txt) for information on passwords and
66+
pre-requirements. In particular, verify your default and temporary
67+
tablespace names, and choose a password for the schema.
68+
69+
Start SQL*Plus and run the top level installation script as
70+
discussed in [README.txt](#README.txt):
71+
72+
```shell
73+
sqlplus system@connect_string
74+
@co_main copw connect_string users temp
75+
```
76+
77+
Use your actual default and temporary tablespace names. The passwords
78+
for the new CO user will be set to the value you specify.
79+
80+
Using a connect string permits connections to non-container databases and
81+
pluggable database using the same syntax.
82+
83+
An example of connect strings for databases with services noncdb and pdb:
84+
```
85+
localhost:1521/noncdb
86+
localhost:1521/pdb
87+
```
88+
89+
### 2.6. Review the installation logs
90+
91+
Review co_install.log for errors.
92+
93+
## 3. Removing the Sample
94+
95+
*CAUTION*: This will drop user account named CO.
96+
97+
### 3.1. Set the Oracle environment
98+
99+
```shell
100+
source /usr/local/bin/oraenv
101+
```
102+
103+
### 3.2. Run the schema removal script
104+
105+
```shell
106+
sqlplus system@connect_string
107+
@co_drop_user.sql
108+
```

customer_orders/README.txt

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
README.txt
2+
3+
Created 18-JUL-2019
4+
5+
Updated 18-JUL-2019
6+
7+
Copyright (c) 2019 Oracle
8+
9+
Permission is hereby granted, free of charge, to any person obtaining
10+
a copy of this software and associated documentation files (the
11+
"Software"), to deal in the Software without restriction, including
12+
without limitation the rights to use, copy, modify, merge, publish,
13+
distribute, sublicense, and/or sell copies of the Software, and to
14+
permit persons to whom the Software is furnished to do so, subject to
15+
the following conditions:
16+
17+
The above copyright notice and this permission notice shall be
18+
included in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27+
28+
------------------------------------------------------------------------
29+
30+
This document contains instructions to install the customer orders sample
31+
schema. This requires Oracle Database 12.1.0.2 or higher.
32+
33+
========================================================================
34+
35+
1. Instructions to create the schema:
36+
37+
38+
1.1 Decide on a password for the Sample Schema. Here, we are using
39+
placeholder names inside "<" and ">" brackets:
40+
41+
CO: <CO_password>
42+
43+
1.2 Verify the value for the default tablespace, and the temporary
44+
tablespace. For illustration purposes, the values are:
45+
46+
default tablespace: EXAMPLE
47+
temporary tablespace: TEMP
48+
49+
NOTE: Use your own passwords.
50+
51+
1.3 Verify the connect string for the database. For illustration
52+
purposes, the value of <connect_string> for database pdb is:
53+
54+
connect_string: localhost:1521/pdb
55+
56+
57+
The connect_string may also be a valid tnsnames.ora entry.
58+
59+
1.4 Invoke the Sample Schema creation script. Using the values listed
60+
in Sections 1.1, 1.2, and 1.3 the command would look like this:
61+
62+
SQL> @co_main <CO_password> localhost:1521/pdb EXAMPLE TEMP
63+
64+
1.4.1 To install the objects and data into an existing schema, run:
65+
66+
SQL> @co_ddl
67+
SQL> @co_dml
68+
69+
1.4.2 To refresh the data in existing tables in the current schema,
70+
run:
71+
72+
SQL> @co_dml
73+
74+
1.4.3 To remove the customer order objects in the current schema, run:
75+
76+
SQL> @co_drop_objects
77+
78+
1.4.5 To remove the CO user, run:
79+
80+
SQL> @co_drop_user

0 commit comments

Comments
 (0)