Giter Site home page Giter Site logo

veduket / db-sample-schemas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oracle-samples/db-sample-schemas

0.0 2.0 0.0 35.42 MB

Oracle Database Sample Schemas

Home Page: http://docs.oracle.com/database/121/COMSC/toc.htm

License: MIT License

PLSQL 34.67% XSLT 1.83% SQLPL 62.81% HTML 0.68%

db-sample-schemas's Introduction

Oracle Database Sample Schemas

Copyright (c) 2016 Oracle

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1. Introduction

This repository contains a copy of the Oracle Database sample schemas that are installed with Oracle Database Enterprise Edition 12c. These schemas are used in Oracle documentation to show SQL language concepts. The schemas themselves are documented in Oracle Database Sample Schemas, 12c Release 1 (12.1).

The schemas are:

  • HR: Human Resources
  • OE: Order Entry
  • PM: Product Media
  • IX: Information Exchange
  • SH: Sales History
  • BI: Business Intelligence

Due to widespread dependence on these scripts in their current form, no pull requests for changes can be accepted.

2. Installing the Samples

CAUTION: Do not install the samples if you already have user accounts named HR, OE, PM, IX, SH or BI.

The installation scripts are designed to run on a database host with Oracle Database 12.1. Privileged database access is required during installation.

The instructions below work on Linux and similar operating systems. Adjust them for other platforms.

An alternative to using this repository is to download and install the Oracle Database 12c Release 1 Examples package for your platform.

2.1. Clone this repository

Login as the Oracle Database software owner and clone the repository, for example

cd $HOME
git clone https://github.com/oracle/db-sample-schemas.git

or download and extract the ZIP file:

unzip db-sample-schemas.zip

The schema directory should be owned by the Oracle Database software owner.

2.2. Change directory

cd $HOME/db-sample-schemas

2.3. Change all embedded paths to match your working directory

The installation scripts need your current directory embedded in various locations. Use a text editor or the following Perl script to make the changes, replacing occurrences of the token __SUB__CWD__ with your current working directory, for example /home/oracle/db-sample-schemas

perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat 

2.4. Set the Oracle environment

source /usr/local/bin/oraenv

Note: Oracle's sqlldr utility needs to be in $PATH for correct loading of the Product Media (PM) and Sales History (SH) schemas.

2.5. Run the installation script

Review the README.txt for information on passwords and pre-requirements. In particular, verify your default and temporary tablespace names, and choose a password for each schema.

Start SQL*Plus and run the top level installation script as discussed in README.txt:

sqlplus system/systempw@connect_string
@mksample systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp /your/path/to/log/ connect_string

Note: Use an absolute path and also append a trailing slash to the log directory name.

Use your current SYSTEM and SYS passwords, and also your actual default and temporary tablespace names. The passwords for the new HR, OE, PM, IX, SH and BI users will be set to the values you specify.

Using a connect string permits connections to non-container databases and pluggable database using the same syntax.

An example of connect strings for databases with services noncdb and pdb:

  localhost:1521/noncdb
  localhost:1521/pdb

2.6. Review the installation logs

Review output in your log directory for errors.

3. Removing the Samples

CAUTION: This will drop user accounts named HR, OE, PM, IX, SH and BI.

3.1. Set the Oracle environment

source /usr/local/bin/oraenv

3.2. Run the schema removal script

sqlplus system/systempw@connect_string
@drop_sch.sql

When prompted, enter the SYSTEM password, a log file name, and connect string.

db-sample-schemas's People

Contributors

cjbj avatar gvenzl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.