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