研究背景
测试环境
1. 操作系统:redhat7
2. 数据库版本:19.3.0
3. 架构:单机
测试过程
$vi conn.sh
sqlplus sys/system@192.168.10.130:1521/orcl as sysdba
select * from v$version;
exit;
$vi conn1.sh
sqlplus sys/system@192.168.10.130:1521/orcl1 as sysdba
select * from v$version;
exit;
$vi conn2.sh
sqlplus sys/system@192.168.10.130: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 时间;
--a3 服务名;
--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;
测试总结
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129601.html
阅读 1235·2023-01-11 13:20
阅读 1542·2023-01-11 13:20
阅读 995·2023-01-11 13:20
阅读 1651·2023-01-11 13:20
阅读 3958·2023-01-11 13:20
阅读 2456·2023-01-11 13:20
阅读 1288·2023-01-11 13:20
阅读 3450·2023-01-11 13:20