Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

oracle apex create database link, find related user and grant privs

User_47J4WOct 21 2021

Hi .
I'm new to Oracle Database and Apex .
When i try create database link from workspace in Apex, it says "ORA-01031: insufficient privileges" . i ssh to server and connect to database as Oracle user and by "sqlplus / as sysdba" command , as sysdba i can create link and can query , every thing works fine .
After some googling and spend times looking questions asked by others, i realized that i need to run "GRANT CREATE DATABASE LINK TO my_schema_name_in_apex' .
To find correct user/role i run bellow queries from withing Apex SQL Commands section :
SELECT sys_context('USERENV', 'CURRENT_USER') FROM DUAL;
SELECT sys_context('USERENV', 'SESSION_USER') FROM DUAL;
SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM DUAL
SELECT sys_context('USERENV', 'AUTHENTICATED_IDENTITY') FROM DUAL
Then run "GRANT CREATE DATABASE LINK" for all of them by sys in server and getting error ORA-01917: user or role 'CURRENT_USER/SESSION_USER/CURRENT_SCHEMA/AUTHENTICATED_IDENTITY' does not exist !

I run "SELECT USERNAME FROM ALL_USERS" as sysdba but there is no any users i gathered from above sys_context queries !

Comments
Post Details
Added on Oct 21 2021
2 comments
973 views