devoured elysium
devoured elysium

Reputation: 105077

Finding any reference to a given string in Oracle DB

I want to delete a table from the database, which I know is not being used anywhere in our Java code-base. I was able to also delete it from our DB, but I'm not sure that this may not still pose some kind of problem. Maybe it can still be referenced from a Stored Procedure, or something of the like?

Or does the database actually guarantee that under any circumstance this will not be the case when deleting a table? In case it may be a problem, what would be the best way to search for this specific string in the db such as to find its possible usages?

Unfortunately I don't have dba access to this db.

Thanks

Upvotes: 0

Views: 227

Answers (2)

Pham X. Bach
Pham X. Bach

Reputation: 5442

I think there are 2 reference of table you need to care about.

  1. Dependencies (in table browser, sql navigator/toad has, not sure about others)

  2. Dynamic sql call that table in procedure/function/package. Refer here

But those're not all, because some dynamic sql may use string concatenate

execute immediate 'select max(name) from customer_' || provinceCode into testName;

Upvotes: 0

davegreen100
davegreen100

Reputation: 2115

no such guarantee

but you can run this to find any reference to the table in a stored procedure, package or function

select * from dba_source where lower(text) like '%<tablename>%'

Upvotes: 1

Related Questions