如何安装Oracle Database Examples

Posted dingdingfish

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何安装Oracle Database Examples相关的知识,希望对你有一定的参考价值。

此处下载Oracle Database Examples,本例为21c版本,大小近800MB:

$ ls -lh /vagrant/LINUX.X64_213000_examples.zip
-rwxrwxrwx. 1 vagrant vagrant 796M Dec 30 10:37 /vagrant/LINUX.X64_213000_examples.zip

21c的Database Examples Installation Guide

解压:

cd ~oracle
unzip /vagrant/LINUX.X64_213000_examples.zip -d .

加压后为1.1GB:

$ cd examples/
$ du -sh .
1.1G    .

其实文档也有提到:

1.1 GB of free disk space on UNIX systems.

查看解压后的文件:

$ ls -l
total 20
drwxr-xr-x.  4 oracle oinstall  191 Jul 28  2021 install
drwxrwxr-x.  2 oracle oinstall   34 Jul 28  2021 response
-rwxr-xr-x.  1 oracle oinstall 8854 Jul 28  2021 runInstaller
drwxr-xr-x. 13 oracle oinstall 4096 Jul 28  2021 stage
-rwxrwxr-x.  1 oracle oinstall  500 Feb  7  2013 welcome.html

response目录下有response文件:

$ cat response/*.rsp


###############################################################################
## Copyright(c) Oracle Corporation 1998,2021. All rights reserved.           ##
##                                                                           ##
## Specify values for the variables listed below to customize                ##
## your installation.                                                        ##
##                                                                           ##
## Each variable is associated with a comment. The comment                   ##
## can help to populate the variables with the appropriate                   ##
## values.                                                                   ##
##                                                                           ##
###############################################################################

#-------------------------------------------------------------------------------
# Do not change the following system generated value.
#-------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v21.0.0

#-------------------------------------------------------------------------------
# Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=

#-------------------------------------------------------------------------------
# Complete path of the Oracle Home
#-------------------------------------------------------------------------------
ORACLE_HOME=

#-------------------------------------------------------------------------------
# Complete path of the Oracle Base.
#-------------------------------------------------------------------------------
ORACLE_BASE=

获取这些参数:

$ orabase
/opt/oracle

$ echo $ORACLE_HOME
/opt/oracle/product/21c/dbhome_1

$ id -gn oracle
oinstall

修改后的response文件如下:

oracle.install.responseFileVersion=/oracle/install/rspfmt_demosinstall_response_schema_v21.0.0
UNIX_GROUP_NAME=oinstall
ORACLE_HOME=/opt/oracle/product/21c/dbhome_1
ORACLE_BASE=/opt/oracle

静默安装。注意-responseFile后必须为绝对路径:

$ ./runInstaller -silent -responseFile /home/oracle/examples/response/examples_install.rsp

日志如下:

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 415 MB.   Actual 16478 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4083 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-01-03_10-13-10PM. Please wait ...[oracle@oracle-21c-vagrant examples]$ The response file for this session can be found at:
 /opt/oracle/product/21c/dbhome_1/install/response/examples_2023-01-03_10-13-10PM.rsp

You can find the log of this install session at:
 /opt/oraInventory/logs/installActions2023-01-03_10-13-10PM.log
Successfully Setup Software.
The installation of Oracle Database 21c Examples was successful.
Please check '/opt/oraInventory/logs/silentInstall2023-01-03_10-13-10PM.log' for more details.

安装的Example位于$ORACLE_HOME/rdbms/demo目录下。
但是这个目录很小,有343个文件:

$ du -sh $ORACLE_HOME/rdbms/demo
6.1M    /opt/oracle/product/21c/dbhome_1/rdbms/demo

所以应该也不仅限于以上目录:

$ cd $ORACLE_HOME
$ find . -name demo -type d -exec ls -ld  \\;
drwxr-x---. 5 oracle oinstall 12288 Jan  3 22:49 ./rdbms/demo
drwxr-xr-x. 3 oracle oinstall 61 Jan  3 22:13 ./ldap/demo
drwxr-xr-x. 2 oracle oinstall 4096 Jan  3 22:40 ./plsql/demo
drwxr-xr-x. 2 oracle oinstall 270 Jul 28  2021 ./sdk/demo
drwxr-xr-x. 2 oracle oinstall 45 Jan  3 22:38 ./sqlplus/demo
drwxr-xr-x. 3 oracle oinstall 4096 Jan  3 22:13 ./sqlj/demo
drwxr-xr-x. 5 oracle oinstall 44 Jan  3 22:13 ./precomp/demo
drwxr-x---. 5 oracle oinstall 38 Jan  3 22:13 ./xdk/demo
drwxr-xr-x. 3 oracle oinstall 60 Jan  3 22:13 ./nls/gdk/demo
drwxr-xr-x. 2 oracle oinstall 98 Jan  3 22:13 ./nls/demo
drwxr-xr-x. 14 oracle oinstall 249 Jan  3 22:13 ./md/demo
drwxr-xr-x. 3 oracle oinstall 19 Jan  3 22:13 ./odbc/demo
drwxr-xr-x. 3 oracle oinstall 20 Jul 28  2021 ./demo
drwxr-xr-x. 2 oracle oinstall 4096 Jan  3 22:13 ./jpub/demo

其中带Jan 3的都是新安装的。

在文档的1.2.2节: Required Products,

Explains the products that are required to use Oracle Database Examples.
Before you can use the Oracle Database Examples, you must install the sample schemas in an Oracle Database. When you install Oracle Database, or use Database Configuration Assistant to create a database, you can choose to include the sample schemas. You can also manually install the sample schemas in an existing database.

这说明Database Examples也有一些会依赖Oracle Sample Schema。

还有一些Database Example可以通过以下GitHub项目安装,如Data Mining:

  • https://github.com/oracle/oracle-db-examples

在文档Database Administrator’s Reference for Linux and UNIX System-Based Operating Systems的第7章:SQLLoader and PL/SQL Demonstrations,有讲到SQLLoader Demonstrations和PL/SQL Demonstrations。

6.3.1节,有讲到Pro*C/C++ Demonstration Programs。其它的语言,如FORTRAN,OCI,OCCI也有说明。

文档Oracle® Database Database Utilities的7.13节 SQL*Loader Case Studies有对SQL Loader示例的详细说明。

以上是关于如何安装Oracle Database Examples的主要内容,如果未能解决你的问题,请参考以下文章

如何安装Oracle Database Examples

如何安装Oracle Database Examples

oracle 11g 安装包解压的问题

如何安装Oracle 12c数据库软件

win7 64位的 如何安装 oracle 9i

Oracle Database 11g安装教程