ITPub博客

首页 > 数据库 > Oracle > 【TUNE_ORACLE】列出LOOP套LOOP的PL/SQL代码SQL参考

【TUNE_ORACLE】列出LOOP套LOOP的PL/SQL代码SQL参考

原创 Oracle 作者:Attack_on_Jager 时间:2021-08-04 10:12:14 0 删除 编辑

实验环境

搭建平台:VMware Workstation

OS:RHEL 6.10

Grid&DB:Oracle 11.2.0.4


SQL参考

with x as

(select /*+ materialize */ owner,name,type,line,text,rownum rn from dba_source where

(upper(text) like '%END%LOOP%' or upper(text) like '%FOR%LOOP%'))

select a.owner, a.name, a.type

  from x a, x b

 where ((upper(a.text) like '%END%LOOP%' and

       upper(b.text) like '%END%LOOP%' and a.rn + 1 = b.rn) or

       (upper(a.text) like '%FOR%LOOP%' and

       upper(b.text) like '%FOR%LOOP%' and a.rn + 1 = b.rn))

   and a.owner = b.owner

   and a.name = b.name

   and a.type = b.type

   and a.owner = 'TEST';  --用户名


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69992972/viewspace-2785129/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
在某银行任职DBA,拥有多年数据库运维经验,擅长Oracle,MySQL。尤其擅长Oracle的SQL优化,数据库性能调优,数据库备份、恢复与迁移。拥有的认证:OCM 12c,OCM 11g,MySQL OCP,RHCE,阿里云ACP,巨杉SCDP,软考系统集成工程师认证,Oracle Iaas OCA,OBCA,TDSQL认证,TBase认证

注册时间:2021-01-11

  • 博文量
    142
  • 访问量
    482837