Manually Installing Oracle10g Sample Schemas
Pro ORACLE SQL中用到了 sample Schemas 需要安装
1. 从 oracle 网站下载10201_companion_linux_x86_64.cpio.gz,然后安装
[oracle@snsdb ~]$unzip 10201_companion_linux_x86_64.cpio.gz [oracle@snsdb ~]$cpio -idvm < 10201_companion_linux_x86_64.cpio [oracle@snsdb ~]$cd companion [oracle@snsdb companion]$ ./runInstaller -silent -responseFile /home/oracle/companion/response/companionCD.db.rsp UNIX_GROUP_NAME="oinstall" ORACLE_HOME="/opt/oracle/102" ORACLE_HOME_NAME="snsdb_home" -ignoreSysPrereqs [oracle@snsdb ~]$ cd $ORACLE_HOME/demo/schema/ [oracle@snsdb schema]$ ls bus_intelligence log mk_dir.sql.ouibak.1 mkplug.sql mkunplug.sql product_media shipping human_resources mk_dir.sql mk_dir.sql.ouibak.2 mksample.sql mkverify.sql README.txt sted_mkplug.sql.dbl info_exchange mk_dir.sql.ouibak mk_dir.sql.ouibak.3 mksample.sql.sbs order_entry sales_history
其中各目录和文件说明:
mksample.sql -- script that erases and recreates all Sample Schemas
mk_dir.sql -- script that sets the DIRECTORY objects. This script is invoked during database creation by the DBCA
README.txt -- explains the process of creating the Sample Schemas
human_resources -- hr_main.sql creates or recreates the HR schema
-- hr_drop.sql drops all objects, but not the HR user
order_entry -- oe_main.sql creates or recreates the whole OE schema
-- oe_drop.sql drops all relational objects, but not the HR user
-- oc_main.sql creates the OC subschema and is called by oe_main.sql (OC stands for Online Catalog)
-- oc_drop.sql drops all the object-relational parts of the OC subschema
product_media -- pm_main.sql creates or recreates the PM schema
-- pm_drop.sql drops all objects, but not the PM user
info_exchange -- ix_main.sql creates or recreates the IX schema
-- dix_v3.sql drops all objects, but not the IX user
sales_history -- sh_main.sql creates or recreates the SH schema
-- sh_drop.sql drops all objects, but not the SH user
bus_intelligence-- bi_main.sql creates user BI and grants SELECT privileges on specific OE and SH objects
demobld.sql --在当前用户下新建EMP, DEPT, BONUS, SALGRADE, DUMMY这几张表
demodrop.sql --删除当前用户下EMP, DEPT, BONUS, SALGRADE, DUMMY这几张表
各个新建用户的依赖性说明:
The HR schema does not require any other schema other than SYS and SYSTEM to be present.
The OE schema requires the database to be enabled for spatial data.
The PM schema requires the database to be enabled for Intermedia, which in turn requires a java-enabled database.
The SH schema uses Partitioning.
2. 开始安装或重建Database Demos
[oracle@snsdb schema]$ sqlplus "/as sysdba" SQL> @?/demo/schema/mksample.sql SQL> select owner,object_type,count(*) from dba_objects where owner in ('IX', 'SH', 'OE', 'HR', 'BI', 'PM') group by owner,rollup(object_type) order by 1,2; [oracle@snsdb ~]$ sqlplus oe/oepwd@SNSDB