<bdo id='4EDAL'></bdo><ul id='4EDAL'></ul>

      <i id='4EDAL'><tr id='4EDAL'><dt id='4EDAL'><q id='4EDAL'><span id='4EDAL'><b id='4EDAL'><form id='4EDAL'><ins id='4EDAL'></ins><ul id='4EDAL'></ul><sub id='4EDAL'></sub></form><legend id='4EDAL'></legend><bdo id='4EDAL'><pre id='4EDAL'><center id='4EDAL'></center></pre></bdo></b><th id='4EDAL'></th></span></q></dt></tr></i><div id='4EDAL'><tfoot id='4EDAL'></tfoot><dl id='4EDAL'><fieldset id='4EDAL'></fieldset></dl></div>
      <legend id='4EDAL'><style id='4EDAL'><dir id='4EDAL'><q id='4EDAL'></q></dir></style></legend>

    1. <small id='4EDAL'></small><noframes id='4EDAL'>

    2. <tfoot id='4EDAL'></tfoot>

        我们如何确定我的 oracle 表中的列正在被另一个表的触发器填充/更新?

        How can we figure out that a column in my oracle table is being populated/updated by a trigger of another table?(我们如何确定我的 oracle 表中的列正在被另一个表的触发器填充/更新?)

        <small id='WG2E9'></small><noframes id='WG2E9'>

      1. <legend id='WG2E9'><style id='WG2E9'><dir id='WG2E9'><q id='WG2E9'></q></dir></style></legend>
            <bdo id='WG2E9'></bdo><ul id='WG2E9'></ul>
            <i id='WG2E9'><tr id='WG2E9'><dt id='WG2E9'><q id='WG2E9'><span id='WG2E9'><b id='WG2E9'><form id='WG2E9'><ins id='WG2E9'></ins><ul id='WG2E9'></ul><sub id='WG2E9'></sub></form><legend id='WG2E9'></legend><bdo id='WG2E9'><pre id='WG2E9'><center id='WG2E9'></center></pre></bdo></b><th id='WG2E9'></th></span></q></dt></tr></i><div id='WG2E9'><tfoot id='WG2E9'></tfoot><dl id='WG2E9'><fieldset id='WG2E9'></fieldset></dl></div>
              <tbody id='WG2E9'></tbody>

                  <tfoot id='WG2E9'></tfoot>
                  本文介绍了我们如何确定我的 oracle 表中的列正在被另一个表的触发器填充/更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  考虑一个场景,其中有两个表A"和B".

                  Consider a scenario, where there are two tables "A" and "B".

                  表A"有一个触发器Ta"[在我加入这个项目之前很久就写好了,因此我完全不知道触发器],它更新了表B"中名为colB"的列.

                  Table "A" has a trigger "Ta" [written long before me joining this project and thus I'm completely unaware of the trigger], which updates a column named "colB" in table "B".

                  现在,由于我主要使用表B"并担心colB"的获取方式,因此我不知道触发器Ta"是否正在更新此列.

                  Now, since I'm mostly using table "B" and concerned about the way "colB" is getting, I won't know if trigger "Ta" is updating this column.

                  所以我的问题是,是否有直接的 oracle 查询/方法来查找一个表中的列是否被另一个表上运行的任何触发器更新?

                  So my question is, is there a direct oracle query/way to find if a column in one table is getting updated by any trigger running on another table?

                  预先感谢您在这方面教育我.

                  Thanks in advance for educating me on this.

                  问候a.b

                  推荐答案

                  Oracle 细粒度依赖关系跟踪知道使用了哪些列.不幸的是,无法跟踪该依赖项是用于读取还是写入.并且没有默认的 DBA_DEPENDENCY_COLUMNS 视图来查找此信息.

                  Oracle fine grained dependency tracking knows which columns are used. Unfortunately, there is no way to track if that dependency is for reading or writing. And there is no default DBA_DEPENDENCY_COLUMNS view to find this information.

                  但幸运的是 Rob van Wijk 创建了这样的视图.他的博客有更多信息,包括授权和 create view 声明,大约在页面的一半.

                  But luckily Rob van Wijk has created such a view. His blog has some more information, including the grants and create view statement, about half-way down the page.

                  示例:

                  drop table a;
                  drop table b;
                  
                  create table a(colA number);
                  create table b(colB number, read_only number, not_used number);
                  
                  create or replace trigger Ta
                  after update or insert or delete on a
                  begin
                      update b set colB = read_only;
                  end;
                  /
                  
                  --What triggers are referencing B's columns?
                  select owner, name, type, referenced_column
                  from dba_dependency_columns
                  where referenced_owner = user
                      and referenced_name = 'B'
                      and type = 'TRIGGER';
                  
                  OWNER    NAME  TYPE     REFERENCED_COLUMN
                  -----    ----  ----     -----------------
                  JHELLER  TA    TRIGGER  COLB
                  JHELLER  TA    TRIGGER  READ_ONLY
                  

                  该视图使用了几个未记录的表和一些高级 SQL 功能.这种视图在生产服务器上不是一个好主意.但它可能比任何涉及解析 SQL 的解决方案准确得多.

                  The view uses several undocumented tables and some advanced SQL features. This view would not be a good idea on a production server. But it is probably much more accurate than any solution that involves parsing SQL.

                  这篇关于我们如何确定我的 oracle 表中的列正在被另一个表的触发器填充/更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                  How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                  Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                  Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                  Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                  Reset Sequence in oracle 11g(oracle 11g 中的重置序列)

                    <i id='Gwtry'><tr id='Gwtry'><dt id='Gwtry'><q id='Gwtry'><span id='Gwtry'><b id='Gwtry'><form id='Gwtry'><ins id='Gwtry'></ins><ul id='Gwtry'></ul><sub id='Gwtry'></sub></form><legend id='Gwtry'></legend><bdo id='Gwtry'><pre id='Gwtry'><center id='Gwtry'></center></pre></bdo></b><th id='Gwtry'></th></span></q></dt></tr></i><div id='Gwtry'><tfoot id='Gwtry'></tfoot><dl id='Gwtry'><fieldset id='Gwtry'></fieldset></dl></div>

                  1. <small id='Gwtry'></small><noframes id='Gwtry'>

                      1. <tfoot id='Gwtry'></tfoot>
                      2. <legend id='Gwtry'><style id='Gwtry'><dir id='Gwtry'><q id='Gwtry'></q></dir></style></legend>
                          <tbody id='Gwtry'></tbody>
                          • <bdo id='Gwtry'></bdo><ul id='Gwtry'></ul>