This content has been marked as final. Show 2 replies
First, you cannot change the connection information for a database link using the ALTER DATABASE LINK statement. You'll need to drop and recreate the database link to do so. From the documentation
You cannot use this statement to change the connection or authentication user associated with the database link. To change user, you must re-create the database link.Second, are you saying that the TNS entry was specified explicitly in the CREATE DATABASE LINK statement rather than specifying a TNS alias (i.e. an entry in a tnsnames.ora file)? Normally, you'd specify a TNS alias when you create the database link in which case you could simply modify that alias rather than changing the database link.
Third, synonyms do not become unusable or invalid just because the underlying object does not exist
You'll get an error if you try to use the synonym, of course, but it won't be invalid. As long as you fix the database link before someone tries to use the synonym, there is no issue.
SQL> create synonym invalid_synonym 2 for not_a_user.not_a_table@not_a_link; Synonym created. SQL> select status from dba_objects where object_name = 'INVALID_SYNONYM'; STATUS ------- VALID