Search code examples
sqldatabaseoracleoracle-sqldeveloper

Problem of privileges when creating a link between schemas


I am trying to create a link between two schemas in SQL Developer and I have an error. The querie I am executing is:

CREATE DATABASE LINK dblink
CONNECT TO Matecode IDENTIFIED BY Matecode
USING 'Matecode';

Where Matecode it's the remote user, password and database Schema I want to be conected. Like this:

CREATE DATABASE LINK dblink 
CONNECT TO remote_user IDENTIFIED BY password
USING 'remote_database';

But I am receiving this error

  1. 00000 - "insufficient privileges" *Cause: An attempt was made to perform a database operation without the necessary privileges. *Action: Ask your database administrator or designated security administrator to grant you the necessary privileges

The password and the user are ok.


Solution

  • Check you have "create database link" privilege to the schema where you are creating the Database link. if the privilege is not granted use below statement as 'sysdba' user to grant the "create database link" and then try to create the database link.

    SQL: grant CREATE DATABASE LINK to username;