Steps to compile invalid public synonyms
In my environment after doing an application upgrade some of the public synonyms get invalid.
Below is the query to check invalid public synonyms or if you want to check the invalid objects in the database. Click here for sample output.
select OWNER,OBJECT_NAME,OBJECT_TYPE,STATUS from dba_objects where status='INVALID' and object_type='SYNONYM';
prompt$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$
Invalid object in database
select OWNER,OBJECT_NAME,OBJECT_TYPE,STATUS from dba_objects where status='INVALID';
prompt$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$
Below is SQL command to compile invalid public synonym.
alter public synonym AVAILABILITY compile;
prompt$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$
We always encourage the technical person to visit section SCRIPTS to get more daily usage SQL commands.
Hope so you like this script!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the most recent update. Click here to know more about our pursuit.