oracle 許可權管理常用語句

2021-09-01 06:34:00 字數 1522 閱讀 1727

----------賦權---------

---dba: 擁有全部特權,是系統最高許可權,只有dba才可以建立資料庫結構。

---resource:擁有resource許可權的使用者只可以建立實體,不可以建立資料庫結構。

---connect:擁有connect許可權的使用者只可以登入oracle,不可以建立實體,不可以建立資料庫結構。

---對於普通使用者:授予connect, resource許可權。

---對於dba管理使用者:授予connect,resource, dba許可權。

---系統許可權授權命令:系統許可權只能由dba使用者授出:sys, system(最開始只能是這兩個使用者)

---授權命令:grant connect, resource, dba to 使用者名稱1 [,使用者名稱2]...;

grant connect, resource, dba to testuser

grant connect,resource to testuser;

grant create any sequence to testuser;

grant create any table to testuser;

grant delete any table to testuser;

grant insert any table to testuser;

grant select any table to testuser;

grant unlimited tablespace to testuser;

grant execute any procedure to testuser;

grant update any table to testuser;

grant create any view to testuser;

--檢視當前使用者所有許可權

select * from user_sys_privs;

--檢視所用使用者對錶的許可權

select * from user_tab_privs;

---查詢使用者擁有哪些許可權:

select * from dba_role_privs;

select * from dba_sys_privs;

select * from role_sys_privs;

---查自己擁有哪些系統許可權

select * from session_privs;

--修改使用者密碼,

alter user c##cdbtest2 identified by c##cdbtest2;

---刪除使用者,加上cascade則將使用者連同其建立的東西全部刪除

drop user testdb cascade;

---系統許可權**:系統許可權只能由dba使用者**

revoke connect, resource from user01;

revoke select, update on product from user02;

oracle 常用語句

oracle 產看表空間 select total.name tablespace name free space,total space free space used space,total space from select tablespace name,sum bytes 1024 102...

oracle常用語句

drop tablespace crm online space including contents and datafiles 刪除表空間 drop user wuliu01 cascade 刪除使用者 exp orcl file d dmp 匯出資料庫 imp orcl file e alen...

oracle 常用語句

oracle 常用語句 查詢表的大小 select t.owner,t.segment name,sum t.blocks 8 1024 m as s,t.segment type from dba segments t where t.owner user name group by t.owne...