預設情況下是不建立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.