I have 2 packages and 2 public synonyms for those packages. There are dependencies between those packages. If I make changes to any of those packages and compile them then packages are compiled (specs and bodies) and valid but both synonyms are invalid. I know I can recompile synonyms but how to avoid this please? Is there a way to keep all objects compiled?
Thank you.
Oracle 11g R2 – Why Public Synonyms Become Invalid
oracleoracle-11g-r2
Related Question
- How to differentiate between user-defined public synonyms and built-in public synonyms
- Oracle Synonym – Point to Object in Another Schema
- Oracle – How to List SYNONYMS That No Longer Point to a Valid Object
- Oracle 10.0 package shows INVALID status in reference on oracle 11g on import with IMPDP
- Re-import packages in Oracle
- Oracle – Export Data Pump Skipped Package Bodies
- Oracle Schema Audit – PUBLIC Privilege Potential Security Threat
- Materialized view became INVALID and USER_MVIEWS.COMPILE_STATE becomes ‘NEEDS_COMPILE’
Best Answer
If you are modifying any object in Oracle where a synonym is linked, there is no alternative, you should recreate the synonyms.
I found that because in my application I have sometime the need to recreate custom views (e.g. for attribute length) , and each time i need to recreate synonyms.
Even adding a rows in a table lead the synonym to be invalid.