oracle 知识点

你能否在跑测试的时候,同时用下面的sql,  抓一下数据库里面的sql ,我要看看是哪个sql慢的。 

 

 

 

你可以用deployop用户执行下面的sql 。 

 

 

 

select distinct

 

s.sid,s.serial#,s.username,p.spid,sw.event,sw.p2,sw.P1RAW,s.sql_hash_value

 

from v$process p,v$session s,v$session_wait sw

 

where p.addr=s.PADDR and sw.event not like 'SQL%' and sw.event not like 'rdbms%'

 

and s.sid=sw.sid

 

order by event,username,sql_hash_value;

 

2.

select *
from (select t.name 项目名称,
t.project_code 项目编号,
t.project_money 项目金额,
t.agency_user_id1,
(select x.name from ss_users x where x.id = t.agency_user_id1) b2b项目负责人,
(select wm_concat((select z.name from ss_users z where z.id = y.declare_user_id))
from tb_declare_stock y
where y.id in (select distinct x.dest_id
from tb_stock_project_bundle_chr x
where x.stpr_id = t.id
and x.status = 1)) 项目经办人,
(select wm_concat((select y.name from ss_users y where y.id = x.user_id))
from tb_stpr_team x
where x.stpr_id = t.id
and x.status = 1) 采购小组,
(select wm_concat((select y.name from t_orgs y where y.id = x.supply_id))
from tb_stpr_selected_sup x
where x.stpr_id = t.id
and x.is_selected = 1) 入围供应商
from tb_stock_project t
where t.project_money >= 1000000)
where rownum < 2


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值