查找特定表的数据源-ORACLE [英] Find the source of data for certain table - ORACLE

查看:157
本文介绍了查找特定表的数据源-ORACLE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个琐碎的问题.但是,由于我正在研究很久以前由其他人创建的数据库,没有适当的文档或注释,因此遇到了一个关键问题,我需要知道如何将数据插入到特定表中吗?是否有任何脚本或其他方法可以标识数据源.换句话说,我需要知道是否通过某些过程,函数,手动...等插入了数据.我无法搜索所有过程或函数,它们有数百个.我正在使用SQL Developer,它是oracle 11g DB.

This might be trivial question. But as I am working on a DB that was created by others long time ago, no proper documentation or comments included, I came a cross a critical question, I need to know how data is being inserted into certain table? Is there any script or other methods that can identify the data source. In other words, I need to know whether data is inserted via some procedure, function, manually ... etc. I cannot search all procedures or functions, they are hundreds. I am using SQL developer and it's oracle 11g DB.

推荐答案

没有这样的脚本,您可以通过该脚本来确定表的数据源.我能想到的最好的办法是,您可以过滤所有引用表的存储过程

No there is no such script through which you can determine the source of the data for your table. The best I can think of is that you can filter all the stored procedures where your table is referenced

SELECT *
  FROM dba_dependencies
 WHERE referenced_owner = 'SCOTT'
   AND referenced_name  = 'YOUR_TABLE_NAME'
   AND referenced_type  = 'TABLE'

或者您可以使用此脚本

SELECT *
  FROM dba_source
 WHERE UPPER(text) LIKE '%YOUR_TABLE_NAME%';

这将过滤掉表所引用的所有存储的proc/triggers/其他db代码,然后您必须检查使用insert语句的代码.

This will filter out all the stored procs/triggers/other db code in which your table is referenced then you have to check in which code your insert statement is used.

这篇关于查找特定表的数据源-ORACLE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆