新聞中心
oracle怎么查詢過去某個時刻哪個ip的連接數(shù)
方法一
創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)公司是一家服務多年做網(wǎng)站建設(shè)策劃設(shè)計制作的公司,為廣大用戶提供了做網(wǎng)站、成都做網(wǎng)站,成都網(wǎng)站設(shè)計,廣告投放,成都做網(wǎng)站選創(chuàng)新互聯(lián)公司,貼合企業(yè)需求,高性價比,滿足客戶不同層次的需求一站式服務歡迎致電。
1 通過觸發(fā)器,當產(chǎn)生新會話時觸發(fā)將ip和操作寫入到表中
當前會話ip
select USER,sid,serial#,UTL_INADDR.GET_host_ADDRESS as host,SYS_CONTEXT('USERENV','ip_ADDRESS') as local,SYSDATE
from V$session;
方法二:
查詢監(jiān)聽日志,可以查看ip信息
cd $ORACLE_HOME/network/log/listener.log
通過審計功能,對用戶或?qū)Σ僮鬟M行審計
方法三:
通過日志挖掘,找出當前日志或歸檔日志里的sql
exec dbms_logmnr.start_logmnr(options=dbms_logmnr.dict_from_online_catalog);
如何查看oracle數(shù)據(jù)庫某一張表的最大連接數(shù)
用putty連接linux服務器,切換到
su
-
oracle
sqlplus
/nolog
連接到數(shù)據(jù)庫;
conn
/
as
sysdba
show
parameter
session
alter
system
set
sessions
=
values(比如400)
scope
=
spfile;//注意此處的分號;
show
parameter
process
alter
system
set
processes
=
values(比如450)scope
=
spfile;//注意此處的分號;
show
parameter
license
//查看最大的process;
重新啟動服務器;
oracle的連接數(shù)(sessions)與其參數(shù)文件中的進程數(shù)(process)有關(guān),它們的關(guān)系如下:
sessions=(1.1*process+5)
但是我們增加process數(shù)時,往往數(shù)據(jù)庫不能啟動了。這因為我們還漏調(diào)了一個unix系統(tǒng)參數(shù):它是/etc/system/中semmns,這是unix系統(tǒng)的信號量參數(shù)。每個process會占用一個信號量。semmns調(diào)整后,
需要重新啟動unix操作系統(tǒng),參數(shù)才能生效。不過它的大小會受制于硬件的內(nèi)存或oracle
sga。范圍可從200——2000不等。
semmns的計算公式為:semmnsprocesses+instance_processes+system
processes=數(shù)據(jù)庫參數(shù)processes的值
instance_processes=5(smon,pmon,dbwr,lgwr,arch)
system=系統(tǒng)所占用信號量。系統(tǒng)所占用信號量可用下列命令查出:#ipcs
-sb
如何查看oracle當前連接數(shù),會話數(shù)
查看session:
select * from v$session where username is not null
select username,count(username) from v$session where username is not null group by username
當前連接數(shù):
select count(*) from v$process
查看連接數(shù)參數(shù)的設(shè)置情況
select value from v$parameter where name = 'processes'
Select count(*) from v$session where status='ACTIVE' #并發(fā)連接數(shù)
plsql如何看oracle數(shù)據(jù)庫連接數(shù)
你可以通過下面語句去查看:
select
lic.SESSIONS_CURRENT
from
v$license
lic;
或者你也可以通過下面語句去查看下,也許也有你想要理解的東西
select
name,value
from
v$parameter;
在這些參數(shù)中,通過那么去找到你想要的對象的值;
希望能幫助你,也能被采納!
怎樣查看oracle當前的連接數(shù)
目前總結(jié)的語句,在查看數(shù)據(jù)的連接情況很有用 ,寫完程序一邊測試代碼一邊查看數(shù)據(jù)庫連接的釋放情況有助于分析優(yōu)化出一個健壯的系統(tǒng)程序來。
1.
Sql代碼
1.select count(*) from v$process
select count(*) from v$process --當前的數(shù)據(jù)庫連接數(shù)
2.
Sql代碼
1.select value from v$parameter where name = 'processes'
select value from v$parameter where name = 'processes'--數(shù)據(jù)庫允許的最大連接數(shù)
3.
Sql代碼
1.alter system set processes = 300 scope = spfile;
alter system set processes = 300 scope = spfile;--修改最大連接數(shù):
4.
Sql代碼
1.shutdown immediate;
2.startup;
shutdown immediate;
startup;--重啟數(shù)據(jù)庫
5.
Sql代碼
1.SELECT osuser, a.username,cpu_time/executions/1000000||'s', b.sql_text,machine
2.from v$session a, v$sqlarea b
3.where a.sql_address =b.address order by cpu_time/executions desc;
SELECT osuser, a.username,cpu_time/executions/1000000||'s', b.sql_text,machine
from v$session a, v$sqlarea b
where a.sql_address =b.address order by cpu_time/executions desc;
--查看當前有哪些用戶正在使用數(shù)據(jù)
6.
Sql代碼
1.select count(*) from v$session
select count(*) from v$session --當前的session連接數(shù)
7.
Sql代碼
1.select count(*) from v$session where status='ACTIVE'
select count(*) from v$session where status='ACTIVE' --并發(fā)連接數(shù)
8.
Sql代碼
1.show parameter processes
show parameter processes --最大連接
9.
Sql代碼
1.alter system set processes = value scope = spfile;
怎樣獲取Oracle的連接數(shù)和活動會話數(shù)
查看session:
select * from v$session where username is not null
select username,count(username) from v$session where username is not null group by username
當前連接數(shù):
select count(*) from v$process
查看連接數(shù)參數(shù)的設(shè)置情況
select value from v$parameter where name = 'processes'
Select count(*) from v$session where status='ACTIVE' #并發(fā)連接數(shù)
新聞標題:oracle怎么查連接數(shù),oracle數(shù)據(jù)庫連接數(shù)怎么查
本文URL:http://fisionsoft.com.cn/article/hdgshs.html