Oracle Class Setup
Version 11.2.0.3

General Information
Description This page contains the SQL statements that can be used in an Oracle database to create a database environment compatible with running library code samples and demos.
Edition Enterprise
Version 11.2.0.1 or above
 
As SYSDBA
Logon / as sysdba
Create Tablespace CREATE TABLESPACE uwdata
DATAFILE 'C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF' SIZE 250M
LOGGING FORCE LOGGING ONLINE PERMANENT BLOCKSIZE 8K
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K
SEGMENT SPACE MANAGEMENT AUTO;
Create Class User CREATE USER uwclass
IDENTIFIED BY uwclass
DEFAULT TABLESPACE uwdata
TEMPORARY TABLESPACE temp
QUOTA 0 ON SYSTEM
QUOTA 0 ON SYSAUX
QUOTA UNLIMITED ON uwdata;
Grant Privileges GRANT create session TO uwclass;
GRANT create cluster TO uwclass;
GRANT create database link TO uwclass;
GRANT create operator TO uwclass;
GRANT create procedure TO uwclass;
GRANT create sequence TO uwclass;
GRANT create synonym TO uwclass;
GRANT create table TO uwclass;
GRANT create trigger TO uwclass;
GRANT create type TO uwclass;
GRANT create view TO uwclass;
GRANT select any dictionary TO uwclass;
Unlock Oracle Demo Schemas ALTER USER scott ACCOUNT UNLOCK IDENTIFIED BY tiger;

ALTER USER hr ACCOUNT UNLOCK IDENTIFIED BY hr;

ALTER USER oe ACCOUNT UNLOCK IDENTIFIED BY oe;

ALTER USER pm ACCOUNT UNLOCK IDENTIFIED BY pm;

ALTER USER sh ACCOUNT UNLOCK IDENTIFIED BY sh;
 
As UWCLASS
Create Class Schema Objects conn uwclass/uwclass

Create the airplanes tables: Click Here

-- save this file as
c:\temp\airplanes.sql

Create the servers and serv_inst tables: Click Here

-- save this file as
c:\temp\servers.sql

Create the postal_code table: Click Here

-- save this file as
c:\temp\postal_code.sql

-- logged on as uwclass create the airplanes table
SQL> @c:\temp\airplanes.sql

-- logged on as uwclass create the servers and serv_inst tables
SQL> @c:\temp\servers.sql

-- logged on as uwclass create the postal_code table
SQL> @c:\temp\postal.sql

CREATE OR REPLACE VIEW xplan AS
SELECT * FROM TABLE(dbms_xplan.display('PLAN_TABLE',NULL,'ALL'));
 
As the operating system user "oracle"
In a terminal window using either Notepad ++ (Windows) or vi (*nix) add this text at the end of the current lines in the glogin.sql file.

The glogin.sql file is created at installation and is located in sqlplus/admin at the directory path pointed to by the $ORACLE_HOME environment variable.
set pagesize 45
set linesize 141
set long 1000000
col name format a30
col value format a30
col object_name format a30
col segment_name format a30
col file_name format a60
col data_type format a20

ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL';

Related Topics
SQL*Plus
Tables
Tablespaces
Users

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2013 Daniel A. Morgan All Rights Reserved