數(shù)據(jù)庫鎖:
--查被鎖的session
SELECT * FROM V$LOCKED_OBJECT T;
--session信息
select * from v$session t where t.SID=17;
--kill掉session
alter system kill session '17,49765';
用戶:
alter user sys identified by oracle;
1.查看所有用戶:
select * from dba_users;
select * from all_users;
select * from user_users;
2.查看用戶或角色系統(tǒng)權(quán)限(直接賦值給用戶或角色的系統(tǒng)權(quán)限):
select * from dba_sys_privs;
select * from user_sys_privs;
3.查看角色(只能查看登陸用戶擁有的角色)所包含的權(quán)限
sql>select * from role_sys_privs;
4.查看用戶對象權(quán)限:
select * from dba_tab_privs;
select * from all_tab_privs;
select * from user_tab_privs;
5.查看所有角色:
select * from dba_roles;
6.查看用戶或角色所擁有的角色:
select * from dba_role_privs;
select * from user_role_privs;
7.查看哪些用戶有sysdba或sysoper系統(tǒng)權(quán)限(查詢時需要相應(yīng)權(quán)限)
select * from V$PWFILE_USERS
比如我要查看用戶 wzsb的擁有的權(quán)限:
SQL> select * from dba_sys_privs where grantee='WZSB';
GRANTEE PRIVILEGE ADMIN_OPTION
------------------------------ ---------------------------------------- ------------
WZSB CREATE TRIGGER NO
WZSB UNLIMITED TABLESPACE NO
比如我要查看用戶 wzsb的擁有的角色:
SQL> select * from dba_role_privs where grantee='WZSB';
GRANTEE GRANTED_ROLE ADMIN_OPTION DEFAULT_ROLE
------------------------------ ------------------------------ ------------ ------------
WZSB DBA NO YES
查看一個用戶所有的權(quán)限及角色
select privilege from dba_sys_privs where grantee='WZSB'
union
select privilege from dba_sys_privs where grantee in
(select granted_role from dba_role_privs where grantee='WZSB' );