sql - 检查给定的 DB 对象是否在 Oracle 中使用?

标签 sql oracle stored-procedures function sql-view

嗨,有人知道如何检查给定的 DB 对象(表/ View /SP/函数)是否在 Oracle 内部使用。

例如,检查表“A”是否用于任何 SP/功能或 View 定义。我正在尝试清理数据库中未使用的对象。

我尝试了查询 select * from all_source WHERE TEXT like '%A%' (A 是表名)。如果它不返回任何结果,你认为它没有被使用是否安全?

最佳答案

从这里 ASKTOM question :

You'll have to enable auditing and then come back in 3 months to see.

We don't track this information by default -- also, even with auditing, it may be very possible to have an object that is INDIRECTLY accessed (eg: via a foreign key for example) that won't show up.

You can try USER_DEPENDENCIES but that won't tell you about objects referenced by code in client apps or via dynamic sql



线程中有代码用于检查ALL_SOURCE ,但需要强调的是,这不是 Elixir 。

关于sql - 检查给定的 DB 对象是否在 Oracle 中使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2158731/

相关文章:

sql - 在oracle sql中连接没有外键关系的表并向结果添加一列?

visual-studio-2010 - Entity Framework 模型中的存储过程

LINQ 的 SQL 命令(旋转)

c# - 在 ASP 网站中使用带有 C# 的 SQL 事务

oracle - 如何从 Oracle BLOB 字段中提取文件?

php - 如何使用mysql存储过程插入表

sql - 存储过程是否占用数据库中的一些物理空间?

sql - 如何在 Access SQL 中使用反余弦 (ACOS)

php - Mysql 错误 #1064

sql - 根据另一列中的数据创建编号行 [ORACLE]