1. 程式人生 > >檢視oracle使用者資料庫連線數

檢視oracle使用者資料庫連線數

1、查詢oracle的連線數 select count(*) from v$session;

ps -ef|grep "(LOCAL=NO)"|wc -l 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;