Skip to Main Content
  • Questions
  • APEX App connect to different Databases based on User

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Thi Huong Giang.

Asked: January 14, 2025 - 12:39 pm UTC

Last updated: January 22, 2025 - 2:04 am UTC

Version: 5

Viewed 100+ times

You Asked

Hi ASKTOM team,
I'm a beginner of APEX.
In our system we have many differents DBs (different hosts) but they have same table structures.
If user A choose in a DB-list DB1 and logged in, APEX server will connect to DB1 and uses all data from DB1
If user B choose DB2, APEX will do the same actions but use all data from DB2.
...
Which Services/Methods APEX should we use in this situation?( in just one Application as well as 1 Page).
It seems like we need a dynamic dblink :
Select * from DUAL@db_link;
If user A then db_link := DB1;
If user B then db_link := DB2;



Many thanks!
Best regards,
Giang Doan



and Connor said...

Based on that, I would have thought it might be more prudent to use ORDS to control the access. You can have a single ORDS instance allow access to multiple databases, eg

https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/24.4/ordig/configuring-additional-databases.html

(That would involve APEX being installed on each database).