建立hr使用者和表

來源:互聯網
上載者:User

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

  1. cd $ORACLE_HOME/demo/schema/human_resources  
  2. [root@IM-8-201 human_resources]# sqlplus sys/sys as sysdba @hr_main.sql  
  3.   
  4. SQL*Plus: Release 10.2.0.4.0 - Production on Tue Nov 15 21:40:44 2011  
  5.   
  6. Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.  
  7.   
  8.   
  9. Connected to:  
  10. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production  
  11. With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  12.   
  13.   
  14. specify password for HR as parameter 1:  
  15. Enter value for 1: hr  
  16.   
  17. specify default tablespeace for HR as parameter 2:  
  18. Enter value for 2: user  
  19.   
  20. specify temporary tablespace for HR as parameter 3:  
  21. Enter value for 3: temp  
  22.   
  23. specify password for SYS as parameter 4:  
  24. Enter value for 4: sys  
  25. specify log path as parameter 5:  
  26. Enter value for 5:/home/oracle  
  27. ..............................  
  28. PL/SQL procedure successfully completed.  
  29.   
  30.   
  31. PL/SQL procedure successfully completed.  
  32.   
  33. SQL>  
3、驗證
  1. SQL> select table_name from user_tables;  
  2.   
  3. TABLE_NAME  
  4. ------------------------------   
  5. REGIONS  
  6. LOCATIONS  
  7. DEPARTMENTS  
  8. JOBS  
  9. EMPLOYEES  
  10. JOB_HISTORY  
  11. COUNTRIES  
  12.   
  13. 7 rows selected.  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.