简体   繁体   English

按表名查找存储过程 (Oracle)

[英]Find Stored Procedure By Table Name (Oracle)

Need help.需要帮忙。 Every morning at 4 o'clock a table is created in the database, I need to understand what sources are used to create it, so I tried to find a stored procedure that creates this table using all_source or dba_source (select * from all_source where upper(text) like '%TABLE_NAME%', but the result was returned empty. I think this has to do with access restrictions. Is there any other way to solve my problem? Thanks. Oracle 12c/ plsql developer. I only have table name and schema每天早上4点在数据库中创建一个表,我需要了解创建它使用什么源,所以我试图找到一个使用all_source或dba_source创建这个表的存储过程(select * from all_source where upper (text) like '%TABLE_NAME%',但结果返回为空。我认为这与访问限制有关。还有其他方法可以解决我的问题吗?谢谢。Oracle 12c/ plsql 开发人员。我只有表名和架构

You can use:您可以使用:

select owner,
       job_name,
       job_style,
       job_type,
       program_name,
       job_action,
       start_date,
       repeat_interval,
       schedule_name,
       last_start_date,
       next_run_date,
       state
from   all_scheduler_jobs
WHERE  NEXT_RUN_DATE >= TRUNC(SYSDATE) + INTERVAL '27' HOUR
AND    NEXT_RUN_DATE <  TRUNC(SYSDATE) + INTERVAL '29' HOUR
order by
       owner,
       job_name;

To look for scheduled jobs that are next due to run after 03:00 tomorrow and before 05:00 tomorrow and then check the action that it invokes.查找下一个将在明天 03:00 之后和明天 05:00 之前运行的计划作业,然后检查它调用的操作。

If that returns no rows then you can either widen the time range or remove the time filter and look at all the jobs.如果没有返回任何行,那么您可以扩大时间范围或删除时间过滤器并查看所有作业。

Alternatively, you can check to see if a script is being run from the operating system via a cron job.或者,您可以通过cron作业检查是否正在从操作系统运行脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM