0% found this document useful (0 votes)
216 views3 pages

1 Mksample

Rem Rem mksample.sql - creates all 5 Oracle9i Sample Schemas Rem Rem Rem DESCRIPTION Rem this script rees and creates all schemas belonging Rem to the Sample Schemas. Rem Rem NOTES Rem - this script is edited during installation to match Rem the directory structure on you system Rem - CAUTION: This script will erase the following schemas: Rem - HR Rem - OE Rem - PM Rem - SH Rem - qs

Uploaded by

jonhy1213
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views3 pages

1 Mksample

Rem Rem mksample.sql - creates all 5 Oracle9i Sample Schemas Rem Rem Rem DESCRIPTION Rem this script rees and creates all schemas belonging Rem to the Sample Schemas. Rem Rem NOTES Rem - this script is edited during installation to match Rem the directory structure on you system Rem - CAUTION: This script will erase the following schemas: Rem - HR Rem - OE Rem - PM Rem - SH Rem - qs

Uploaded by

jonhy1213
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Rem Rem $Header: mksample.sql 05-dec-2001.16:41:15 ahunold Exp $ Rem Rem mksample.

sql Rem Rem Copyright (c) 2001, Oracle Corporation. All rights reserved. Rem Rem NAME Rem mksample.sql - creates all 5 Sample Schemas Rem Rem DESCRIPTION Rem This script rees and creates all Schemas belonging Rem to the Oracle9i Sample Schemas. Rem If you are unsure about the prerequisites for the Sample Schemas, Rem please use the Database Configuration Assistant DBCA to Rem configure the Sample Schemas. Rem Rem NOTES Rem - This script is edited during installation to match Rem the directory structur on you system Rem - CAUTION: This script will erase the following schemas: Rem - HR Rem - OE Rem - PM Rem - SH Rem - QS, QS_ADM, QS_CB, QS_CBADM, QS_CS, QS_ES, QS_OS, QS_WS Rem - CAUTION: Never use the above mentioned Sample Schemas for Rem anything other than demos and examples Rem - USAGE: To return the Sample Schemas to their initial Rem state, you can call this script and pass the passwords Rem for SYS, SYSTEM and the schemas as parameters. Rem Example: @?/demo/schema/mksample mgr secure h1 o2 p3 q4 s5 Rem (please choose your own passwords for security purposes) Rem - LOG FILES: The SQL*Plus and SQL*Loader log files are written Rem to the equivalent of $ORACLE_HOME/demo/schema/log Rem If you edit the log file location further down in this Rem script, use absolute pathnames Rem Rem MODIFIED (MM/DD/YY) Rem ahunold 12/05/01 - added parameters Rem ahunold 05/03/01 - dupl lines Rem ahunold 04/23/01 - Verification, parameters for pm_main. Rem ahunold 04/13/01 - aaditional parameter (HR,OE,QS) Rem ahunold 04/04/01 - Installer variables Rem ahunold 04/03/01 - Merged ahunold_mkdir_log Rem ahunold 03/28/01 - Created Rem SET SET SET SET SET SET SET SET FEEDBACK 1 NUMWIDTH 10 LINESIZE 80 TRIMSPOOL ON TAB OFF PAGESIZE 999 ECHO OFF CONCAT '.'

PROMPT PROMPT specify password for SYSTEM as parameter 1: DEFINE password_system = &1

PROMPT PROMPT DEFINE PROMPT PROMPT DEFINE PROMPT PROMPT DEFINE PROMPT PROMPT DEFINE PROMPT PROMPT DEFINE PROMPT PROMPT DEFINE PROMPT PROMPT PROMPT

specify password for SYS as parameter 2: password_sys = &2 specify password for HR as parameter 3: password_hr = &3 specify password for OE as parameter 4: password_oe = &4 specify password for PM as parameter 5: password_pm = &5 specify password for all QS schemas as parameter 6: password_qs = &6 specify password for SH as parameter 7: password_sh = &7 Sample Schema creating will take about 40 minutes to complete...

CONNECT system/&&password_system @?/demo/schema/human_resources/hr_main.sql &&password_hr example temp &&password_sys ?/demo/schema/log/ CONNECT system/&&password_system @?/demo/schema/order_entry/oe_main.sql &&password_oe example temp &&password_hr &&password_sys ?/demo/schema/log/ CONNECT system/&&password_system @?/demo/schema/product_media/pm_main.sql &&password_pm example temp &&password_ oe &&password_sys %s_pmPath% %s_logPath% %s_pmPath% CONNECT system/&&password_system @?/demo/schema/shipping/qs_main.sql &&password_qs example temp &&password_system &&password_oe &&password_sys ?/demo/schema/log/ CONNECT system/&&password_system @?/demo/schema/sales_history/sh_main &&password_sh example temp &&password_sys %s_shPath% %s_logPath% CONNECT system/&&password_system SPOOL OFF SPOOL ?/demo/schema/log/mkverify.log SELECT owner, object_type, object_name, subobject_name, status FROM dba_objects WHERE ( owner in ('HR','OE','SH','PM') OR owner like 'QS%' ) AND object_name NOT LIKE 'SYS%' ORDER BY 1,2,3,4;

SELECT owner, object_type, status, count(*) FROM dba_objects WHERE ( owner in ('HR','OE','SH','PM') OR owner like 'QS%' ) AND object_name LIKE 'SYS%' GROUP BY owner, object_type, status; SELECT FROM WHERE ( OR ORDER BY SPOOL OFF owner, table_name, num_rows dba_tables owner in ('HR','OE','SH','PM') owner like 'QS%' ) 1,2,3;

You might also like