问题描述
你好,
首先,感谢您所做的出色工作-我 (希望其他许多人) 非常感谢。
我想问一下是否有一种自动的方法来识别从SQL调用的PL/SQL函数。
我想准备在12c中使用PRAGMA UDF的 “候选人” 列表,但是我不知道如何搜索它们。
提前谢谢,
亲切的问候
首先,感谢您所做的出色工作-我 (希望其他许多人) 非常感谢。
我想问一下是否有一种自动的方法来识别从SQL调用的PL/SQL函数。
我想准备在12c中使用PRAGMA UDF的 “候选人” 列表,但是我不知道如何搜索它们。
提前谢谢,
亲切的问候
专家解答
在一般情况下,不,我不知道找到这个的方法。除了抓取v $ 视图。
如果您在12.2上,则可以使用PL/Scope检查PL/SQL中调用其他PL/SQL的SQL。
HT给Steven Feuerstein上面的SQL语句。他更多地谈论使用PL/Scope在PL/SQL中查找SQL中的PL/SQL:https://stevenfeuersteinonplsql.blogspot.co.uk/2017/06/more-122-plscope-magic-find-sql.html
如果您在12.2上,则可以使用PL/Scope检查PL/SQL中调用其他PL/SQL的SQL。
alter session set plscope_settings='identifiers:all, statements:all' / create or replace function f ( p int ) return int as begin return p + 1; end f; / create or replace procedure p ( param int ) as val int; begin select f(param) into val from dual; dbms_output.put_line(val); end p; / exec p(1); with my_prog_unit as ( select user owner, 'P' object_name from dual ), full_set as ( select ai.usage, ai.usage_id, ai.usage_context_id, ai.type, ai.name from all_identifiers ai, my_prog_unit where ai.object_name = my_prog_unit.object_name and ai.owner = my_prog_unit.owner union all select st.type, st.usage_id, st.usage_context_id, 'TYPE', 'NAME' from all_statements st, my_prog_unit where st.object_name = my_prog_unit.object_name and st.owner = my_prog_unit.owner ), dml_statements as ( select st.owner, st.object_name, st.line, st.usage_id, st.type from all_statements st, my_prog_unit where st.object_name = my_prog_unit.object_name and st.owner = my_prog_unit.owner and st.type in ('SELECT', 'UPDATE', 'DELETE') ) select st.owner, st.object_name, st.line, st.type, s.text from dml_statements st, all_source s where ('CALL', 'FUNCTION') in ( select fs.usage, fs.type from full_set fs connect by prior fs.usage_id = fs.usage_context_id start with fs.usage_id = st.usage_id ) and st.line = s.line and st.object_name = s.name and st.owner = s.owner; OWNER OBJECT_NAME LINE TYPE TEXT CHRIS P 4 SELECT select f(param)复制
HT给Steven Feuerstein上面的SQL语句。他更多地谈论使用PL/Scope在PL/SQL中查找SQL中的PL/SQL:https://stevenfeuersteinonplsql.blogspot.co.uk/2017/06/more-122-plscope-magic-find-sql.html
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
597次阅读
2025-04-15 17:24:06
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
576次阅读
2025-04-18 14:18:38
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
491次阅读
2025-04-08 09:12:48
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
474次阅读
2025-04-20 10:07:02
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
459次阅读
2025-04-22 00:20:37
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
434次阅读
2025-04-22 00:13:51
Oracle 19c RAC更换IP实战,运维必看!
szrsu
434次阅读
2025-04-08 23:57:08
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
419次阅读
2025-04-17 17:02:24
火焰图--分析复杂SQL执行计划的利器
听见风的声音
367次阅读
2025-04-17 09:30:30
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
358次阅读
2025-04-15 14:48:05