oracle hr建立语句,1Z0-051-Oracle的 HR 样例用户的建立

Oracle的 HR 样例用户的建立

1、oracle 11g 中hr用户需要单独安装,比较麻烦,书本上学习例子很多都是HR用户的案例 ,下载后释放到 $ORACLE_HOME/demo/schema/human_resources/目录下。

Script Name

Description

hr_analz.sql

Collects statistics on the tables in the schema.

hr_code.sql

Creates procedural objects in the schema.

hr_comnt.sql

Creates comments for each object in the schema.

hr_cre.sql

Creates theHRobjects.

hr_dn_c.sql

Adds the distinguished name column used by Oracle Internet Directory to theemployeesanddepartmentstables.

hr_dn_d.sql

Drops the Oracle Internet Directory distinguished name column fromemployeesanddepartments.

hr_drop.sql

Drops theHRschema and all its objects.

hr_idx.sql

Creates indexes on theHRtables.

hr_main.sql

Main script for theHRschema; calls other scripts.

hr_popul.sql

Populates the objects.

2、[oracle@OCM]$sqlplus / as sysdba;

3、执行$ORACLE_HOME/demo/schema/human_resources/下的hr_main.sql

sql>@?/demo/schema/human_resources/hr_main.sql

注:

1、安装前需要使用root用户对human_resources下的文件执行:chmod 777 *。

2、安装前需要确定5个参数。分别是:

HR用户的密码:dbbocom;

默认用户空间:users。(必须是已经存在的用户空间)

临时用户空间:temp。(必须是已经存在的用户空间)

SYS用户的密码:dbbocom

日志文件存放的目录:$ORACLE_HOME/RDBMS/log

HR人事管理数据库下载地址:

或者:

sql> @?/demo/schema/human_resources/hr_main.sql

specify password for HR as parameter 1:

Enter value for 1: dbbocom

specify default tablespeace for HR as parameter 2:

Enter value for 2: users

specify temporary tablespace for HR as parameter 3:

Enter value for 3: temp

specify password for SYS as parameter 4:

Enter value for 4: dbbocom

specify log path as parameter 5:

Enter value for 5: /home/oracle/app/oracle/

DROP USER hr CASCADE

*

ERROR at line 1:

ORA-01918: user 'HR' does not exist

old1: CREATE USER hr IDENTIFIED BY &pass

new1: CREATE USER hr IDENTIFIED BY dbbocom

User created.

old1: ALTER USER hr DEFAULT TABLESPACE &tbs

new1: ALTER USER hr DEFAULT TABLESPACE users

old2: QUOTA UNLIMITED ON &tbs

new2: QUOTA UNLIMITED ON users

User altered.

old1: ALTER USER hr TEMPORARY TABLESPACE &ttbs

new1: ALTER USER hr TEMPORARY TABLESPACE temp

PL/sql procedure successfully completed.

...

PL/sql procedure successfully completed.

检查是否正确安装完毕

sql> show user

USER is "HR"

总结

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值