You are on page 1of 3

RAC Services

-----------

listener - listens and hand off the req to server

conn - est - process ->DBServer - Standalone - one listener -


stop/start - maintenance

rac - HA/Scala -

configuration -
balance the load
failover ?

Preferred node - rac1,rac2


Available node - rac3 (if r1/r2 fail)
least loaded node - route conn - by SCAN IP

Load means - connections on a node

Using services

4 node rac
rac1 prod1
rac2 prod2
rac3 prod3
rac4 prod4

database - prod

schemas - 3 schemas - ptm/pmal/pbnk but db is one with 4 node

how we are dist - the load


application connect?
failover configur?

preferred node
availabl node

service acts as seperate entity - for an application - stop/start/add/delete

local listenr and remote listener(scan listener)

SCAN will the route the connection in round robin method based on load on the
server
eg: onrac1 - the load - pmon says
then it routes another preferred node

eg:

ptm - schema - configured with service - with preferred node rac1,rac4


and availabile node as rac3

the connections will be established on rac1 either rac4 depends on load


said by pmon on each instance
load identified by gv$session based on service_name count(*)
connection count

pmal - schema - via service confi - config pref - rac2,rac3 and avail
node as rac1

using srvctl will configure - add/stop/start

ptms - rac1,rac4
pbk - rac3,rac1

rac1 load then relocate the connecctions - move

Using srvctl command - will configure services - upto 115 limit we can create

$srvctl add service -d prod -s ptms -r prod1 -a prod2

Preferred node rac1 (-r)


Available node - rac2 - (-a)
srvctl add service -d prod -s hrs -r prod2 -a prod1

Now status find?

$srvctl status service -d prod

$srvctl start service -d prod -s hrs


srvctl start service -d prod -s ptms

To find load from gv$session view - count(*)

sql>select inst_id,service_name,count(*) from gv$session group by


inst_id,service_name;

First we need to configure using service for pre/ava

service is server side

Client side - tnsnames.ora - we are configuring for load bal and failover

Load Balancing

=on tnsnames.ora

Pref r1,r2
r1 - load
then connect - r2

by scan ip will route to r2 if load on r1

for that we need to enable in tnsnames.ora


Failover

ptms - r1 failr r2 - by scan will route as configured by service and enabled


in tnsnames.ora

Server Side Client Side


using service(p/a) using tnsnames.ora enabled.
listener to listen

How to configure load balacning and failover ?


Server side using service will configure preferred a nd avaiable node and client
side will configure load balance and failover = on in tnsnames.ora file.
we need to start the service and scan ip will route the connections to least loaded
node and does failover if preferred node fails

Will create service using srvctl command

You might also like