2

I have read couple of articles on google but not sure how DB client for example java application connect to clustered DB. All the articles I read says client will write at master node but will use slave for read.

My question is how client will know which one is master(and its location) and which one is slave(and its location). Does Oracle uses any router server(sitting separately on existing or different node) and java client will connect to this router and it is the responsibility of router to send the calls to master or slave based on request type (DDL or DML) ?

user3198603
  • 1,896
  • 2
  • 16
  • 21

1 Answers1

1

Let us understand one-by-one:

  1. Configuration: First and the foremost is configuring and letting Oracle know where the Master and Slave is. The complexity shall increase if you need to replicate the entire database objects. However, the configuring the Master and the Slave is the first step. This configuration is done using TNSNames.ora file.

This means, any Client that would want to connect to an Oracle instance would need the settings configured in the configuration file(s) 'TNSNames.ora' and listener.ora. This rule is applicable for any Client API that intends to establish connection with the Oracle instance such as (JDBC, Pro*C, etc).

  1. Database Links: Creating database links is the next step to configure the physical tables. This will be the second-step in establishing the link between the configuration file and the physical database.

Based on the driver you use (Thin / OCI), the System Identifier (SID) will establish the connection to the master or to the slave. The host-string will let the JDBC know where to connect, etc.

BTW, the replication concept is deprecated from 12c and it is recommended to use GoldenGate.

Hope this helps you.

Devasuran
  • 146
  • 2