DBA oracle 常用的命令語句 dba許可權》

2021-08-07 13:42:56 字數 1676 閱讀 8482

可以執行以下語句:

select username,serial#, sid from v$session;  ---查詢使用者會話

alter system kill session 'serial#, sid ';---刪除相關使用者會話

建議以後臺登陸刪除使用者會話

1、查詢oracle的連線數

select count(*) from v$session;

2、查詢oracle的併發連線數

select count(*) from v$session where status='active';

3、檢視不同使用者的連線數

select username,count(username) from v$session where username is not null group by username;

4、檢視所有使用者:

select * from all_users;

5、檢視使用者或角色系統許可權(直接賦值給使用者或角色的系統許可權):

select * from dba_sys_privs;

select * from user_sys_privs;

6、檢視角色(只能檢視登陸使用者擁有的角色)所包含的許可權

select * from role_sys_privs;

7、檢視使用者物件許可權:

select * from dba_tab_privs;

select * from all_tab_privs;

select * from user_tab_privs;

8、檢視所有角色:

select * from dba_roles;

9、檢視使用者或角色所擁有的角色:

select * from dba_role_privs;

select * from user_role_privs;

10、檢視哪些使用者有sysdba或sysoper系統許可權(查詢時需要相應許可權)

select * from v$pwfile_users;

修改資料庫允許的最大連線數:

alter system set processes = 300 scope = spfile;

檢視游標數量

select * from v$open_cursor where user_name=''

查詢資料庫允許的最大連線數:

select value from v$parameter where name = 'processes';

或者:show parameter processes;

查詢資料庫允許的最大游標數:

select value from v$parameter where name = 'open_cursors'

檢視oracle版本

select banner from sys.v_$version;

按降序顯示使用者"system"為每個會話開啟的游標數

select o.sid, osuser, machine, count(*) num_curs  from v$open_cursor o, v$session s  where user_name = 'system' and o.sid=s.sid   group by o.sid, osuser, machine  order by num_curs desc;

mysql常用的yu語句 常用mysql語句備份

1.場景 由於需求變動,需要將一張表裡面的兩個字段合併並存到其中的乙個欄位中 可以這樣 update table set column1 concat ws ifnull column1,ifnull column2,也可以這樣 update table set column1 concat ifn...

Linux中Groupadd命令的基本語法

你必須知道groupadd命令的基本語法。它的基本語法如下。groupadd option group name 注意 所有的命令都要在有sudo許可權或管理員使用者許可權 root使用者的情況下使用。如何在linux系統中使用groupadd命令建立群組 正如你在上一節中看到的groupadd命令...

常用mysql語法 Mysql一些常用的語法

一.show databases 檢視有哪些資料庫 use cashloantest 切換到該資料庫 select database 檢視當前所使用的資料庫 show tables delete from 表名 刪除表的所有記錄資料 注 執行命令set sql safe updates 0 後才能刪...