通过数据库链接运行时遇到问题

时间:2019-12-20 07:53:59

标签: sql oracle dblink

通过DB链接执行查询时遇到的问题,如果我直接在目标数据库中运行相同的查询,则最多需要30秒。但是通过DBlink,它可以浏览长时间运行的会话并创建多个会话。

select distinct adj.account_num,cpad.attribute_value as SERVICE_ID_GENEVA,adj.adjustment_txt,adj.adjustment_net_mny/1000 as ADJ_AMT 
from geneva_Admin.adjustment@IRASDB_GENEVADB adj, 
     geneva_Admin.custproductattrdetails@IRASDB_GENEVADB cpad, 
     geneva_Admin.custproductdetails@IRASDB_GENEVADB cpd 
where cpad.customer_ref=cpd.customer_ref 
  and cpad.product_seq=cpd.product_seq 
  and cpd.account_num=adj.account_num 
  and cpad.attribute_value in (select distinct cpad.attribute_value 
                               from  geneva_Admin.custproductattrdetails@IRASDB_GENEVADB cpad, 
                                     geneva_Admin.custoverrideprice@IRASDB_GENEVADB cop 
                               where cpad.customer_ref=cop.customer_ref 
                                 and cpad.product_seq=cop.product_seq 
                                 and cop.recurring_number>0 
                                 and cpad.attribute_value in (select SERVICEID_BPM from BPM_SFDC_common_data)) 
   and adj.adjustment_txt LIKE ('%'||cpad.attribute_value||'%')
   and adj.adjustment_type_id=201

0 个答案:

没有答案