研究背景
測(cè)試環(huán)境
1. 操作系統(tǒng):redhat7
2. 數(shù)據(jù)庫(kù)版本:19.3.0
3. 架構(gòu):單機(jī)
測(cè)試過(guò)程
$vi conn.sh
sqlplus sys/[email protected]:1521/orcl as sysdba
select * from v$version;
exit;
$vi conn1.sh
sqlplus sys/[email protected]:1521/orcl1 as sysdba
select * from v$version;
exit;
$vi conn2.sh
sqlplus sys/[email protected]:1521/orcl2 as sysdba
select * from v$version;
exit;
$vi connect.sh
for i in {1..200000}
do
for j in {1..40}
do
sh /home/oracle/conn.sh
done
done
EOF
$vi connect1.sh
for i in {1.. 200000}
do
for j in {1. .40}
do
sh /home/oracle/conn1.sh
done
done
EOF
…
$vi connect2.sh
for i in {1.. 200000}
do
for j in {1. .40}
do
sh /home/oracle/conn2.sh
done
done
EOF
…
nohup sh connect.sh > /dev/null 2>&1&
nohup sh connect1.sh > /dev/null 2>&1&
nohup sh connect2.sh > /dev/null 2>&1&
[oracle@orcl:/u01/app/oracle/diag/tnslsnr/orcl/listener/trace]$ tail -20f listener.log
$grep 18-FEB-2022 listener.log | sed s/*.*SERVICE_NAME=/ /g;s/).*HOST=/ /g;s/).*$//g | awk
{if(NF==4){print "insert into t_tab
values("$1","$2","$3","$4");"}} >
/home/oracle/insert.sql
--a1 日期;
--a2 時(shí)間;
--a3 服務(wù)名;
--a4 客戶端ip。
Create table t_tab( a1 varchar2(50),a2 varchar2(50),a3 varchar2(50),a4 varchar2(50));
@/home/oracle/insert.sql
select a1,substr(a2,1,5),a3,count(1) from t_tab where a3 in (orcl,orcl1,orcl2) group by a1,substr(a2,1,5),a3 order by count(1) desc;
測(cè)試總結(jié)
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/129601.html
閱讀 1356·2023-01-11 13:20
閱讀 1707·2023-01-11 13:20
閱讀 1215·2023-01-11 13:20
閱讀 1906·2023-01-11 13:20
閱讀 4165·2023-01-11 13:20
閱讀 2757·2023-01-11 13:20
閱讀 1402·2023-01-11 13:20
閱讀 3671·2023-01-11 13:20