IntelligentWorkload Management
across Database Replicas
20 August 2015 IntelligentWorkload Management, Ritika Nevatia
2
Ritika Nevatia
Under the supervision of Prasanth Kothuri
What do we use?
Manual Load Balancing
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 3
Can we do better?
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 4
Why GDS?
Availability
Scalability
Performance
Manageability
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 5
Key features
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 6
Work Load
Management
Centralized Framework
Work Load
Routing
Region based
Replication lag based
Failover Inter database service failover
Role Based
Global Service
Takes care of role transition via Data Guard
Load Balancing Run-time
Connection
How GDS works?
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 7
Services
Representation
Grouping
Routing
to optimal instance
to handle unexpected failovers
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 8
• Implements the Oracle Database service model
• GDSCTL
• Any combination of
• Oracle Data Guard
• Oracle Golden Gate
• or any other database replication technology
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 9
How GDS works?
Caution!
Global Data Services is primarily
intended for applications that
are replication-aware.
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 10
Uses read-only global
services
Uses r/w global services BUT
resolves update conflicts if
same service is offered by
more than one DB
Can tolerate replicated data
(potentially stale) due to
replication lag
What is GDS made of?
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 11
20 August 2015
IntelligentWorkload Management, Ritika
Nevatia
12
GDS Pool
GDS Region
Global Service Manager
GDS Catalog
Oracle Notification Servers
20 August 2015
IntelligentWorkload Management, Ritika
Nevatia
13
GDS Pool
- Subset of services in same
administrative domain
- Simplifies service management
- Higher security (different admin
for each pool)
- One DB – One Pool
- DBs in the pool need not provide
same service
- All DBs providing same service
need to be in same pool
20 August 2015
IntelligentWorkload Management, Ritika
Nevatia
14
GDS Region
- Subset of services in same network
domain
- Low network latency
- Region: LAN or MAN
- One region – multiple pools
- One pool – multiple regions
- Buddy regions for GSM
20 August 2015
IntelligentWorkload Management, Ritika
Nevatia
15
Global Service Manager
GSM analogous to remote listener in Oracle
RAC
- Regional listener for connecting to global
services
- Connect time load balancing
- Manage global services across regions
- Collect performance metrics, measure
network latency
- Create run-time load balancing advisory
- Monitor availability of DB instances/global
service and notify their failure
- Each region should have atleast one GSM
- Recommended: 3 GSM per region
20 August 2015
IntelligentWorkload Management, Ritika
Nevatia
16
20 August 2015
IntelligentWorkload Management, Ritika
Nevatia
17
GDS Catalog
- Repository to store config data
- Catalog must reside in 12c DB or
above
- DB can be in/out of the GDS
configuration
- Maybe co-hosted with RMAN or
Oracle Enterprise Manager Catalogs
- Oracle RAC/Data Guard/Clusterware
should be used to enhance availability
of DB where GDS Catalog resides
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 18
Oracle Notification Servers
- Used to receive run-time load
balancing advisory and high
availability events from GSM
- Co-located with each GSM
- All ONS are interconnected
- Clients subscribe to ONS and
receive FAN notifications
The process
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 19
Give me
service!
Client GSM Instances
Most
optimal
instance
Service
Catalog
More about services
• Functionality of local service is not changed
• Oracle DB 12c provides local and global service
simultaneously
• If you are locally connected to a particular
database, then you can query data on global
services provided by that database
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 20
Use Cases
• Load Balancing for Replicated Databases
• Service Failover for Replicated Databases
• Region Affinity in Oracle GoldenGate Multi-Master
• Load Balancing in Oracle GoldenGate Multi-Master
• Balancing Oracle Active Data Guard and Oracle
GoldenGate Reader Farms
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 21
Load Balancing in Replicas
• Load metrics
• Region affinity
• Network latency
• Load balancing goals
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 22
Meriyn Budapest
Service failovers in Replicas
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 23
Meriyn Budapest Meriyn Budapest
Pre-Configuration
1. Review requirements
2. Install GSM
3. Upgrade GDS
4. Start configuration
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 24
Configuration
1. Create GDS user
sys@AISBIT:SQL> create user gds identified by "0Gds2015" default tablespace tools temporary
tablespace temp;
sys@AISBIT:SQL> alter user gds quota 10g on tools;
sys@AISBIT:SQL> grant gsmadmin_role to gds;
2. Create GDS Catalog
GDSCTL>create catalog -database AISBIT -user gds/0Gds2015
3. Grant access to gsmcatuser
sys@AISBIP:SQL> alter user gsmcatuser account unlock;
sys@AISBIP:SQL> ALTER USER gsmcatuser IDENTIFIED BY gsm_2015;
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 25
Configuration
4. Create GSM
GDSCTL>add gsm -gsm mgsm -listener 10121 -catalog AISBIT
5. SetTime zone for DB
6. Connect to GDS
GDSCTL>connect gds@itrac50018-v:10121:aisbip1
7. Create Pool
GDSCTL> add gdspool -dbpool hr -users gds
8. Create Region
GDSCTL> add region –region west,east
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 26
Configuration
8. Create Databases
GDSCTL>add database -connect ERTS_RAC4 -region REGIONORA -gdspool DBPOOLORA
GDSCTL>add database -connect ERTS_RAC5 -region REGIONORA -gdspool DBPOOLORA
9. Create Service
GDSCTL>add service -gdspool DBPOOLORA -service erts_rw -clbgoal LONG -commit_outcome TRUE
-preferred ERTS_RAC4 -available ERTS_RAC5 -commit_outcome TRUE -notification
TRUE -policy automatic -failoverdelay 10 -failoverretry 6 -session_state DYNAMIC
–failovertype TRANSACTION
10. Start Service
GDSCTL>start service –service erts_rw
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 27
Instance Modification
GDSCTL>modify service -service erts_rw -database
erts_rac4 -modify_instances -preferred ERTS -
gdspool erts
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 28
Global Services Attributes
Failover
failoverdelay failover_delay
failovermethod {NONE |
BASIC}
failoverretry failover_retries
failovertype {NONE |
SESSION | SELECT |
TRANSACTION}
Preferred or
available
databases
available db_list
preferred dbname_list
preferred_all
Region affinity
locality {ANYWHERE |
LOCAL_ONLY}
lag {lag_value | ANY}
region_failover
Goal and Roles
clbgoal {SHORT | LONG}
rlbgoal {SERVICE_TIME |
THROUGHPUT}
role {[PRIMARY] |
[PHYSICAL_STANDBY] [-
failover_primary]
|[LOGICAL_STANDBY]
|[SNAPSHOT_STANDBY]}
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 29
Limitations
Oracle 12C
Limited Documentation
Limited Usage
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 30
20 August 2015 IntelligentWorkload Management, Ritika Nevatia 31
ThankYou
Ritika Nevatia
nevatiaritika@gmail.com
@beingritika

Intelligent_Workload_Management

  • 2.
    IntelligentWorkload Management across DatabaseReplicas 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 2 Ritika Nevatia Under the supervision of Prasanth Kothuri
  • 3.
    What do weuse? Manual Load Balancing 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 3
  • 4.
    Can we dobetter? 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 4
  • 5.
    Why GDS? Availability Scalability Performance Manageability 20 August2015 IntelligentWorkload Management, Ritika Nevatia 5
  • 6.
    Key features 20 August2015 IntelligentWorkload Management, Ritika Nevatia 6 Work Load Management Centralized Framework Work Load Routing Region based Replication lag based Failover Inter database service failover Role Based Global Service Takes care of role transition via Data Guard Load Balancing Run-time Connection
  • 7.
    How GDS works? 20August 2015 IntelligentWorkload Management, Ritika Nevatia 7
  • 8.
    Services Representation Grouping Routing to optimal instance tohandle unexpected failovers 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 8
  • 9.
    • Implements theOracle Database service model • GDSCTL • Any combination of • Oracle Data Guard • Oracle Golden Gate • or any other database replication technology 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 9 How GDS works?
  • 10.
    Caution! Global Data Servicesis primarily intended for applications that are replication-aware. 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 10 Uses read-only global services Uses r/w global services BUT resolves update conflicts if same service is offered by more than one DB Can tolerate replicated data (potentially stale) due to replication lag
  • 11.
    What is GDSmade of? 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 11
  • 12.
    20 August 2015 IntelligentWorkloadManagement, Ritika Nevatia 12 GDS Pool GDS Region Global Service Manager GDS Catalog Oracle Notification Servers
  • 13.
    20 August 2015 IntelligentWorkloadManagement, Ritika Nevatia 13 GDS Pool - Subset of services in same administrative domain - Simplifies service management - Higher security (different admin for each pool) - One DB – One Pool - DBs in the pool need not provide same service - All DBs providing same service need to be in same pool
  • 14.
    20 August 2015 IntelligentWorkloadManagement, Ritika Nevatia 14 GDS Region - Subset of services in same network domain - Low network latency - Region: LAN or MAN - One region – multiple pools - One pool – multiple regions - Buddy regions for GSM
  • 15.
    20 August 2015 IntelligentWorkloadManagement, Ritika Nevatia 15 Global Service Manager GSM analogous to remote listener in Oracle RAC - Regional listener for connecting to global services - Connect time load balancing - Manage global services across regions - Collect performance metrics, measure network latency - Create run-time load balancing advisory - Monitor availability of DB instances/global service and notify their failure - Each region should have atleast one GSM - Recommended: 3 GSM per region
  • 16.
    20 August 2015 IntelligentWorkloadManagement, Ritika Nevatia 16
  • 17.
    20 August 2015 IntelligentWorkloadManagement, Ritika Nevatia 17 GDS Catalog - Repository to store config data - Catalog must reside in 12c DB or above - DB can be in/out of the GDS configuration - Maybe co-hosted with RMAN or Oracle Enterprise Manager Catalogs - Oracle RAC/Data Guard/Clusterware should be used to enhance availability of DB where GDS Catalog resides
  • 18.
    20 August 2015IntelligentWorkload Management, Ritika Nevatia 18 Oracle Notification Servers - Used to receive run-time load balancing advisory and high availability events from GSM - Co-located with each GSM - All ONS are interconnected - Clients subscribe to ONS and receive FAN notifications
  • 19.
    The process 20 August2015 IntelligentWorkload Management, Ritika Nevatia 19 Give me service! Client GSM Instances Most optimal instance Service Catalog
  • 20.
    More about services •Functionality of local service is not changed • Oracle DB 12c provides local and global service simultaneously • If you are locally connected to a particular database, then you can query data on global services provided by that database 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 20
  • 21.
    Use Cases • LoadBalancing for Replicated Databases • Service Failover for Replicated Databases • Region Affinity in Oracle GoldenGate Multi-Master • Load Balancing in Oracle GoldenGate Multi-Master • Balancing Oracle Active Data Guard and Oracle GoldenGate Reader Farms 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 21
  • 22.
    Load Balancing inReplicas • Load metrics • Region affinity • Network latency • Load balancing goals 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 22 Meriyn Budapest
  • 23.
    Service failovers inReplicas 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 23 Meriyn Budapest Meriyn Budapest
  • 24.
    Pre-Configuration 1. Review requirements 2.Install GSM 3. Upgrade GDS 4. Start configuration 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 24
  • 25.
    Configuration 1. Create GDSuser sys@AISBIT:SQL> create user gds identified by "0Gds2015" default tablespace tools temporary tablespace temp; sys@AISBIT:SQL> alter user gds quota 10g on tools; sys@AISBIT:SQL> grant gsmadmin_role to gds; 2. Create GDS Catalog GDSCTL>create catalog -database AISBIT -user gds/0Gds2015 3. Grant access to gsmcatuser sys@AISBIP:SQL> alter user gsmcatuser account unlock; sys@AISBIP:SQL> ALTER USER gsmcatuser IDENTIFIED BY gsm_2015; 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 25
  • 26.
    Configuration 4. Create GSM GDSCTL>addgsm -gsm mgsm -listener 10121 -catalog AISBIT 5. SetTime zone for DB 6. Connect to GDS GDSCTL>connect gds@itrac50018-v:10121:aisbip1 7. Create Pool GDSCTL> add gdspool -dbpool hr -users gds 8. Create Region GDSCTL> add region –region west,east 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 26
  • 27.
    Configuration 8. Create Databases GDSCTL>adddatabase -connect ERTS_RAC4 -region REGIONORA -gdspool DBPOOLORA GDSCTL>add database -connect ERTS_RAC5 -region REGIONORA -gdspool DBPOOLORA 9. Create Service GDSCTL>add service -gdspool DBPOOLORA -service erts_rw -clbgoal LONG -commit_outcome TRUE -preferred ERTS_RAC4 -available ERTS_RAC5 -commit_outcome TRUE -notification TRUE -policy automatic -failoverdelay 10 -failoverretry 6 -session_state DYNAMIC –failovertype TRANSACTION 10. Start Service GDSCTL>start service –service erts_rw 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 27
  • 28.
    Instance Modification GDSCTL>modify service-service erts_rw -database erts_rac4 -modify_instances -preferred ERTS - gdspool erts 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 28
  • 29.
    Global Services Attributes Failover failoverdelayfailover_delay failovermethod {NONE | BASIC} failoverretry failover_retries failovertype {NONE | SESSION | SELECT | TRANSACTION} Preferred or available databases available db_list preferred dbname_list preferred_all Region affinity locality {ANYWHERE | LOCAL_ONLY} lag {lag_value | ANY} region_failover Goal and Roles clbgoal {SHORT | LONG} rlbgoal {SERVICE_TIME | THROUGHPUT} role {[PRIMARY] | [PHYSICAL_STANDBY] [- failover_primary] |[LOGICAL_STANDBY] |[SNAPSHOT_STANDBY]} 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 29
  • 30.
    Limitations Oracle 12C Limited Documentation LimitedUsage 20 August 2015 IntelligentWorkload Management, Ritika Nevatia 30
  • 31.
    20 August 2015IntelligentWorkload Management, Ritika Nevatia 31 ThankYou Ritika Nevatia nevatiaritika@gmail.com @beingritika