Problem dropping a database link (it's in use)
979263Dec 13 2012 — edited Jan 8 2013Hi,
I know that this error has been reported in older threads, but I was not able to find the explanation/solution in my context. When I try to drop a database link that I have created (with "DROP DATABASE LINK..."), I get the error "Error SQL: ORA-02018: database link of same name has an open connection". Trying to close the connection with "exec DBMS_SESSION.CLOSE_DATABASE_LINK('database-link-name')" reports the error "ORA-02080: database link is in use", so it doesn't really solve the problem.
The strange thing is that if I execute "SELECT * FROM V$DBLINK" and then I try to drop it again, then dropping the database link works (??). As far as I know, no cursor should be in use for the database link...
Of course, the error with drop only occurs if have used the link (e.g., with a "SELECT * from table-name@database-link-name"), not if for example I create it and then drop it immediately.
Thanks for any idea.