现象:
Encountering the following issue:
SQL> DROP DATABASE LINK <SCHEMA_NAME>.<DBLINK_NAME> ;
drop DATABASE LINK <SCHEMA_NAME>.<DBLINK_NAME>
*
ERROR at line 1:
ORA-02024: database link not found
原因:
Incorrect SQL syntax for dropping a public (or private) database link
In this case, the link was owned by user 'PUBLIC' not the user '<SCHEMA_NAME>'
SQL> SELECT * FROM all_db_links;
OWNER DB_LINK USERNAME
----------- ------------- -----------------
PUBLIC <DBLINK_NAME> <SCHEMA_NAME>
注意:
The same error can be encountered if the user is not the owner of a private database link
To drop a private database link, the database link must be in your own schema. It is impossible to drop a database link in another user's schema, not even with DBA privileges. Qualifying the link name with the schema name does not work. The reason is that periods are permitted in names of database links.
处理方法:
For a public database link, correct the syntax to include the word 'PUBLIC':
SQL> DROP PUBLIC DATABASE LINK <DBLINK_NAME>;
|