docker run --rm -v I:\Projects\Liquibase:/liquibase/changelog liquibase/liquibase --defaultsFile=/liquibase/changelog/configs/liquibase.properties status
I’m trying to connect with the local Oracle database and I’m getting the following error:
Connection could not be created to jdbc:oracle:thin:@localhost:1521:xe with driver oracle.jdbc.OracleDriver. IO Error: The Network Adapter could not establish the connection
liquibase.properties file:
url: jdbc:oracle:thin:@localhost:1521:xe
username: men
password: 1
But connecting via SQL*Plus or SQL Developer is successful.
>sqlplus men/1@localhost:1521/xe
...
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
SQL>
>tnsping localhost:1521/xe
...
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=xe))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
OK (0 msec)
Try to check the listener is up or down.
I think that you have issue establishing DB connection through network.
Install SQL developper to check if your DB is accessed remotely or not.
If you’re running it in docker, it’ll try to use the internal container loop back address and will fail connecting to the host. You’ll need to specify an external IP address.
Also, for Oracle 11g, I had to upgrate the time zone file, because I got the error:
Starting Liquibase at 16:31:20 (version 4.3.5 #62 built at 2021-04-29 18:31+0000)
Unexpected error running Liquibase: liquibase.exception.DatabaseException:
liquibase.exception.DatabaseException: Connection could not be created
to jdbc:oracle:thin:@192.168.176.1:1521:xe with driver oracle.jdbc.OracleDriver.
ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
I took the time zone file timezlrg_31.dat and timezone_31.dat from oracle-database-xe-18c-1.0-1.x86_64 image and put it in $ORACLE_HOME/oracore/zoneinfo.