Search code examples
oracledocker

Connection string after docker running Oracle


I am following this tutorial here and I have my docker image running. It was created with

docker run -d --name test19c -e ORACLE_PASSWORD=Oracle_2023 -e APP_USER=scott -e APP_USER_PASSWORD=tiger -p 1521:1521 oracle/database:19.3.0-ee

enter image description here

Then I am trying to run SQL with conn sys/[email protected]:1521/freepdb1 as sysdba but I have the error:

    USER          = sys
  URL           = jdbc:oracle:thin:@host.docker.internal:1521/freepdb1
  Error Message = Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
  (CONNECTION_ID=Nr9QtX6+TwSCCctpRkROvg==)

enter image description here

I really don't know what to do here to connect. I also tried to connect with SQL developer, but I can't manage


Solution

  • See in that screen shot you have:

    "Pluggable database ORCLPDB1 is opened read/write".

    That is your database, and most likely your service name.

    So try a connection of:

    jdbc:oracle:thin:@host.docker.internal:1521/ORCLPDB1