新聞中心
oracle怎么查詢過(guò)去某個(gè)時(shí)刻哪個(gè)ip的連接數(shù)
方法一

創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)公司是一家服務(wù)多年做網(wǎng)站建設(shè)策劃設(shè)計(jì)制作的公司,為廣大用戶提供了做網(wǎng)站、成都做網(wǎng)站,成都網(wǎng)站設(shè)計(jì),廣告投放,成都做網(wǎng)站選創(chuàng)新互聯(lián)公司,貼合企業(yè)需求,高性價(jià)比,滿足客戶不同層次的需求一站式服務(wù)歡迎致電。
1 通過(guò)觸發(fā)器,當(dāng)產(chǎn)生新會(huì)話時(shí)觸發(fā)將ip和操作寫入到表中
當(dāng)前會(huì)話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
通過(guò)審計(jì)功能,對(duì)用戶或?qū)Σ僮鬟M(jìn)行審計(jì)
方法三:
通過(guò)日志挖掘,找出當(dāng)前日志或歸檔日志里的sql
exec dbms_logmnr.start_logmnr(options=dbms_logmnr.dict_from_online_catalog);
如何查看oracle數(shù)據(jù)庫(kù)某一張表的最大連接數(shù)
用putty連接linux服務(wù)器,切換到
su
-
oracle
sqlplus
/nolog
連接到數(shù)據(jù)庫(kù);
conn
/
as
sysdba
show
parameter
session
alter
system
set
sessions
=
values(比如400)
scope
=
spfile;//注意此處的分號(hào);
show
parameter
process
alter
system
set
processes
=
values(比如450)scope
=
spfile;//注意此處的分號(hào);
show
parameter
license
//查看最大的process;
重新啟動(dòng)服務(wù)器;
oracle的連接數(shù)(sessions)與其參數(shù)文件中的進(jìn)程數(shù)(process)有關(guān),它們的關(guān)系如下:
sessions=(1.1*process+5)
但是我們?cè)黾觩rocess數(shù)時(shí),往往數(shù)據(jù)庫(kù)不能啟動(dòng)了。這因?yàn)槲覀冞€漏調(diào)了一個(gè)unix系統(tǒng)參數(shù):它是/etc/system/中semmns,這是unix系統(tǒng)的信號(hào)量參數(shù)。每個(gè)process會(huì)占用一個(gè)信號(hào)量。semmns調(diào)整后,
需要重新啟動(dòng)unix操作系統(tǒng),參數(shù)才能生效。不過(guò)它的大小會(huì)受制于硬件的內(nèi)存或oracle
sga。范圍可從200——2000不等。
semmns的計(jì)算公式為:semmnsprocesses+instance_processes+system
processes=數(shù)據(jù)庫(kù)參數(shù)processes的值
instance_processes=5(smon,pmon,dbwr,lgwr,arch)
system=系統(tǒng)所占用信號(hào)量。系統(tǒng)所占用信號(hào)量可用下列命令查出:#ipcs
-sb
如何查看oracle當(dāng)前連接數(shù),會(huì)話數(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
當(dāng)前連接數(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ù)庫(kù)連接數(shù)
你可以通過(guò)下面語(yǔ)句去查看:
select
lic.SESSIONS_CURRENT
from
v$license
lic;
或者你也可以通過(guò)下面語(yǔ)句去查看下,也許也有你想要理解的東西
select
name,value
from
v$parameter;
在這些參數(shù)中,通過(guò)那么去找到你想要的對(duì)象的值;
希望能幫助你,也能被采納!
怎樣查看oracle當(dāng)前的連接數(shù)
目前總結(jié)的語(yǔ)句,在查看數(shù)據(jù)的連接情況很有用 ,寫完程序一邊測(cè)試代碼一邊查看數(shù)據(jù)庫(kù)連接的釋放情況有助于分析優(yōu)化出一個(gè)健壯的系統(tǒng)程序來(lái)。
1.
Sql代碼
1.select count(*) from v$process
select count(*) from v$process --當(dāng)前的數(shù)據(jù)庫(kù)連接數(shù)
2.
Sql代碼
1.select value from v$parameter where name = 'processes'
select value from v$parameter where name = 'processes'--數(shù)據(jù)庫(kù)允許的最大連接數(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ù)庫(kù)
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;
--查看當(dāng)前有哪些用戶正在使用數(shù)據(jù)
6.
Sql代碼
1.select count(*) from v$session
select count(*) from v$session --當(dāng)前的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ù)和活動(dòng)會(huì)話數(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
當(dāng)前連接數(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ù)
當(dāng)前名稱:oracle怎么查連接數(shù),oracle數(shù)據(jù)庫(kù)連接數(shù)怎么查
轉(zhuǎn)載來(lái)于:http://fisionsoft.com.cn/article/hdgshs.html


咨詢
建站咨詢
