oracle-系統權限管理

  • 2019 年 10 月 10 日
  • 筆記

默認用戶 sys system scott 等

sys用戶登陸oracle

sqlplus /nolog    conn / as sysdba;
sqlplus / as sysdba 

顯示登陸用戶

show user;

創建用戶,同時授予會話權限

create user username identified by password;  grant create session to lisi

創建用戶後登陸數據庫(不要在sys登陸窗口登陸,新啟cmd窗口)

sqlplus lisi/lisi

授予建表權限()

grant alter any table to lisi with admin option;
grant create table to lisi;

授予空間權限

grant unlimited tablespace to lisi;

創建表

create table myTable(id int);插入

插入表數據

insert into myTabe values(1);

查詢表

select * from myTable;

刪除表

drop table myTable;

撤銷權限

revoke create table from lisi;

 權限查詢操作(當前用戶擁有哪些系統權限)

select * from user_sys_privs;

為所有用戶(public)添加建表權限

grant create table to public; 

用戶表空間權限

create user www    identified by www    default tablespace users    temporary tablespace temp    quota 50M on users;

創建www用戶

默認表空間users

臨時表空間 temp

限制 50M 使用users

select username, default_tablespace from user_users;

 查詢 用戶缺省表空間 

創建用戶

create user ww identified by ww  grant dba to ww;
--創建用戶  --create user用戶名identified by密碼  create user scott identified by bjsxt;  --給用戶賦予權限一賦予數據庫登靈連接權限  grant connect to scott;  --賦予資源操縱權陰  grant resource to scott;

有道詞典

老版本需要授予空 …

詳細X

The old version need to grant space permission grant unlimited in tablespace to lisi.

用戶創建  					創建用戶  					當前用戶介紹:權限級別的分配  					-------system:系統賬戶  					-------sys:超級管理員  					-------scott:普通用戶    					1、	創建自定義用戶: create user 用戶名 identified by 密碼;  							普通用戶不具備創建用戶的權限,需要使用system賬戶進行創建  							直接創建好的用戶不能登錄,還需要使用system進行權限的分配(角色:一系列權限的集合)  							create user zyp identified by 123456;  						給創建的用戶賦予角色。     grant 角色名,角色名...to 用戶名;  							grant connect to zyp;--賦予鏈接庫權限  							grant resource to zyp;--賦予操作資源權限  							grant dba to zyp;--賦予DBA角色  							grant dba to zyp  						刪除用戶權限  							revoke dba from zyp  							revoke connect from zyp  					2、	刪除用戶  							drop user zyp

alter user [user] account lock;

alter user [user] account unlock;

如何查詢Oracle中所有用戶信息

https://blog.csdn.net/qq_860556105/article/details/79104750