oracle學習筆記 資源回收筒&使用者權限&匯入匯出

來源:互聯網
上載者:User

標籤:oracle

閃回刪除的表:
刪除表:
drop table aa;
drop table aa purge; 不經過資源回收筒,不能閃回

閃回刪除的表文法:--所謂閃回的意思就是還原資源回收筒中的表
FLASHBACK TABLE [schema.]<table_name> 
TO  
{[BEFORE DROP [RENAME TO table]]  
[ENABLE|DISABLE]TRIGGERS} 
查看資源回收筒
show recyclebin

清空資源回收筒
purge recyclebin;

重名的對象:
會先閃回後刪除的。

注意:
管理員沒有資源回收筒


=============================================================
1,建立使用者
create user identified by 密碼;


2,修改使用者密碼
alter user 使用者名稱 identified by 新密碼;
修改管理員密碼:
alter user sys identified by 新密碼;


3,使用者的鎖定與解鎖
alter user 使用者名稱 account unlock/lock;


4,給使用者授權
grant 許可權 to user;


5,收回使用者的許可權
revoke 許可權 from myuser

6,刪除使用者
drop user myuser;


給mytest分配空間配額:
     alter user mytest quota unlimited on users;
     quota 容量的意思
     unlimited 無限制
     on users 在users這個資料表空間上沒有限制。

角色:
     例如:有經理,員工1,員工2;
          經理:
               查詢、更新、刪除、插入
          員工:
               查詢、更新
     可以有兩個角色
          HR_EMP     兩個許可權
          HR_MGR     繼承HR_EMP,自己還有兩個許可權,共4個。


要求要有create role許可權,才可以建立角色,可以使用管理員操作。
     conn / as sysdba
     create role role1; // 這時這個角色沒有任何許可權。


把許可權授予給角色
     grant create session to role1;
     
角色繼承:
     create role role2;
     grant create table,role1 to role2; // 相當於把role1當成一個組合的新許可權使用,與普通許可權一樣使用,這就是繼承角色了。

把角色授予角色
     grant role1 to aa;
     
Oracle實現預置好了一些角色:
     CONNECT
     RESOURCE
     DBA
     …
對於普通使用者,一般要有CONNECT與resource。
例:
     create user mytest2 identified by password;
     grant connect, resource to mytest2; 
     一般就是這樣用的,建立完使用者後就會指定許可權。


在RESOURCE角色中就含有空間配額

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

oracle學習筆記 資源回收筒&使用者權限&匯入匯出

聯繫我們

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