环境
操作系统:RHEL 6.4 x86_64
DB:oracle 11.2.0.3
一个测试库,在安装建库的时候忘了安装example了,有些时候没有这些用户的话做测试还真不容易,例如没有scott用户,你想做connect by测试,就只能自己建emp表了......
以下是安装example的过程
step1:下载安装包
到http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html下载安装包
linux.x64_11gR2_examples.zip
传到服务器上,之后解压
[oracle@server package]$ unzip linux.x64_11gR2_examples.zip
step2:进到解压目录,之后执行安装
su - ##切换到root执行命令
xhost +
su - oracle ##切换到oracle用户执行命令
[oracle@server ~]$ cd package/examples/
[oracle@server examples]$ ls
doc install response runInstaller stage welcome.html
./runInstaller ##注意:最好是在服务器上用桌面来操作,远程的话xshell断掉的话需要重新做
step3:安装过程及配置
缺少了很多包,一次性yum安装上
可以看到,在我的系统上这些包都已经安装上了,并且版本比oracle提供的更新
所以我这里可以忽略这些报错,点ignore all,如下
至此,安装完成了,接下来是运行配置脚本
step4:安装后的配置过程
进入到demo目录
[oracle@server schema]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/demo/schema
[oracle@server schema]$ ls
bus_intelligence human_resources log mk_dir.sql.ouibak mkplug.sql mksample.sql.sbs mkverify.sql product_media
sales_history sted_mkplug.sql.dbl
drop_sch.sql info_exchange mk_dir.sql mk_dir.sql.ouibak.1 mksample.sql mkunplug.sql order_entry README.txt shipping
可以看到,安装了很多脚本
需要开启数据库,之后运行mksample.sql脚本
在这里需要你输入system/sys的密码,以及为sh/oe等用户都设置密码,还需要输入默认表空间和临时表空间的路径
SYS@fgh> startup
SYS@fgh> @?/demo/schema/mksample.sql
specify password for SYSTEM as parameter 1:
Enter value for 1: oracle
specify password for SYS as parameter 2:
Enter value for 2: oracle
specify password for HR as parameter 3:
Enter value for 3: hr
specify password for OE as parameter 4:
Enter value for 4: oe
specify password for PM as parameter 5:
Enter value for 5: pm
specify password for IX as parameter 6:
Enter value for 6: ix
specify password for SH as parameter 7:
Enter value for 7: sh
specify password for BI as parameter 8:
Enter value for 8: bi
specify default tablespace as parameter 9:
Enter value for 9: users
specify temporary tablespace as parameter 10:
Enter value for 10: temp
specify log file directory (including trailing delimiter) as parameter 11:
Enter value for 11: /u01/app/oracle/diag/rdbms/fgh/fgh/trace
Sample Schemas are being created ...
Connected.
DROP USER hr CASCADE
*
ERROR at line 1:
ORA-01918: user 'HR' does not exist
DROP USER oe CASCADE
*
ERROR at line 1:
ORA-01918: user 'OE' does not exist
DROP USER pm CASCADE
*
ERROR at line 1:
ORA-01918: user 'PM' does not exist
DROP USER ix CASCADE
*
ERROR at line 1:
ORA-01918: user 'IX' does not exist
DROP USER sh CASCADE
*
ERROR at line 1:
ORA-01918: user 'SH' does not exist
DROP USER bi CASCADE
*
ERROR at line 1:
ORA-01918: user 'BI' does not exist
Connected.
specify password for HR as parameter 1:
specify default tablespeace for HR as parameter 2:
specify temporary tablespace for HR as parameter 3:
specify password for SYS as parameter 4:
specify log path as parameter 5:
......
在这个过程中,oracle会创建多个用户,以及会到这些用户下创建很多示例表
配置完成后,查看各个用户下的样例表
SH用户
SYSTEM@fgh> conn sh/sh
Connected.
SH@fgh> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
CAL_MONTH_SALES_MV TABLE
CHANNELS TABLE
COSTS TABLE
COUNTRIES TABLE
CUSTOMERS TABLE
DIMENSION_EXCEPTIONS TABLE
DR$SUP_TEXT_IDX$I TABLE
DR$SUP_TEXT_IDX$K TABLE
DR$SUP_TEXT_IDX$N TABLE
DR$SUP_TEXT_IDX$R TABLE
FWEEK_PSCAT_SALES_MV TABLE
PRODUCTS TABLE
PROFITS VIEW
PROMOTIONS TABLE
SALES TABLE
SALES_TRANSACTIONS_EXT TABLE
SUPPLEMENTARY_DEMOGRAPHICS TABLE
TIMES TABLE
OE用户
OE@fgh> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
ACCOUNT_MANAGERS VIEW
ACTION_TABLE TABLE
BOMBAY_INVENTORY VIEW
CATEGORIES_TAB TABLE
COUNTRIES SYNONYM
CUSTOMERS TABLE
CUSTOMERS_VIEW VIEW
......
其他用户就不一一验证了
OK,安装样例用户完成。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。