I need to check if the database link exists before I create it. How can i do this?
I am writing an SQL script that starts with this:
DROP DATABASE LINK mydblink
then i create one:
CREATE DATABASE LINK mydblink
CONNECT TO testuser
IDENTIFIED BY mypswd
USING 'mypersonaldb'
Of course, I will get an error in the first step if the link to the database does not exist. And if I omit the first step and just go ahead and create a link to db, I will again get an error saying that it already exists with the same name.
What can I do to check if a database link exists?
source
share