Artificially intelligent spam?
Stew Ashton, February 24, 2025 - 7:39 am UTC
So this is new: use AI to generate a plausible answer to the question, then use that "answer" as a hook to get clicks. What next?
February 24, 2025 - 11:11 am UTC
Indeed; I've removed the spam answer.
A reader, March 30, 2025 - 6:51 pm UTC
Great question — moving a schema like abc to a new server with a different name definitely calls for a full dependency check. You're right to focus on packages, procedures, and functions. I'd also suggest checking views, triggers, and any hardcoded references in dynamic SQL.
April 01, 2025 - 3:32 am UTC
Yup
Additional considerations
Stew Ashton, April 01, 2025 - 8:47 am UTC
I regularly move schemas among test and development environments, with only developer access. This requires a script that creates all the objects (tables, code, etc.) in the proper order.
Here's my method:
- Get foreign key relationships between tables from USER_CONSTRAINTS joined to USER_INDEXES
- Get dependencies from USER_DEPENDENCIES
- Get indexes (other than those used by unique or primary key constraints) from USER_INDEXES
- Get any additional materialized views from USER_MVIEWS
- Get any additional objects from USER_OBJECTS (omitting Oracle-maintained stuff)
This all goes into a table with name, type, referenced_name, referenced_type. I remove the duplicates, then use a hierarchical query to put the objects in the proper order. The rest is beyond the scope of this question.
There may be additional dependencies hidden in literals, if you use dynamic SQL or SQL macros. This is one of the reasons why SQL macros are not a perfect substitute for parameterized views.
April 04, 2025 - 1:11 am UTC
Thanks for your input Stew.