0

I wanted to execute 'lb generate-schema -split' after installing liquibase and sqlcli but when I hit the above command it doesn't connect to pluggable database (xepdb1). It always tried to connect to 'xe' or 'orcl' service names. Can anybody help me to solve the issue?

D:\Software\sqlcl-latest\sqlcl\bin>sql


SQLcl: Release 23.1 Production on Sat Apr 29 12:27:03 2023

Copyright (c) 1982, 2023, Oracle.  All rights reserved.

Username? (''?) apexuser@**xepdb1**

Password? (**********?) **********

Last Successful login time: Sat Apr 29 2023 12:27:17 +09:30

Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL> lb generate-schema -split
--Starting Liquibase at 12:27:24 (version 4.17.0 #0 built at 2022-11-02 21:48+0000)

  USER          = apexuser
  URL           = jdbc:oracle:oci8:@
  Error Message = ORA-12560: TNS:protocol adapter error
  USER          = apexuser
  URL           = jdbc:oracle:thin:@localhost:1521/orcl
  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=zW40jSIGS5KejZYrbKvK/A==)
  USER          = apexuser
  URL           = jdbc:oracle:thin:@localhost:1521/xe
  Error Message = ORA-01017: invalid username/password; logon denied
chk.buddi
  • 554
  • 1
  • 8
  • 29

1 Answers1

1

it doesn't connect to pluggable database (xepdb1). It always tried to connect to 'xe' or 'orcl' service names

As it says, what used to be true, isn't true any more. It depends on how you named the database (or left to Oracle to decide), and in newer XE databases it is xepdb1.

This is my XE database (I know its name; I'm just displaying what's in my TNSNAMES.ORA):

c:\temp>tnsping pdb1

TNS Ping Utility for 64-bit Windows: Version 21.0.0.0.0 - Production on 29-APR-2023 06:27:14

Copyright (c) 1997, 2021, Oracle.  All rights reserved.

Used parameter files:
C:\Users\littlefoot\Documents\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = lf_laptop)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))
OK (60 msec)

See the SERVICE_NAME at the very end of the previous line?

c:\temp>sqlplus scott/tiger@lf_laptop:1521/xepdb1

SQL*Plus: Release 21.0.0.0.0 - Production on Sat Apr 29 06:27:52 2023
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.

Last Successful login time: Fri Apr 14 2023 21:02:45 +02:00

Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL>

Therefore, try the same with Liquibase; I don't use it so I can't assist with it, but I presume that this should be modified:

URL           = jdbc:oracle:thin:@localhost:1521/xepdb1
                                                 ------
                                                 this
Littlefoot
  • 131,892
  • 15
  • 35
  • 57