Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the difference between ORCLPDB1 and ORCLCDB?

I am trying to test the connection to a db

jdbc:oracle:thin:@//xxx:1521/ORCLPDB1 – it works to connect to the cloud db via port forwarding

jdbc:oracle:thin:@//xxx:1521/ORCLCDB – it does not work to connect to the cloud db via port forwarding

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

However I read that the ORCLCDB (SID) shoud be specified in the flyway config and spring. datasource url

Can someone explain the differences between the two and which should I us in the spring aplication properties

spring:
datasource:
url: jdbc:oracle:thin:@//xxx:1521/ORCLPDB1

flyway:
locations: classpath:/db/migration/oracle
url: jdbc:oracle:thin:@//xxx:1521/ORCLPDB1

>Solution :

The two database connection URLs you mentioned, jdbc:oracle:thin:@//xxx:1521/ORCLPDB1 and jdbc:oracle:thin:@//xxx:1521/ORCLCDB, correspond to different Oracle database instances. Let’s break down the differences and clarify their usage:

  1. jdbc:oracle:thin:@//xxx:1521/ORCLPDB1: This URL connects to an Oracle Pluggable Database (PDB) named "ORCLPDB1." In Oracle Multitenant architecture, the Container Database (CDB) can host multiple PDBs. The PDBs act as separate databases within the CDB. This URL is used when you want to connect directly to the specific PDB.

  2. jdbc:oracle:thin:@//xxx:1521/ORCLCDB: This URL connects to the Container Database (CDB) itself, rather than a specific PDB. The CDB is the main database that contains multiple PDBs. When connecting to the CDB, you have access to manage and administer all the PDBs within it. This URL is typically used when you need to perform administrative tasks or access features at the CDB level.

Now, regarding your Spring application properties and Flyway configuration, the choice of which URL to use depends on your application’s requirements:

  • If your application needs to interact with a specific PDB, such as executing SQL statements or performing data access operations within that PDB, you should use jdbc:oracle:thin:@//xxx:1521/ORCLPDB1 as the spring.datasource.url property in your Spring application properties file. Similarly, in your Flyway configuration, you should use the same URL in the url property.

  • On the other hand, if your application requires administrative access or needs to perform tasks at the CDB level, you can use jdbc:oracle:thin:@//xxx:1521/ORCLCDB as the spring.datasource.url property. However, note that this URL might require additional privileges or permissions to perform certain operations.

Remember to replace xxx with the appropriate host or IP address for your Oracle database server.

In summary, choose the URL based on whether you need to interact with a specific PDB (ORCLPDB1) or the overall CDB (ORCLCDB), and use the corresponding URL in your Spring application properties and Flyway configuration accordingly.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading