Oracle 12.2安装示例数据库schema |
发表者:admin分类:数据库2019-04-19 10:29:03 阅读[1446] |
Oracle 12.2安装示例数据库schema
但到了Oracle12.2 版本,也有一个示例Schemas选项卡如下图所示:
但是数据库安装完成后却还是没有这些示例SCHEMA,到底是怎么回事呢?我们来查一下官方文档:
Starting with Oracle Database 12c Release 2, the latest version of the sample schema scripts are available on GitHub at https://github.com/oracle/db-sample-schemas/releases/latest.
During a complete installation of Oracle Database, the HR schema can be installed either manually or automatically when creating a database using the dbca
option. All the other sample schemas must be installed manually via the scripts available on GitHub.
从上面的官方文档中我们可以看到从Oracle12.2版本开始,示例Schemas的脚本被放到了GitHub上,在DBCA安装时只会安装hr示例Schema。从文档中给出的指定地址下载示例Schema安装脚本:
同步下载:
git clone https://github.com/oracle/db-sample-schemas.git
将文件放于$ORACLE_HOME/demo/ 目录下.
从README.txt文档中找到安装方法,开始安装:
Connected.
SP2-0310: unable to
open
file
"__SUB__CWD__/human_resources/hr_main.sql"
Connected.
SP2-0310: unable to
open
file
"__SUB__CWD__/order_entry/oe_main.sql"
Connected.
SP2-0310: unable to
open
file
"__SUB__CWD__/product_media/pm_main.sql"
Connected.
SP2-0310: unable to
open
file
"__SUB__CWD__/info_exchange/ix_main.sql"
Connected.
SP2-0310: unable to
open
file
"__SUB__CWD__/sales_history/sh_main.sql"
Connected.
SP2-0310: unable to
open
file
"__SUB__CWD__/bus_intelligence/bi_main.sql"
Connected.
not spooling currently
SP2-0310: unable to
open
file
"__SUB__CWD__/mkverify.sql"
从上面看到输出报错,没有安装成功。报错的是“__SUB__CWD__”没有找到,打开mksample.sql文件,确实有这个变量,但不知道在哪里声明的。
重新查看README.md文档看到需要把“__SUB__CWD__”这个变量替换为当前路径,
还给出了命令:
[oracle
@rhel7
db-sample-schemas-12.2.0.1]$
perl -p -i.bak -e
's#__SUB__CWD__#'
$(pwd)
'#g'
*.sql */*.sql */*.dat
需要在sample目录下,执行以上命令。
执行完上面的脚本后重新安装示例Schema:
sys@ORA12C>@mksample 123456 123456 hr oe pm ix sh bi users
temp
/home/oracle/dbca/ 192.168.56.22:1521/ora12c
输入sys,system,hr,oe,pm,ix,sh,bi用户的密码,用户的默认表空间和临时表空间,日志路径,数据库连接串(此处为PDB的数据库连
接)
最终安装成功:
system@ORA12C>
select
username,created
from
dba_users
where
created>sysdate-1;
USERNAME CREATED
------------------------------ -----------------
OE 20170816 23:32:22
SH 20170816 23:34:25
PM 20170816 23:33:13
IX 20170816 23:34:12
BI 20170816 23:36:20
HR 20170816 23:32:07
转载请标明出处【Oracle 12.2安装示例数据库schema】。
《www.micoder.cc》
虚拟化云计算,系统运维,安全技术服务.
Tags: | [阅读全文...] |
最新评论