Not enough privileges to create a database link
979263Dec 11 2012 — edited Dec 13 2012Hi,
I have a problem to create a database link with "CREATE DATABASE LINK" (the terms in <> are replaced by appropriate values for my environment):
CREATE PUBLIC DATABASE LINK <nameForLink>
CONNECT TO <user>
IDENTIFIED BY <userName>
USING '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <URLofHost>)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = <serviceName>)
)
)';
It works perfectly well when I run the corresponding command with the user "system". However, if I use a different user I get the following error:
Error en la línea de comandos:1 Columna:29
Informe de error:
Error SQL: ORA-01031: insufficient privileges
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to change the current username or password
without the appropriate privilege. This error also occurs if
attempting to install a database without the necessary operating
system privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
if the user was granted the necessary privilege at a higher label
than the current login.
*Action: Ask the database administrator to perform the operation or grant
the required privileges.
For Trusted Oracle users getting this error although granted the
the appropriate privilege at a higher label, ask the database
administrator to regrant the privilege at the appropriate label.
I can solve the problem by granting the role DBA to that user (then it works). However, I would like to avoid that. Is this possible? In the documentation I only found that the "CREATE DATABASE LINK" privilege was required and I already granted that privilege, but it seems that it is not enough... Why does the user also need the DBA role to create the database link? Is there any alternative?
Thaks for any tip!!