创建hr用户和表

默认情况下是不创建hr用户和表的,我们可以通过dbca和script两种方式创建,我们这里通过script方式创建

现在我通过script方式创建hr用户和表

1、从网上得到hr用户的脚本

2、把脚本放入$ORACLE_HOME/demo/schema/human_resources目录

hr_analz.sql  hr_comnt.sql  hr_dn_c.sql  hr_drop.sql  hr_main.sql
hr_code.sql   hr_cre.sql    hr_dn_d.sql  hr_idx.sql   hr_popul.sql

把以上脚本放入$ORACLE_HOME/demo/schema/human_resources目录中

cd $ORACLE_HOME/demo/schema/human_resources
[root@IM-8-201 human_resources]# sqlplus sys/sys as sysdba @hr_main.sql

SQL*Plus: Release 10.2.0.4.0 - Production on Tue Nov 15 21:40:44 2011

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


specify password for HR as parameter 1:
Enter value for 1: hr

specify default tablespeace for HR as parameter 2:
Enter value for 2: user

specify temporary tablespace for HR as parameter 3:
Enter value for 3: temp

specify password for SYS as parameter 4:
Enter value for 4: sys
specify log path as parameter 5:
Enter value for 5:/home/oracle
..............................
PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

SQL>




3、验证

SQL> select table_name from user_tables;

TABLE_NAME
------------------------------
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY
COUNTRIES

7 rows selected.



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值