Sample Schema Scripts
I have installed 10g application server and jdeveloper - but cannot find any of the scripts to create the sample schema. From searching the OTN forums it seams that the onl way of obtaing these scripts is to install the database or companion disk and run from the demo folder.
This seems a bit over the top - i had intended to use the infrastructure database, (my system dosn't have enough resources to install a seperate database), can any helpful person email the scripts, perhaps someone from oracle might be able to make this easier there seems to be a fair bit of interest in this on the forums.
Many thanks Terry Bennett
Hi Terry,
When you installed Oracle 10g, the demo tables should have been installed under the scott schema. Try select * from scott.emp and see if you get any results. Incase you are looking for the script for the demo tables, its in $ORACLE_HOME/rdbms/admin/utlsampl.sql (in my case its in C:\oracle\product\10.1.0\Db_1\RDBMS\ADMIN).
Hope that helps.
-Raj
Similar Messages
-
Missing Type Definitions on the SAmple Schema Script
Hi Gurus,
The following is the script taken from Oracle 9i Sample schemas page. Here the scripts for some types ORDSYS.ORDImage, ORDSYS.ORDImageSignature,ORDSYS.ORDVideo,ORDSYS.ORDAudio,ORDSYS.ORDDoc are not given.
Can you help me in getting those.
CREATE TABLE online_media
( product_id NUMBER(6)
, product_photo ORDSYS.ORDImage
, product_photo_signature ORDSYS.ORDImageSignature
, product_thumbnail ORDSYS.ORDImage
, product_video ORDSYS.ORDVideo
, product_audio ORDSYS.ORDAudio
, product_text CLOB
, product_testimonials ORDSYS.ORDDoc
) ;Does your database have Oracle Intermedia installed?
The other thing to check is whether your DBA has revoked execute on those objects from public. A couple of them served as vectors for DoS attacks against the database,
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Hi All!
Sample schemas (HR, OE, PM, QS, and SH) scripts are missing from 10g (10.2.0.1.0) on Win XP Pro(32-bit)
I have checked $ORACLE_HOME/demo/schema directory: There is subdirectory for each schema.
The scripts are not there or only some of them scripts are installed.
The list of correct scripts is hear:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14198/scripts.htm#sthref77
Where to get scripts to rebuild sample schemas manually?
Thank youWelcome to the forums !
The scripts should be available in the companion directory of the CD
http://download.oracle.com/docs/cd/B19306_01/server.102/b14198/installation.htm#I4367
HTH
Srini -
Oracle 11gR2 HR sample schema scripts not found
after installing oracle 11gR2 on Linux (software + create new database without sample schema); I want install sample HR schema now but the problem is
required scripts to create HR schema not found in 'demo' folder :
[oracle@host schema]$ pwd
/home/oracle/app/oracle/product/11.2.0/db_1/demo/schema
[oracle@host schema]$ ls -l
drwxr-xr-x 2 oracle dba 4096 Sep 4 07:41 bus_intelligence
-rw-r--r-- 1 oracle dba 2322 Apr 3 2009 drop_sch.sql
drwxr-xr-x 2 oracle dba 4096 Sep 9 12:59 human_resources
drwxr-xr-x 2 oracle dba 4096 Sep 4 07:49 log
-rw-r--r-- 1 oracle dba 1769 Sep 4 07:53 mk_dir.sql
-rw-r--r-- 1 oracle dba 1769 Sep 4 07:53 mk_dir.sql.ouibak
-rw-r--r-- 1 oracle dba 1600 Aug 16 2006 mk_dir.sql.sbs
-rw-r--r-- 1 oracle dba 27373 Jun 30 2007 mkplug.sql
drwxr-xr-x 3 oracle dba 4096 Sep 4 07:49 order_entry
drwxr-xr-x 2 oracle dba 4096 Sep 4 07:41 sales_history
-rw-r--r-- 1 oracle dba 15246 May 10 2005 sted_mkplug.sql.dbl
[oracle@host1 schema]$ ls human_resources/
hr_code.sql
what's wrong ??Pl post exact OS version. When installing the software, did you download and unzip all 7 DVDs or just the first 2 ? If just the first 2, you will need to download the examples separately
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linuxsoft-085393.html
or
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html
then follow instructions in the Samples Guide - http://docs.oracle.com/cd/E11882_01/server.112/e10831/toc.htm
HTH
Srini -
Where is HR Sample Schema Script for APEX 2.2
Just installed APEX 2.2 and am reviewing the 2-day developers guide. In there they give many examples based on an HR sample schema which they say can be downloaded from http://www.oracle.com/technology/products/database/application_express/code/hr_sample_schema.sql
I'm finding this address invalid. Does anyone know the right url for the script or can someone supply it to me?Hi skondolf1,
I don't know where that specific script is now, but you can also get the HR samle schema here: http://www.oracle.com/technology/obe/obe1013jdev/common/files/sample_schema_scripts9i10g.zip
Regards Pete -
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 -
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.... -
Where to download scripts for HR sample schema
Hi,
i installed Oracle11g on linux without sample schemas.
now i want to manually install the sample schemas.
and when i checked the folders under "../human_resources"
i am not able to view the scripts to install HR schema.
i tried a lot of google search but i am not able to find and download the scripts needed to create HR objects.
Can someone guide me where i can find scripts that i can download and install all the sample schema objects
Thanks,
Philip.It's part of the Companion install
-
Script or direction to add sample schema tables to database
I created a Database at installation time of oracle 10g exempting the sample schema tables to be added later. Iam ready to add it now and I can not find the way. Please, how?
Hi srideeq,
The sample schema you can find in
ORACLE_HOME/demo/schema
Cheera,
Kamalesh JK -
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 -
HI All
I am working on practice reports and following the oracle 10g toturail. There are sales, employee, departments, order, product etc tables. Kindly send me its schema if any one have.
It would be great help.The HR schema scripts are included on the 10g/11g install CD/Download and are included by default in the installation, however, the account is locked by default as well. If you have installed 10g using the default installation all you should need to do is unlock the account or simply use the schema prefix in your queries. If the HR schema is not there, you can extract the scripts here: Oracle 9i Sample Schemas.
Hope this helps,
Craig
If a response is helpful or correct, please mark it accordingly. -
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
Maybe you are looking for
-
ITunes crashes on "Add file to library" or "Add folder to library"
I'm on W7 64 bit. Upon trying to add anything to iTunes it immediately crashes with no usefull error message just windows saying the program has encountered a problem. I tried reinstalling and its doing the same thing, Any ideas?
-
AP_BUILD_SOURCING_PVT package
Hi, Im working with oracle applications 11.5.8 instance. I take Health check report for this as a daily practice. When i look into the report i found the DDL_TIME of the following packages getting modified frequently. Could you please help me out in
-
Exporting files to a eps postscript level one
hello all. We have just bought a new cutter plotter and the software that was supplied was artcut for a PC, I use a Mac and would like to use Illustrator (CS4) as the main design programme but to import the files into Artcut the need to be a eps post
-
Submit and redirect is not working in firefox or ie, works great in chrome.
I built a site to submit forms and it's great except that I was just informed it dosnt submit or redirect outside of chrome.
-
I Installed the latest ios8 upgrade on my iPad mini and now I can't iprint. The printer issues a 'urf error'.