`

Oracle10g的 Database Examples 安装

 
阅读更多

有时候看到网上好多例子都是scott用户或hr用户下的表, 在oracle10g里, 这些demo用户放在另外一张伴侣盘里, 需要单独安装.

1. 从 oracle 网站下载Oracle10g Companion CD. 然后安装(我选择静默安装不用图形界面)

$ cd /orahome/soft/
$ rz   (SecureCRT里通过rz命令上传oracle10g Companion CD安装文件10201_companion_linux32.zip, 其它上传方式也行)
$ unzip 10201_companion_linux32.zip
$ cd /orahome/soft/companion
$ ./runInstaller -silent -responseFile /orahome/soft/companion/response/companionCD.db.rsp UNIX_GROUP_NAME="oinstall" ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" ORACLE_HOME_NAME="OraDb10g_home1"
响应文件companionCD.db.rsp指的是Oracle Database 10g Product 10.2.0.1.0, 因Database Examples在这里, 即Oracle Database Demos 10.2.0.1.0 组件。

会安装以下组件:
   Oracle Database 10g Products 10.2.0.1.0
   Oracle JDBC Development Drivers 10.2.0.1.0
   Oracle Spatial Demos 10.2.0.1.0
   JAccelerator (COMPANION) 10.2.0.1.0
   Oracle SQLJ Demos 10.2.0.1.0
   Oracle Internet Directory Client Demos 10.2.0.1.0
   Oracle interMedia Demos 10.2.0.1.0
   Precomp Demo Files 10.2.0.1.0
   Oracle XML Demos 10.2.0.1.0
   Oracle Database Demos 10.2.0.1.0
   SQL*Plus Demos 10.2.0.1.0
   Oracle Globalization Support Demos 10.2.0.1.0
   Oracle Context Companion 10.2.0.1.0
   Oracle Ultra Search Server Rdbms 10.2.0.1.0
   Oracle Ultra Search Server 10.2.0.1.0
   Oracle Ultra Search Middle-Tier 10.2.0.1.0
   Oracle Ultra Search Common Files 10.2.0.1.0
   Perl Interpreter 5.8.3.0.2
   Oracle Workflow 2.6.4.0.0
   Oracle Workflow Manager 2.6.4.0.0

安装后Database Demos在 $ORACLE_HOME/demo/schema 目录下. Sqlplus Demo在 $ORACLE_HOME/sqlplus/demo 目录下.
$ cd $ORACLE_HOME/demo/schema
$ ll
total 128
drwxr-x--- 2 oracle oinstall 4096 Dec 10 11:06 bus_intelligence
drwxr-x--- 2 oracle oinstall 4096 Dec 10 11:06 human_resources
drwxrwx--- 2 oracle oinstall 4096 Dec 10 11:06 info_exchange
drwxr-x--- 2 oracle oinstall 4096 Dec 5 11:33 log
-rw-r----- 1 oracle oinstall 1614 Dec 10 11:06 mk_dir.sql
-rw-r----- 1 oracle oinstall 1614 Dec 5 11:33 mk_dir.sql.ouibak
-rw-r----- 1 oracle oinstall 1614 Dec 5 11:33 mk_dir.sql.ouibak.1
-rw-r----- 1 oracle oinstall 27113 May 10 2005 mkplug.sql
-rw-rw---- 1 oracle oinstall 5300 Dec 10 11:06 mksample.sql
-rw-rw---- 1 oracle oinstall 5094 Apr 3 2003 mksample.sql.sbs
-rw-rw---- 1 oracle oinstall 5076 May 10 2005 mkunplug.sql
-rw-rw---- 1 oracle oinstall 4796 Sep 23 2004 mkverify.sql
drwxr-x--- 3 oracle oinstall 4096 Dec 10 11:06 order_entry
drwxrwx--- 2 oracle oinstall 4096 Dec 10 11:06 product_media
-rw-rw---- 1 oracle oinstall 4368 Dec 8 2003 README.txt
drwxr-x--- 2 oracle oinstall 4096 Dec 10 11:06 sales_history
drwxrwx--- 2 oracle oinstall 4096 Dec 10 11:06 shipping
-rw-r----- 1 oracle oinstall 15246 May 10 2005 sted_mkplug.sql.dbl
$ cd $ORACLE_HOME/sqlplus/demo
$ ll
total 8
-rw-rw---- 1 oracle oinstall 3565 Jun 28 2000 demobld.sql
-rw-rw---- 1 oracle oinstall 573 Jun 28 2000 demodrop.sql

其中各目录和文件说明:
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

$ sqlplus '/as sysdba'

--新建一表空间专门存放这些用户数据
SQL> CREATE TABLESPACE ts_example NOLOGGING DATAFILE '/orahome/oradata/WENDING/ts_example01.dbf' SIZE 150M REUSE AUTOEXTEND ON NEXT 640k MAXSIZE UNLIMITED;

--全部安装这6个用户, 陆续输入8个用户密码, 默认表空间, 临时表空间, 执行日志目录
SQL> @?/demo/schema/mksample.sql

--或者指定参数执行也行
SQL> @?/demo/schema/mksample.sql systempwd syspwd hrpwd oepwd pmpwd ixpwd shpwd bipwd ts_example temp $ORACLE_HOME/demo/schema/log/
--其实大部分时候我们只要hr用户即可做各种例子了
SQL> @?/demo/schema/human_resources/hr_main.sql hrpwd ts_example temp syspwd $ORACLE_HOME/demo/schema/log/

--安装的对象信息如下
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;

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
BI                             SYNONYM                      8
BI                                                          8
HR                             INDEX                       19
HR                             PROCEDURE                    2
HR                             SEQUENCE                     3
HR                             TABLE                        7
HR                             TRIGGER                      2
HR                             VIEW                         1
HR                                                         34
IX                             EVALUATION CONTEXT           2
IX                             INDEX                       14
IX                             LOB                          3
IX                             QUEUE                        4
IX                             RULE SET                     4
IX                             SEQUENCE                     2
IX                             TABLE                       15
IX                             TYPE                         1
IX                             VIEW                         8
IX                                                         53
OE                             FUNCTION                     1
OE                             INDEX                       19
OE                             SEQUENCE                     1
OE                             SYNONYM                      6
OE                             TABLE                        9
OE                             TRIGGER                      1
OE                             TYPE                        22
OE                             TYPE BODY                    3
OE                             VIEW                         3
OE                                                         65
PM                             INDEX                        2
PM                             LOB                          7
PM                             TABLE                        2
PM                             TYPE                         3
PM                                                         14
SH                             DIMENSION                    5
SH                             INDEX                       23
SH                             INDEX PARTITION            196
SH                             MATERIALIZED VIEW            2
SH                             TABLE                       12
SH                             TABLE PARTITION             56
SH                             VIEW                         1
SH                                                        295

42 rows selected.

2. 安装或删除Sqlplus Demo

--安装
$ sqlplus u_test/iamwangnc
SQL> @?/sqlplus/demo/demobld.sql

--删除
$ sqlplus u_test/iamwangnc
SQL> @?/sqlplus/demo/demodrop.sql

--End--

分享到:
评论

相关推荐

    Oracle Database Examples Installation Guide 11g-12.pdf

    《Oracle Database Examples Installation Guide 11g-12》是一份详细指导用户如何安装和配置Oracle数据库示例软件的手册,适用于11g Release 2(11.2)版本。该指南旨在帮助用户理解并顺利完成Oracle数据库示例的...

    Oracle_Database_11g_标准版_企业版__下载地址_详细列表

    * Oracle Database 11g Examples:http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_examples.zip * Oracle De-install:...

    Oracle Database 19c (WINDOWS.X64-193000-examples.zip)

    "WINDOWS.X64_193000_examples.zip"压缩包文件包含了适用于Windows 64位系统的Oracle Database 19c示例和教程数据。这些示例旨在帮助用户更好地理解和学习如何使用Oracle数据库的各种特性,例如SQL查询、存储过程、...

    oracle 11g r2 download address

    Oracle Database 11g Release 2 (11.2) 是 Oracle 公司推出的一款关系型数据库管理系统,它继承了 Oracle 11g 的诸多特性,并在此基础上进行了优化与增强。Oracle 11g R2 支持多种操作系统平台,如 Windows、Linux ...

    Oracle Database Quick Installation Guide 11g IBM AIX-28.pdf

    Oracle Database Quick Installation Guide 11g IBM AIX-28 是一份针对在IBM AIX操作系统上64位POWER系统上快速安装Oracle Database 11g Release 2 (11.2)的指南。该文档旨在提供一个简洁明了的流程,帮助用户在AIX...

    Oracle NoSQL Database_2013.12

    Oracle NoSQL Database: Real-Time Big Data Management for the Enterprise Maqsood Alam , Aalok Muley , Chaitanya Kadaru , Ashok Joshi Book Description Publication Date: December 4, 2013 | ISBN-10: ...

    Oracle Database 10g SQL_code

    D:. └─sql_book ├─Java ... oracle_10g_examples.sql product_cursor.sql product_cursor2.sql report1.sql report2.sql report3.sql report4.sql report5.sql report6.sql store_schema.sql

    The Cloud DBA-Oracle: Managing Oracle Database in the Cloud

    You will learn from real-world business cases and practical examples of administration of Oracle database in the cloud, highlighting the challenges faced and solutions implemented.

    Oracle Database 19c (AIX.PPC64-193000-examples.zip)

    1. **安装与配置**:在AIX系统上安装Oracle Database 19c 需要遵循特定的步骤,包括准备系统环境(如设置用户权限、安装依赖软件包)、配置硬件资源、创建文件系统、安装数据库软件以及执行数据库实例的创建和初始化...

    oracle v-11.2.0.4.0 Oracle 11.2.0.4 For Windows 64bit+32bit 数据库

    1. **Database (1、2)**: 这部分是Oracle数据库的核心,包含了安装和升级数据库所需的所有组件。Oracle数据库11.2.0.4提供了高性能、高可用性和安全性,支持事务处理、数据仓库和混合工作负载。它引入了诸如...

    Oracle Database 19c (LINUX.X64_193000_db_home.part1.rar)

    Oracle Database 19c 是最新的长期版本,支持期限最长;19.3 - 企业版(也包括标准版 2) 适用于LINUX X64位系统。 LINUX.X64_193000_db_home文件分割成 三个 压缩包,必须集齐 三个 文件后才能一起解压一起使用: ...

    Oracle Database 19c (SOLARIS.X64-195000-examples.zip)

    在Oracle Database 19c中,“examples”压缩包通常包含了一系列示例数据库、脚本和工具,这些资源旨在帮助用户更好地理解和学习Oracle数据库的各种功能。以下是一些可能包含在“examples”压缩包中的重要知识点: 1...

    Database Quick Installation Guide.pdf

    - **示例安装**:可选地安装Oracle Database Examples。 - **后续步骤**:完成安装后的建议操作。 - **附加信息**:包括文档访问、技术支持等。 #### 安装过程概述 本指南采用默认安装选项来部署Oracle Database。...

    oracle_dba_code_examples201012.pdf

    Part 10 Oracle Database Utilities _______________________ 556 Part 11 Miscellaneous Oracle Database Topics _____________ 582 Part 12 PL/SQL Samples ______________________________ 596 Part 13 ...

    Oracle Database 19c (LINUX.X64_193000_examples.zip)

    "LINUX.X64_193000_examples.zip" 文件是一个包含了示例数据库和相关脚本的压缩包,旨在帮助用户更好地理解和学习如何使用Oracle Database 19c。 该压缩包中的"examples"文件夹通常包含了以下几方面的内容: 1. **...

    Oracle Database 19c (HPUX.IA64-193000-examples.zip)

    Oracle Database 19c是Oracle公司推出的一款先进的企业级数据库管理系统,专为高性能、高可用性和安全性设计。在HP-UX IA64平台上,Oracle 19c提供了针对该架构优化的版本,确保在惠普UNIX系统上运行的高效稳定。...

    2010年10月最新ORACLE OCP培训教程

    Oracle Database 10g: “g” Stands for Grid 1-6 Oracle Database Architecture 1-8 Database Structures 1-9 Oracle Memory Structures 1-10 Process Structures 1-12 Oracle Instance Management 1-13 Server ...

Global site tag (gtag.js) - Google Analytics