No results found

Your search did not match any results.

We suggest you try the following to help find what you're looking for:

 

  • - Check the spelling of your keyword search.
  • - Use synonyms for the keyword you typed, for example, try “application” instead of “software.”
  • - Try one of the popular searches shown below.
  • - Start a new search.

 

Trending Questions

Using SQL Developer to Load and Query Data in Oracle Database Container

Using SQL Developer to Load and Query Data in Oracle Database Container

In this tutorial you will learn how to use SQL Developer to connect to a containerized Oracle Database and load the HR sample schema.

The Oracle Database used in this tutorial is a Docker container running in Oracle Container Cloud Service.

Overview

  1. Download SQL Developer
  2. Download Oracle Database Sample Schemas from GitHub
  3. Setup connection for SYS user
  4. Connect to database as SYS user and create HR user
  5. Setup connection for HR user
  6. Load HR schema
  7. View HR sample schema
  8. More: Explore database

Detailed Steps

  • b. Download the ZIP file from GitHub and extract the files to your local directory. For example, D:\oracle\data.
     
  • 3. Start SQL Developer. Setup connection for SYS user:
     
    • a. Right click on the Connections and create a New Connection.

b. Provide connection properties for the SYS user:

If you deployed the Oracle Database 12c EE from Docker Store, then you can obtain the default password and service name from the Setup Instructions of the container image in Docker Store. 

  • c. Click Save to save the connection information for the SYS user.
  • d. Click Connect to connect to the database as the SYS user.

4. Create HR user:

 
  • a. You are currently connected as the SYS user from previous step.
  • b. Create HR user. Copy and paste the following commands to the SQL Worksheet:
     
    
    CREATE USER hr IDENTIFIED BY welcome1;  ALTER USER hr DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;  ALTER USER hr TEMPORARY TABLESPACE temp;  GRANT CREATE SESSION, CREATE VIEW, ALTER SESSION, CREATE SEQUENCE TO hr;  GRANT CREATE SYNONYM, CREATE DATABASE LINK, RESOURCE, UNLIMITED TABLESPACE TO hr;  
  • c. Highlight all the commands and click on the Run Statement button.

d. You will see the execution status on the bottom portion. HR user is created successfully.

5. Set up connection for HR user:

 
  • a. Right click on the Connections and create a New Connection.
  • b. Provide connection properties for the HR user:
    - Password: welcome1
    - Hostname: Same value as in step 3b
    - Service Name: Same value as in step 3b

  • c. Click Save to save the connection information for the HR user.
  • d. Click Connect to connect to the database as the HR user.

6. Load HR schema:

 
  • a. You are currently connected as the HR user from previous step.
  • b. Run scripts: hr_cre.sql, hr_popul.sql, hr_idx.sql, hr_code.sql, hr_analz.sql
  • c. Browse for sql script on the local directory (from step 2b) and open the sql script:

d. SQL script is opened in SQL Developer. Click on the Run Script icon to execute the SQL script:

e. Select the HR connection if prompted:

f. Repeat for all the scripts in 6b.

7. View HR sample schema. Seven tables were created and populated with data.

8. More: Explore database

http://docs.oracle.com/database/122/TDDDG/two-day-developer-intro.htm