Monday 4 June 2018

ORA-01031: insufficient privileges while creating database link


This document describes about "ORA-01031" issue when create private database link.


Issue: Getting below error while creating private database link.

SQL> conn adam/welcome
Connected.

SQL> show user
USER is "ADAM"

SQL> create database link gold_to_silver connect to chris identified by welcome using 'SILVER';
create database link gold_to_silver connect to chris identified by welcome using 'SILVER'
                     *
ERROR at line 1:
ORA-01031: insufficient privileges


Cause and Solution:

User ADAM does not have "CREATE DATABASE LINK" privilege to create private database link.

Connect to database as sys and grant "CREATE DATABASE LINK" to user ADAM.

SQL> conn sys as sysdba
Enter password: 
Connected.

SQL> show user
USER is "SYS"

SQL> grant create database link to adam;

Grant succeeded.


Validation:

SQL> conn adam/welcome
Connected.

SQL> show user
USER is "ADAM"

SQL> create database link gold_to_silver connect to chris identified by welcome using 'SILVER';

Database link created.

SQL> 



Thanks for your patience to view this post............

No comments:

Post a Comment