Oracle建立使用者及刪除使用者的執行個體

來源:互聯網
上載者:User

Oracle建立使用者及刪除使用者都是我們經常會用到的,下面就以執行個體的形式為您介紹Oracle建立使用者及刪除使用者的實現過程,希望對您能有所協助。

Oracle建立使用者執行個體:

首先,使用sys使用者登陸sqlplus,然後建立使用者名稱密碼均為test的使用者,資料表空間為users

後給test賦resource,connect,dba許可權

Cmd代碼

  1. D:\>sqlplus /nolog    
  2.      
  3. SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 1月 26 13:34:09 2010    
  4.     
  5. Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.    
  6.     
  7. SQL> conn / as sysdba;    
  8. 已串連。    
  9. SQL> create user test identified by test default tablespace users;    
  10.     
  11. 使用者已建立    
  12.     
  13. SQL> grant resource,connect,dba to test;    
  14.     
  15. 授權成功。    
  16.     
  17. SQL> commit;    
  18.     
  19. 提交完成。    
  20.     
  21. SQL>    
  22.  
  23. D:\>sqlplus /nolog  
  24.  
  25. SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 1月 26 13:34:09 2010  
  26.  
  27. Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.  
  28.  
  29. SQL> conn / as sysdba;  
  30. 已串連。  
  31. SQL> create user test identified by test default tablespace users;  
  32.  
  33. 使用者已建立  
  34.  
  35. SQL> grant resource,connect,dba to test;  
  36.  
  37. 授權成功。  
  38.  
  39. SQL> commit;  
  40.  
  41. 提交完成。  
  42.  
  43. SQL> 
  44.  

刪除使用者執行個體:

刪除使用者後邊必須跟cascade,否則失敗  

Sql代碼

  1. SQL> drop user test cascade;    
  2.     
  3. 使用者已丟棄    
  4.     
  5. SQL>    
  6.  
  7. SQL> drop user test cascade;   
  8.  
  9. 使用者已丟棄   
  10.  
  11. SQL>   

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.