Invalid connectionstring for oracle ords docker image

Viewed 238

I'm trying to connect my oracle database to ords. They are both running in their own docker image. I can easily connect to the database from both sqlcl and datagrip, using a jdbc-url: jdbc:oracle:thin:@//localhost:1521/ORCLCDB.localdomain

As mentioned in the description for the image I have created a volume directory and added a connectionstring txt file:

CONN_STRING=dummy/<pwd>@jdbc:oracle:thin:@//localhost:1521/ORCLCDB.localdomain
                
CONN_STRING=dummy/<pwd>@localhost:1521/ORCLCDB.localdomain

I've tried several different formats but keep getting the same error message:

ERROR: Cannot connect to database please validate CONN_STRING has below shape:
          user/password@hostname:port/service_name    

ORDS image

2 Answers

Follow the documentation

CONN_STRING=user/password@host:port/service_name

So in your case

CONN_STRING=dummy/<pwd>@localhost:1521/ORCLCDB.localdomain

The CONN_STRING uses the format of a SQL-NET connection string, the same as you might have in the tnsnames.ora, or when you use direct connect.

user/password@host:port/service_name 

ORDS in docker

enter image description here

Update

I found also that the documentation states

user/password credentials require sysdba access, This user will be used to install/upgrade APEX and ORDS on you Database.

So I guess there is a contradiction between how the conn_string should be set, as the user requiring sysdba privileges. The only use who can do that is sys, thus try this

CONN_STRING=sys/sys_password@localhost:1521/ORCLCDB.localdomain as sysdba

I thought it was the password, but it turned out that the image gives the same response when the ORDS container cannot reach the database container. To solve this run

docker inspect testapex | grep IPAddress

to get the ip address of the database container in the network and then use it in the conn_string.txt file: CONN_STRING=sys/Welcome1##@123.12.0.2:1521/XEPDB1

Related