ITPub博客

首页 > 数据库 > Oracle > [20230516]完善spext.sql脚本.txt

[20230516]完善spext.sql脚本.txt

原创 Oracle 作者:lfree 时间:2023-05-28 20:00:39 0 删除 编辑

[20230516]完善spext.sql脚本.txt

--//以前写抽取sql profile outline的脚本有一些小问题,加入sqlobj$auxdata 表,增加显示ad.description,ad.last_modified
--//格式化如下:

column hint format a100
column name format a40
column description format a40
column last_modified format a30
SELECT EXTRACTVALUE (VALUE (h), '.') AS hint
      ,so.name
      ,substr(ad.description,1,40) description
      ,ad.last_modified
  FROM SYS.sqlobj$data od
      ,SYS.sqlobj$ so
      ,SYS.sqlobj$auxdata ad
      ,TABLE
       (
          XMLSEQUENCE
          (
             EXTRACT (XMLTYPE (od.comp_data), '/outline_data/hint')
          )
       ) h
 WHERE     (   so.NAME IN ('profile &&1', 'tuning &&1', 'switch tuning &&1')
            OR LOWER (so.name) LIKE LOWER ('%&&1%')
            OR LOWER (ad.description) LIKE LOWER('%&&1%') )
       AND so.signature = od.signature
       AND so.CATEGORY = od.CATEGORY
       AND so.obj_type = od.obj_type
       AND so.plan_id = od.plan_id
       AND so.signature = ad.signature
       AND so.category = ad.category;

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

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7969373