Sample schema oe_main.sql
Hi...Ive installed 10g db, Personal Edition and attempting to add the sample schemas HR/OE. I can find the hr_main.sql in the $ORACLE_HOME/.../demo folder. I now need the oe_main.sql to finish install of sample schemas for my purposes...
Does anyone have a copy or know where I can get the oe_main.sql for 10g and JDeveloper sample schemas?
Hopefully,
TC
Hi Lisa,
I cant be sure that they are the same as I dont have them to compare. I do know that when running the 9i version of hr_main.sql, we are prompted with multiple parameter entries, but when using 10g version we receive no parameter entries, just successful completion. In some of the called proceudres, there have been updates e.g hr_code.sql. This is from comparison of the hr code...have no idea with the oe code. Ive since tried reinstallations of 10g and now all the expected code cant be found...
There must be a source other than through the installation, where we can copy the same code from...similar to the 9i documentation which contained the full code in text...but then thats not Jdev but RDBMS docs...
Thanks,
Tony
Similar Messages
-
Loading 9i sample schemas?
These scripts are required to load the 9i sample schemas (dbmsxmlt.sql and prvtxmlt.plb scripts). Where do I get them?
nullhttp://www.oracle.com/technology/obe/obe1013jdev/common/obeconnection.htm#t1s1
Greetings...
Sim -
Can't find oe_main.sql and HR_main.sql
I have download and installed latest oracle database successfully (version 11g). When I followed instruction to install sample schema, I couldn't find hr.main.sql and oe_main.sql.
I only found hr_code.sql in demo/schema/human_resources directory.
There are a few sql files under order_entry directory like oe_views.sql. But I can't find oe_main.sql.
I have been struggle with it for a few days. I couldn't find the script file on Internet either. Please help me identify this problem. Thank you very much.It's been some time ago but I encounter terrible problems with companion cd now. I have downloaded the zip file with examples already couple times and always there are crc errors in the archive that corrupt the instalation. I hate it... but I need the examples...
What should I do?
Download Companion CD from Oracle 10g. This is gonna take another 2 hours with my connection, but let me see...
Edited by: prdola on Jul 4, 2009 7:26 AM -
Hi, Everyone,
I would like to know how to install a sample schema in oracle 11g database.
I have already installed oracle 11.1.0.6 on my server without the sample schema. Now i want to install the sample schemas in my database. Can anyone provide me with the steps on how to install it.
i am following this document
http://download.oracle.com/docs/cd/B28359_01/server.111/b28328/installation.htm#I6806
but the files it is mentioning .sql files for example in the hr folder i dont have this file...
'hr_main.sql'
i have only 'hr_code.sql'
so i feel that something is missing somewhere.. so could you people help me in this?
Thanks & RegardsCan't find oe_main.sql and HR_main.sql
HTH... -
10g Sample Schema code missing
Hi...On installation of 10g db (10.1.0.2.0), the expected sample schemas are not provided.
I have tried multiple installs in order to try and extract the sql scripts.
e.g. hr_main.sql, oe_main.sql and bi_main.sql.
These sample schemas are not the same as the 9i sample schemas, which can be accessed in text format in existing documentation for 9i.
Does anyone know where the actual scripts can be accessed other than from installation CDs and dowloaded installation...as neither provide the necessary scripts for the sample schemas?
Thanks,
Tonyi am also having same problem.
some one will provide the right info for you but you can try this too:
SQL> ALTER USER HR IDENTIFIED BY <password> account unlock;
User altered.
SQL> connect hr/<password>@<connection string/SID>;
Connected.
SQL> desc employees;
Name Null? Type
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
SQL> select * from employees;
EMPLOYEE_ID FIRST_NAME LAST_NAME
EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY
COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
198 Donald OConnell
DOCONNEL 650.507.9833 21-JUN-99 SH_CLERK 2600
124 50
199 Douglas Grant
DGRANT 650.507.9844 13-JAN-00 SH_CLERK 2600
124 50
200 Jennifer Whalen
JWHALEN 515.123.4444 17-SEP-87 AD_ASST 4400
101 10
201 Michael Hartstein
MHARTSTE 515.123.5555 17-FEB-96 MK_MAN 13000
100 20
202 Pat Fay
PFAY 603.123.6666 17-AUG-97 MK_REP 6000
201 20
203 Susan Mavris
SMAVRIS 515.123.7777 07-JUN-94 HR_REP 6500
101 40
204 Hermann Baer
HBAER 515.123.8888 07-JUN-94 PR_REP 10000
101 70
205 Shelley Higgins
SHIGGINS 515.123.8080 07-JUN-94 AC_MGR 12000
101 110
206 William Gietz
WGIETZ 515.123.8181 07-JUN-94 AC_ACCOUNT 8300
205 110
100 Steven King
SKING 515.123.4567 17-JUN-87 AD_PRES 24000
90
101 Neena Kochhar
NKOCHHAR 515.123.4568 21-SEP-89 AD_VP 17000
100 90
102 Lex De Haan
LDEHAAN 515.123.4569 13-JAN-93 AD_VP 17000
100 90
103 Alexander Hunold
AHUNOLD 590.423.4567 03-JAN-90 IT_PROG 9000
102 60
104 Bruce Ernst
BERNST 590.423.4568 21-MAY-91 IT_PROG 6000
103 60
105 David Austin
DAUSTIN 590.423.4569 25-JUN-97 IT_PROG 4800
103 60
106 Valli Pataballa
VPATABAL 590.423.4560 05-FEB-98 IT_PROG 4800
103 60
107 Diana Lorentz
DLORENTZ 590.423.5567 07-FEB-99 IT_PROG 4200
103 60
108 Nancy Greenberg
NGREENBE 515.124.4569 17-AUG-94 FI_MGR 12000
101 100
109 Daniel Faviet
DFAVIET 515.124.4169 16-AUG-94 FI_ACCOUNT 9000
108 100
110 John Chen
JCHEN 515.124.4269 28-SEP-97 FI_ACCOUNT 8200
108 100
111 Ismael Sciarra
ISCIARRA 515.124.4369 30-SEP-97 FI_ACCOUNT 7700
108 100
112 Jose Manuel Urman
JMURMAN 515.124.4469 07-MAR-98 FI_ACCOUNT 7800
108 100
113 Luis Popp
LPOPP 515.124.4567 07-DEC-99 FI_ACCOUNT 6900
108 100
114 Den Raphaely
EMPLOYEE_ID FIRST_NAME LAST_NAME
EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY
COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
DRAPHEAL 515.127.4561 07-DEC-94 PU_MAN 11000
100 30
115 Alexander Khoo
AKHOO 515.127.4562 18-MAY-95 PU_CLERK 3100
114 30
116 Shelli Baida
SBAIDA 515.127.4563 24-DEC-97 PU_CLERK 2900
114 30
117 Sigal Tobias
STOBIAS 515.127.4564 24-JUL-97 PU_CLERK 2800
114 30
118 Guy Himuro
GHIMURO 515.127.4565 15-NOV-98 PU_CLERK 2600
114 30
119 Karen Colmenares
KCOLMENA 515.127.4566 10-AUG-99 PU_CLERK 2500
114 30
120 Matthew Weiss
MWEISS 650.123.1234 18-JUL-96 ST_MAN 8000
100 50
121 Adam Fripp
AFRIPP 650.123.2234 10-APR-97 ST_MAN 8200
100 50
122 Payam Kaufling
PKAUFLIN 650.123.3234 01-MAY-95 ST_MAN 7900
100 50
123 Shanta Vollman
SVOLLMAN 650.123.4234 10-OCT-97 ST_MAN 6500
100 50
124 Kevin Mourgos
KMOURGOS 650.123.5234 16-NOV-99 ST_MAN 5800
100 50
125 Julia Nayer
JNAYER 650.124.1214 16-JUL-97 ST_CLERK 3200
120 50
126 Irene Mikkilineni
IMIKKILI 650.124.1224 28-SEP-98 ST_CLERK 2700
120 50
127 James Landry
JLANDRY 650.124.1334 14-JAN-99 ST_CLERK 2400
120 50
128 Steven Markle
SMARKLE 650.124.1434 08-MAR-00 ST_CLERK 2200
120 50
129 Laura Bissot
LBISSOT 650.124.5234 20-AUG-97 ST_CLERK 3300
121 50
130 Mozhe Atkinson
MATKINSO 650.124.6234 30-OCT-97 ST_CLERK 2800
121 50
131 James Marlow
JAMRLOW 650.124.7234 16-FEB-97 ST_CLERK 2500
121 50
132 TJ Olson
TJOLSON 650.124.8234 10-APR-99 ST_CLERK 2100
121 50
133 Jason Mallin
JMALLIN 650.127.1934 14-JUN-96 ST_CLERK 3300
122 50
134 Michael Rogers
MROGERS 650.127.1834 26-AUG-98 ST_CLERK 2900
122 50
135 Ki Gee
KGEE 650.127.1734 12-DEC-99 ST_CLERK 2400
122 50
136 Hazel Philtanker
HPHILTAN 650.127.1634 06-FEB-00 ST_CLERK 2200
122 50
137 Renske Ladwig
RLADWIG 650.121.1234 14-JUL-95 ST_CLERK 3600
EMPLOYEE_ID FIRST_NAME LAST_NAME
EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY
COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
123 50
138 Stephen Stiles
SSTILES 650.121.2034 26-OCT-97 ST_CLERK 3200
123 50
139 John Seo
JSEO 650.121.2019 12-FEB-98 ST_CLERK 2700
123 50
140 Joshua Patel
JPATEL 650.121.1834 06-APR-98 ST_CLERK 2500
123 50
141 Trenna Rajs
TRAJS 650.121.8009 17-OCT-95 ST_CLERK 3500
124 50
142 Curtis Davies
CDAVIES 650.121.2994 29-JAN-97 ST_CLERK 3100
124 50
143 Randall Matos
RMATOS 650.121.2874 15-MAR-98 ST_CLERK 2600
124 50
144 Peter Vargas
PVARGAS 650.121.2004 09-JUL-98 ST_CLERK 2500
124 50
145 John Russell
JRUSSEL 011.44.1344.429268 01-OCT-96 SA_MAN 14000
.4 100 80
146 Karen Partners
KPARTNER 011.44.1344.467268 05-JAN-97 SA_MAN 13500
.3 100 80
147 Alberto Errazuriz
AERRAZUR 011.44.1344.429278 10-MAR-97 SA_MAN 12000
.3 100 80
148 Gerald Cambrault
GCAMBRAU 011.44.1344.619268 15-OCT-99 SA_MAN 11000
.3 100 80
149 Eleni Zlotkey
EZLOTKEY 011.44.1344.429018 29-JAN-00 SA_MAN 10500
.2 100 80
150 Peter Tucker
PTUCKER 011.44.1344.129268 30-JAN-97 SA_REP 10000
.3 145 80
151 David Bernstein
DBERNSTE 011.44.1344.345268 24-MAR-97 SA_REP 9500
.25 145 80
152 Peter Hall
PHALL 011.44.1344.478968 20-AUG-97 SA_REP 9000
.25 145 80
153 Christopher Olsen
COLSEN 011.44.1344.498718 30-MAR-98 SA_REP 8000
.2 145 80
154 Nanette Cambrault
NCAMBRAU 011.44.1344.987668 09-DEC-98 SA_REP 7500
.2 145 80
155 Oliver Tuvault
OTUVAULT 011.44.1344.486508 23-NOV-99 SA_REP 7000
.15 145 80
156 Janette King
JKING 011.44.1345.429268 30-JAN-96 SA_REP 10000
.35 146 80
157 Patrick Sully
PSULLY 011.44.1345.929268 04-MAR-96 SA_REP 9500
.35 146 80
158 Allan McEwen
AMCEWEN 011.44.1345.829268 01-AUG-96 SA_REP 9000
.35 146 80
159 Lindsey Smith
LSMITH 011.44.1345.729268 10-MAR-97 SA_REP 8000
.3 146 80
160 Louise Doran
LDORAN 011.44.1345.629268 15-DEC-97 SA_REP 7500
.3 146 80
EMPLOYEE_ID FIRST_NAME LAST_NAME
EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY
COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
161 Sarath Sewall
SSEWALL 011.44.1345.529268 03-NOV-98 SA_REP 7000
.25 146 80
162 Clara Vishney
CVISHNEY 011.44.1346.129268 11-NOV-97 SA_REP 10500
.25 147 80
163 Danielle Greene
DGREENE 011.44.1346.229268 19-MAR-99 SA_REP 9500
.15 147 80
164 Mattea Marvins
MMARVINS 011.44.1346.329268 24-JAN-00 SA_REP 7200
.1 147 80
165 David Lee
DLEE 011.44.1346.529268 23-FEB-00 SA_REP 6800
.1 147 80
166 Sundar Ande
SANDE 011.44.1346.629268 24-MAR-00 SA_REP 6400
.1 147 80
167 Amit Banda
ABANDA 011.44.1346.729268 21-APR-00 SA_REP 6200
.1 147 80
168 Lisa Ozer
LOZER 011.44.1343.929268 11-MAR-97 SA_REP 11500
.25 148 80
169 Harrison Bloom
HBLOOM 011.44.1343.829268 23-MAR-98 SA_REP 10000
.2 148 80
170 Tayler Fox
TFOX 011.44.1343.729268 24-JAN-98 SA_REP 9600
.2 148 80
171 William Smith
WSMITH 011.44.1343.629268 23-FEB-99 SA_REP 7400
.15 148 80
172 Elizabeth Bates
EBATES 011.44.1343.529268 24-MAR-99 SA_REP 7300
.15 148 80
173 Sundita Kumar
SKUMAR 011.44.1343.329268 21-APR-00 SA_REP 6100
.1 148 80
174 Ellen Abel
EABEL 011.44.1644.429267 11-MAY-96 SA_REP 11000
.3 149 80
175 Alyssa Hutton
AHUTTON 011.44.1644.429266 19-MAR-97 SA_REP 8800
.25 149 80
176 Jonathon Taylor
JTAYLOR 011.44.1644.429265 24-MAR-98 SA_REP 8600
.2 149 80
177 Jack Livingston
JLIVINGS 011.44.1644.429264 23-APR-98 SA_REP 8400
.2 149 80
178 Kimberely Grant
KGRANT 011.44.1644.429263 24-MAY-99 SA_REP 7000
.15 149
179 Charles Johnson
CJOHNSON 011.44.1644.429262 04-JAN-00 SA_REP 6200
.1 149 80
180 Winston Taylor
WTAYLOR 650.507.9876 24-JAN-98 SH_CLERK 3200
120 50
181 Jean Fleaur
JFLEAUR 650.507.9877 23-FEB-98 SH_CLERK 3100
120 50
182 Martha Sullivan
MSULLIVA 650.507.9878 21-JUN-99 SH_CLERK 2500
120 50
183 Girard Geoni
GGEONI 650.507.9879 03-FEB-00 SH_CLERK 2800
120 50
EMPLOYEE_ID FIRST_NAME LAST_NAME
EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY
COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
184 Nandita Sarchand
NSARCHAN 650.509.1876 27-JAN-96 SH_CLERK 4200
121 50
185 Alexis Bull
ABULL 650.509.2876 20-FEB-97 SH_CLERK 4100
121 50
186 Julia Dellinger
JDELLING 650.509.3876 24-JUN-98 SH_CLERK 3400
121 50
187 Anthony Cabrio
ACABRIO 650.509.4876 07-FEB-99 SH_CLERK 3000
121 50
188 Kelly Chung
KCHUNG 650.505.1876 14-JUN-97 SH_CLERK 3800
122 50
189 Jennifer Dilly
JDILLY 650.505.2876 13-AUG-97 SH_CLERK 3600
122 50
190 Timothy Gates
TGATES 650.505.3876 11-JUL-98 SH_CLERK 2900
122 50
191 Randall Perkins
RPERKINS 650.505.4876 19-DEC-99 SH_CLERK 2500
122 50
192 Sarah Bell
SBELL 650.501.1876 04-FEB-96 SH_CLERK 4000
123 50
193 Britney Everett
BEVERETT 650.501.2876 03-MAR-97 SH_CLERK 3900
123 50
194 Samuel McCain
SMCCAIN 650.501.3876 01-JUL-98 SH_CLERK 3200
123 50
195 Vance Jones
VJONES 650.501.4876 17-MAR-99 SH_CLERK 2800
123 50
196 Alana Walsh
AWALSH 650.507.9811 24-APR-98 SH_CLERK 3100
124 50
197 Kevin Feeney
KFEENEY 650.507.9822 23-MAY-98 SH_CLERK 3000
124 50
107 rows selected.
SQL> you if you want to give access permission to SYS or System do:
SQL> grant select on employees to system;
Grant succeeded.
SQL> grant select on employees to sys;
Grant succeeded.
SQL> Its just worked for me.
HTH
Edited by: sayantan chakraborty on Aug 20, 2009 12:31 PM -
Oracle 9i Sample Schema running in client/server mode?
I've got Oracle 9i up on RH7.3 and have successfully executed the sample schema on the Server using the mksample.sql script.
Now the challenge is to run these same (sample schema) SQL scripts across a network using a 9i client. I copied the demo/schema files from the server installation to the client but when I invoke the mksample script the passwords have to include a connect_identifier which, in this environment, causes the subordinate scripts to get confused.
Has anyone else attempted to do this?You did not have to change any of your scripts to put the connect_identifier.
Within SQL*Plus you can use the "SET INSTANCE <connect_identifier>" command to make that Oracle instance
your default for this session. After you do this, all your connect statements will not require a
connect_identifier.
==============================================================
$ sqlplus /nolog
SQL> set instance ORA901
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
SQL> connect scott/tiger
Connected.
SQL>
==============================================================
As you can see, after the SET INSTANCE command, the connect command does not need a connect_identifier. -
Queries on samples schemas (HR, OE, SH ...)
Hi,
I want to measure performance of database using Oracle sample schema. But I don't have many time to create queries which take some time on CPU and so on. Is there any script (or webpage) which contain sample queries on this schemas? I will be appreciative if someone help me with it.
Best.The sample schemas are intended to allow practicing and exercising specific features of the database. The purpose of each schema is described in the 'Oracle® Database Sample Schemas' manual for your database version at http://tahiti.oracle.com. (See 'Master Book list' or 'All books'.)
Many of the examples of `how to use a feature`using these schemas will be found in the documentation (http://tahiti.oracle.com) related to the feature. For example, base queries will be found in the SQL Language Reference manual. Spatial features will be found in the Spatial Users Referrence manual. And so on.
Other than that, many of the samples found at htp://otn.oracle.com > Sample Code assume that the samples are installed.
Oracle university database language courses also assume the schemas are loaded. However, their sample code is not available for obvious reasons.
In all cases the samples are not performance oriented examples, simply because Oracle's cost-based optimizer can not provide consistent performance if size or statistics change. -
Oracle provided sample schema ??
I am new to Oralce
I have just install Oracel 9i on my desktop, but having problems install the sample schema (HR, OR......)
AS I have to manuly install the samle scheme, I followed the instuction given on the oracle website.
I connected Using SYSTEM as SYSDBA, and execute the provided script and given the parameter as below :
@?\DEMO\SCHEMA\HUMAN_RESOURCES\HR_MAIN.SQL
specify password for HR as parameter 1:
Enter value for 1: hr
specify default tablespeace for HR as parameter 2:
Enter value for 2: myspace ( I dont know what should be here , it is where things went worng i think. I got a error here ORA-00959: tablespace 'MYSPACE' does not exist)
specify temporary tablespace for HR as parameter 3:
Enter value for 3: temp
specify password for SYS as parameter 4:
Enter value for 4: sys
specify log path as parameter 5:
Enter value for 5: d:/Oracle_log
After the input, I got mainly the error message :
****** Creating REGIONS table ....
CREATE TABLE regions
ERROR at line 1:
ORA-01950: no privileges on tablespace 'SYSTEM'
I dont understand tablespace in oracle. I had a look in the HR script. It create user HR and then connect as HR then start to creat table. i dont understand why the tablespace is still 'SYSTEM'
Thanks for your helpThis looks like the doc you need:
http://otn.oracle.com/tech/xml/xdk_sample/pdf/xdksample_093001.pdf
Just do a search for the error text, it appears to be a sample that produces a deliberate error.
Cheers
Kevin -
How to create 9i db without sample schema?
I have (finally) gotten 9iR2 installed on RH 7.3.
During installation I created sample database instance TEST.
I then used dbca to create a second instance JSDB.
I did not see (but may have missed) dbca questions regarding wether or not to create/load sample database schema.
How best to create a database without the sample database schema?
If it can not be done, how best to expunge the sample database schema and all related litter?
There seems to be tables for SCOTT, HR, OE, SH, PM.
Thanks
R.Parr
Temporal ArtsTo drop SCOTT schema, run the batch file/shell script:
ORACLE_HOME\BIN\DEMODROP
To drop HR schema, run SQL script:
ORACLE_HOME\DEMO\SCHEMA\HUMAN_RESOURCES\HR_DROP.SQL
There are a number of other sample schema scripts to drop the other schemas installed with Oracle9i. If you can't find them easily, read the Sample Schema Guide on http://tahiti.oracle.com/.
Alison -
I have installed 10g xe. I am self training using the oracle press book "Oracle Database 10g A Beginner's Guide." However, the book indicates that the customer table, mentioned in chapter 2 is provided as part of the sample schema in 10g. But the only schema I have is HR. Is there a place where I can download and import the schemas mentioned in the book? Or must I install enterprise edition in order to work with them? Thanks to any that can assist.
The Order Entry (OE) schema builds on the purely relational Human Relations (HR) schema with some object-relational and object-oriented features. The OE schema contains seven tables: Customers, Product_Descriptions, Product_Information, Order_Items, Orders, Inventories, and Warehouses. The OE schema has links into the HR schema and PM schema. This schema also has synonyms defined on HR objects to make access transparent to users.
rem
rem Header: oe_cre.sql 09-jan-01
rem
rem Copyright (c) 2001, 2002, Oracle Corporation. All rights reserved.
rem
rem Owner : ahunold
rem
rem NAME
rem oe_cre.sql - create OE Common Schema
rem
rem DESCRIPTON
rem Creates database objects. The script assumes that the HR schema
rem is present.
rem
rem NOTES
rem The OIDs assigned for the object types are used to
rem simplify the setup of Replication demos and are not needed
rem in most unreplicated environments.
rem
rem MODIFIED (MM/DD/YY)
rem hyeh 08/29/02 - hyeh_mv_comschema_to_rdbms
rem ahunold 09/17/01 - FK in PRODUCT_DESCRIPTIONS
rem ahunold 04/25/01 - OID
rem ahunold 03/02/01 - eliminating DROP SEQUENCE
rem ahunold 01/30/01 - OE script headers
rem ahunold 01/24/01 - Eliminate extra lines from last merge
rem ahunold 01/05/01 - promo_id
rem ahunold 01/05/01 - NN constraints in product_descriptions
rem ahunold 01/09/01 - checkin ADE
PROMPT
PROMPT specify Sample Schema version as parameter 1:
DEFINE vrs = &1
PROMPT
-- ======================================================================
-- Type definitions
-- ======================================================================
CREATE TYPE cust_address_typ
OID '82A4AF6A4CD1656DE034080020E0EE3D'
AS OBJECT
( street_address VARCHAR2(40)
, postal_code VARCHAR2(10)
, city VARCHAR2(30)
, state_province VARCHAR2(10)
, country_id CHAR(2)
REM ===========================================================================
REM Create phone_list_typ varray to be varray column in customers table.
REM ===========================================================================
CREATE TYPE phone_list_typ
OID '82A4AF6A4CD2656DE034080020E0EE3D'
AS VARRAY(5) OF VARCHAR2(25);
REM ===========================================================================
REM Create customers table.
REM The cust_geo_location column will become MDSYS.SDO_GEOMETRY (spatial)
REM datatype when appropriate scripts and data are available.
REM ===========================================================================
DEFINE vscript = ?/demo/schema/order_entry/ccus_&vrs
@&vscript
CREATE UNIQUE INDEX customers_pk
ON customers (customer_id) ;
REM Both table and indexes are analyzed using the oe_analz.sql script.
ALTER TABLE customers
ADD ( CONSTRAINT customers_pk
PRIMARY KEY (customer_id)
REM ===========================================================================
REM Create warehouses table;
REM includes spatial data column wh_geo_location and
REM XML type warehouse_spec (was bug b41)
REM ===========================================================================
DEFINE vscript = ?/demo/schema/order_entry/cwhs_&vrs
@&vscript
CREATE UNIQUE INDEX warehouses_pk
ON warehouses (warehouse_id) ;
ALTER TABLE warehouses
ADD (CONSTRAINT warehouses_pk PRIMARY KEY (warehouse_id)
REM ===========================================================================
REM Create table order_items.
REM ===========================================================================
CREATE TABLE order_items
( order_id NUMBER(12)
, line_item_id NUMBER(3) NOT NULL
, product_id NUMBER(6) NOT NULL
, unit_price NUMBER(8,2)
, quantity NUMBER(8)
CREATE UNIQUE INDEX order_items_pk
ON order_items (order_id, line_item_id) ;
CREATE UNIQUE INDEX order_items_uk
ON order_items (order_id, product_id) ;
ALTER TABLE order_items
ADD ( CONSTRAINT order_items_pk PRIMARY KEY (order_id, line_item_id)
CREATE OR REPLACE TRIGGER insert_ord_line
BEFORE INSERT ON order_items
FOR EACH ROW
DECLARE
new_line number;
BEGIN
SELECT (NVL(MAX(line_item_id),0)+1) INTO new_line
FROM order_items
WHERE order_id = :new.order_id;
:new.line_item_id := new_line;
END;
REM ===========================================================================
REM Create table orders, which includes a TIMESTAMP column and a check
REM constraint.
REM ===========================================================================
DEFINE vscript = ?/demo/schema/order_entry/cord_&vrs
@&vscript
CREATE UNIQUE INDEX order_pk
ON orders (order_id) ;
ALTER TABLE orders
ADD ( CONSTRAINT order_pk
PRIMARY KEY (order_id)
REM ===========================================================================
REM Create inventories table, which contains a concatenated primary key.
REM ===========================================================================
CREATE TABLE inventories
( product_id NUMBER(6)
, warehouse_id NUMBER(3) CONSTRAINT inventory_warehouse_id_nn NOT NULL
, quantity_on_hand NUMBER(8)
CONSTRAINT inventory_qoh_nn NOT NULL
, CONSTRAINT inventory_pk PRIMARY KEY (product_id, warehouse_id)
REM ===========================================================================
REM Create table product_information, which contains an INTERVAL datatype and
REM a CHECK ... IN constraint.
REM ===========================================================================
CREATE TABLE product_information
( product_id NUMBER(6)
, product_name VARCHAR2(50)
, product_description VARCHAR2(2000)
, category_id NUMBER(2)
, weight_class NUMBER(1)
, warranty_period INTERVAL YEAR TO MONTH
, supplier_id NUMBER(6)
, product_status VARCHAR2(20)
, list_price NUMBER(8,2)
, min_price NUMBER(8,2)
, catalog_url VARCHAR2(50)
, CONSTRAINT product_status_lov
CHECK (product_status in ('orderable'
,'planned'
,'under development'
,'obsolete')
ALTER TABLE product_information
ADD ( CONSTRAINT product_information_pk PRIMARY KEY (product_id)
REM ===========================================================================
REM Create table product_descriptions, which contains NVARCHAR2 columns for
REM NLS-language information.
REM ===========================================================================
CREATE TABLE product_descriptions
( product_id NUMBER(6)
, language_id VARCHAR2(3)
, translated_name NVARCHAR2(50)
CONSTRAINT translated_name_nn NOT NULL
, translated_description NVARCHAR2(2000)
CONSTRAINT translated_desc_nn NOT NULL
CREATE UNIQUE INDEX prd_desc_pk
ON product_descriptions(product_id,language_id) ;
ALTER TABLE product_descriptions
ADD ( CONSTRAINT product_descriptions_pk
PRIMARY KEY (product_id, language_id));
ALTER TABLE orders
ADD ( CONSTRAINT orders_sales_rep_fk
FOREIGN KEY (sales_rep_id)
REFERENCES hr.employees(employee_id)
ON DELETE SET NULL
ALTER TABLE orders
ADD ( CONSTRAINT orders_customer_id_fk
FOREIGN KEY (customer_id)
REFERENCES customers(customer_id)
ON DELETE SET NULL
ALTER TABLE warehouses
ADD ( CONSTRAINT warehouses_location_fk
FOREIGN KEY (location_id)
REFERENCES hr.locations(location_id)
ON DELETE SET NULL
ALTER TABLE customers
ADD ( CONSTRAINT customers_account_manager_fk
FOREIGN KEY (account_mgr_id)
REFERENCES hr.employees(employee_id)
ON DELETE SET NULL
ALTER TABLE inventories
ADD ( CONSTRAINT inventories_warehouses_fk
FOREIGN KEY (warehouse_id)
REFERENCES warehouses (warehouse_id)
ENABLE NOVALIDATE
ALTER TABLE inventories
ADD ( CONSTRAINT inventories_product_id_fk
FOREIGN KEY (product_id)
REFERENCES product_information (product_id)
ALTER TABLE order_items
ADD ( CONSTRAINT order_items_order_id_fk
FOREIGN KEY (order_id)
REFERENCES orders(order_id)
ON DELETE CASCADE
enable novalidate
ALTER TABLE order_items
ADD ( CONSTRAINT order_items_product_id_fk
FOREIGN KEY (product_id)
REFERENCES product_information(product_id)
ALTER TABLE product_descriptions
ADD ( CONSTRAINT pd_product_id_fk
FOREIGN KEY (product_id)
REFERENCES product_information(product_id)
REM ===========================================================================
REM Create cross-schema synonyms
REM ===========================================================================
CREATE SYNONYM countries FOR hr.countries;
CREATE SYNONYM locations FOR hr.locations;
CREATE SYNONYM departments FOR hr.departments;
CREATE SYNONYM jobs FOR hr.jobs;
CREATE SYNONYM employees FOR hr.employees;
CREATE SYNONYM job_history FOR hr.job_history;
REM ===========================================================================
REM Create sequences
REM ===========================================================================
CREATE SEQUENCE orders_seq
START WITH 1000
INCREMENT BY 1
NOCACHE
NOCYCLE;
REM ===========================================================================
REM Need commit for PO
REM ===========================================================================
COMMIT;And yes, you must install at least Oracle SE to get completely this sample schemas on your file system :( -
Hello. I am reading a self teaching guide called databases demystified by andy oppel. In the book it says that a sample hr schema is used to demonstrate sql. It then leads the reader to download a free trial version of oracle personal edition from otn.oracle.com. In the sample the release that is being used is 9.2.0.10 it says that once opend to go to orahome92............I am a novice user and tried to download this and it did not work. I have tried to install this many times. Is there something that I am misssing. I read something about metalink. I do not have access to that so how can I use the sample download. Im sure that he would not put that download in the book if it was not readily availible to all to use. Could someone please help me with this. Do I need something special on my computer to make it work properly? Im using a reg household computer to study with and it is running one xp. Thanks
First of all, metalink is a paid oracle support site. Unless you dont have support from oracle, you can't access it.
Secondly, you can simply download the oracle software either 9i or 10g from the following link.
http://www.oracle.com/technology/software/products/database/oracle10g/index.html
Once you install oracle software and then create database (if you are creating database through wizard, using database configuration assistant, you will have all example schemas, like HR and other). You can also find scripts to create sample schema on the following directory structure:
oracle\ora92\demo\schema
Jaffar -
Hi forum,
I just bought "SQL Fundamentals I" from McGraw Hill. This book mentions several schemas and creation scripts like hr_main.sql,
oe_main.sql, ... ! Unfortunately I cannot find these scripts for download and it is not on the accompanying CD. In the meantime
I sestablished a 10G Express Database on my notebook for training purposes. The hr schema and the tables in question could
be found there. Does anyone know where to find the scripts necessary for studying this book ?
Kind regards
oeggert2706user11128142 wrote:
Hi forum,
I just bought "SQL Fundamentals I" from McGraw Hill. This book mentions several schemas and creation scripts like hr_main.sql,
oe_main.sql, ... ! Unfortunately I cannot find these scripts for download and it is not on the accompanying CD. In the meantime
I sestablished a 10G Express Database on my notebook for training purposes. The hr schema and the tables in question could
be found there. Does anyone know where to find the scripts necessary for studying this book ?
Kind regards
oeggert2706HR and OE etc. are standard schemas that come as part of the Database installation. Not sure about the express edition, but as Oracle provide them as example schemas, I don't see why they wouldn't be included with that version.
http://download.oracle.com/docs/cd/B12037_01/server.101/b10771/scripts003.htm
http://download.oracle.com/docs/cd/B13789_01/server.101/b10771/installation002.htm -
Script to create Sample Schemas
Hi,
I'd like to create sample schemas in my Oracle 11g DB.
1) I tried to use the DBCA, but it didn't give me any option to create them for my existing db.
2) I tried to see the scripts under \demo folder, but HR folder contained hr_code.sql script. No script for creating the tables and data.
3) I searched the companion CD (in 10g), and couldn't know how to obtain the script from there.
Any help is appreciated.Pavan,
This script mksample.sql is not in 11g(atleast in my system).
D:\oracle\product\11.1.0\db_1\demo\schema>dir mk*
Volume in drive D is VAIO
Volume Serial Number is 7476-8930
Directory of D:\oracle\product\11.1.0\db_1\demo\schema
06/30/2007 10:35 PM 28,262 mkplug.sql
02/09/2008 05:34 PM 1,775 mk_dir.sql
02/09/2008 05:34 PM 1,775 mk_dir.sql.ouibak
08/16/2006 10:10 AM 1,648 mk_dir.sql.sbs
4 File(s) 33,460 bytes
0 Dir(s) 12,980,768,768 bytes freeI have seen it in 10g but Ahmed is using 11g.
Cheers
Aman.... -
All Oracle Sample Schemas and all Oracle Built-in Packages in XE?
Hi,
I am trying to install Oracle 10g on my home system to improve my knowledge of PL/SQL. Because I'm doing it at home, I have to solve DBA issues I'm somewhat clueless about.
I would like to install Oracle 10g Express Edition and include the built-in packages (DBMS_OUTPUT, UTL_FILE, DBMS_UTILITY, DBMS_JOB, DBMS_JAVA, DBMS_RANDOM, etc.) as well as the Oracle sample schemas (HR, OE, PM, SH, and IX). None of these, except HR, is included in the express edition.
If necessary, I'd like to be able to install these things after installing the express edition. How can I do this?
Thanks,
MikeHi Mike,
checking the documentation is always helpful:
http://www.oracle.com/pls/xe102/homepage
http://download-uk.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25108/xedev_programs.htm#i2432
You can always do a quick search on the documentation homepage, e.g. for utl_file:
http://www.oracle.com/pls/xe102/search?remark=advanced_search&word=utl_file&format=ranked&book=&preference=
There shouldn't be a need to install any packages. They should come preinstalled already.
If not, you can find them here:
C:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN
Just be very careful before trying to install something into the data dictionary. If you are not experienced, you might mess up your database.
For example, utl_file is installed but invisible to most users, e.g. HR.
Look at this example:
SQL> conn hr/oracle1
Connect durchgef³hrt.
SQL> desc utl_file;
ERROR:
ORA-04043: Objekt "SYS"."UTL_FILE" ist nicht vorhanden
SQL> conn sys@XE as sysdba
Kennwort eingeben:
Connect durchgef³hrt.
SQL> desc utl_file;
PROCEDURE FCLOSE
Argument Name Typ In/Out Defaultwert?
FILE RECORD IN/OUT
ID BINARY_INTEGER IN/OUT
DATATYPE BINARY_INTEGER IN/OUT
BYTE_MODE BOOLEAN IN/OUT
PROCEDURE FCLOSE_ALL
SQL> grant execute on utl_file to HR;
Benutzerzugriff (Grant) wurde erteilt.
SQL> conn hr/oracle1
Connect durchgef³hrt.
SQL> desc utl_file;
PROCEDURE FCLOSE
Argument Name Typ In/Out Defaultwert?
FILE RECORD IN/OUT
ID BINARY_INTEGER IN/OUT
DATATYPE BINARY_INTEGER IN/OUT
BYTE_MODE BOOLEAN IN/OUT
PROCEDURE FCLOSE_ALL
PROCEDURE FCOPY
...So, after granting execute privileges on utl_file to HR, the user HR can now access utl_file. No need to install it.
The default packages are installed in the schema SYS.
Regards,
~Dietmar. -
Sample Schemas and Their Setup
Hi,
When I installed Oracle on my PC, the person guiding
me along said I should set up the usernames as shown
in the following table [sorry about the compression]:
Usernames LockAccount Password
sys No xxxxxxx
system No xxxxxxx
dbsnmp No xxxxxxx
aurora$jis$utility$ No xxxxxxx
aurora$orb$authenticated No xxxxxxx
scott No tiger
ose$http$admin No xxxxxxx
outln YES
wksys YES
qs_cbadm YES
qs_os YES
qs_es YES
sh YES
pm YES
oe YES
hr YES
qs_ws YES
qs YES
qs_adm YES
qs_cs YES
qs_cb YES
rman YES
olapdba YES
ctxsys YES
olapsvr YES
olapsys YES
mdsys YES
ordplugins YES
ordsys YES
outln YES
outln YES
outln YES
==========END=OF=DISPLAY=========================
Whenever I try to login as HR and use the HR schema
I have the following problem:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
SQL> connect hr/hr
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
=========END=OF=DISPLAY===========================
Could anyone suggest a solution to this problem ?
I would like to access all the demos, but I don't
see the Sample Schema Guide on tahiti.oracle.com,
as referenced in another question.
Thank you,
Robert FreemanJustin,
Thanks for your suggestion I found this advice
in another thread:
If you have a newly installed the database you
should unlock the HR schema and reset its password
since the password will be expired.
Login as SYS user
alter user hr account unlock;
alter user hr identified by hr;
Now you should be able to login to hr schema
When I executed the first alter I got the
following message:
SQL> connect sys/password as sysdba
Connected.
SQL> alter user hr account unlock;
alter user hr account unlock
ERROR at line 1:
ORA-01918: user 'HR' does not exist
So maybe I have two issues to resolve ?
Re-create the HR user and Re-Create the
HR's schema ?
Maybe you are looking for
-
My 5 year old daughter asked me to download a free app, tap pet store. THis I did and then she immediately downloaded the pocket gem upgrade costing £69.99!!! I have tried the customer support help line (35minute wait) then directed to express lane
-
Computer doesn't boot, stuck in white screen with Apple logo
I got a friend that has a MacBook 2.0GHz, Black. The computer had some sort of problem so he took out the HD and placed it into another computer (MacBook 2.2GHz, Black). For some reason whenever the computer boots, it gets stuck in the white screen w
-
Iphoto calendar to print issue.
When creating iphoto calendar to print the months of the year font changes to very small size. No text field available to change back.
-
I have an HP printer and I am now running out of ink. I have always bought HP cartridges but I see that you can find them much cheaper online and I am not sure if they are original or not. Do you buy them on line? If yes from which website? Did you
-
Sync with Google missing in Address Book
Hi there, My friend purchased Android phone and wants to sync it with iMac Address Book. Procedure is to sync it with GMail account and then it automatically syncs it with a phone. Sync utility in Address Book is found under PREFERENCES > SYNC WITH G