Upload
ledang
View
269
Download
8
Embed Size (px)
Citation preview
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 1
Martin HoermannSenior Consultant, ORDIX AG, Mü[email protected]
Deutsche OracleAnwenderkonferenz 2006
Oracle RACServices
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 2
Agenda
• Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 3
RAC DB-Services
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 4
RAC DB-Services
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 5
Agenda
• Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 6
Services - Single Instance
tomahawk = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = srv01)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = winnetou) ))
tnsnames.ora
listener.ora
sqlplus scott/tiger@tomahawk
lsnrctl> services
Dienst "winnetou" hat 1 Instance(s). Instance "APACHE", hat 1 Handler für diesen Dienst...
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 7
Services - Single Instance
service_names = winnetouinstance_name = APACHE
listener.ora
lsnrctl> services
Dienst "winnetou" hat 1 Instance(s). Instance "APACHE", hat 1 Handler für diesen Dienst...
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 8
pmon & service_names
pmon
service_names = winnetou, APACHE.the.west Default = db_unique_name.db_domain
db_unique_name = APACHE Default = db_name
db_name = APACHE
db_domain = the.west
initAPACHE.ora
lsnrctl> services
sys
ALTER SYSTEM REGISTER;
Default: nach 300 Sekunden
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 9
pmon & service_names
pmon
LOCAL_LISTENER = shatterhand Default =(ADDRESS=(PROTOCOL=TCP)(HOST=srv01)(PORT=1521))
shatterhand = (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=srv01)(PORT=1521)) )
tnsnames.ora
initAPACHE.ora
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 10
pmon & service_names
pmon
lsnrctl> services
Load Profile
Instance Load
Load Profile
LOAD - # Verbindungen für den Service.
MAXLOAD - max # Verbindungen für den Service.
INSTANCE_LOAD - aktuelle Last des Knotens.
INSTANCE_MAXLOAD - maximale Last des Knotens.
Note:75712.1Note:75712.1
Solaris Instance Load: kstat()
für Connection Load Balancing
für Node Load Balancing
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 11
Agenda
• Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 12
Service Konfiguration
Cluster Ready Service
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 13
Cluster Ready Services
APACHE1APACHE1APACHE2APACHE2
APACHE
Cluster Ready Service
set service_names set service_names
pmonpmon
Cluster Registry
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 14
Remote Listener
APACHE1APACHE1APACHE2APACHE2
pmonpmon
initAPACHE1.ora
REMOTE_LISTENER = LISTENERS_APACHE
LISTENERS_APACHE =(ADDRESS_LIST = (ADDRESS = (PROTOCOL...)(HOST = vip_srv01)(PORT...)) (ADDRESS = (PROTOCOL...)(HOST = vip_srv02)(PORT...)))
tnsnames.ora
Load Profile
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 15
Services
lsnrctl> services
Dienst "batch_jobs" hat 1 Instance(s). Instance "rac02", Status READY, hat 1 Handler für diesen Dienst...Dienst "batch_jobs_nur_rac2" hat 1 Instance(s). Instance "rac02", Status READY, hat 1 Handler für diesen Dienst...Dienst "winnetou" hat 2 Instance(s). Instance "rac01", Status READY, hat 2 Handler für diesen Dienst... Instance "rac02", Status READY, hat 1 Handler für diesen Dienst...
• Services auf rac01 (nicht rac02)• Der Listener kennt auch die Services welche seine zugehörige
Instanz momentan nicht bedient.• Warum wird später erläutert!
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 16
Agenda
• Services
- Single Instace Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 17
Client Side Connect Time Failover
tomahawk = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = vip-srv01)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = vip-srv02)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVICE_NAME = winnetou) ) )
tnsnames.ora
53 % 47 %
sqlplus scott/tiger@tomahawk
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 18
Agenda
• Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 19
Server Side Load Balancing
pmon
CPU Load High CPU Load Low
pmon
1122
11
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 20
Services
lsnrctl> services
Dienst "batch_jobs" hat 1 Instance(s). Instance "rac02", Status READY, hat 1 Handler für diesen Dienst...Dienst "batch_jobs_nur_rac2" hat 1 Instance(s). ...
• Services auf rac01 (nicht rac02)• Die Information über Services auf anderen Instanzen ist wichtig für
den Redirect einer Client-Anfrage• Das Load-Profile ist wichtig für die Last-Verteilung
CPU Load High CPU Load Low
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 21
Server Side Load Balancing
connect
pmon
CPU Load High CPU Load Low
pmon
1122
11
33
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 22
Server Side Load Balancing
re-direct
pmon
CPU Load High CPU Load Low
pmon
1122
11
44
LISTENERS_APACHE =(ADDRESS_LIST = (ADDRESS = (PROTOCOL...)(HOST = vip_srv01)(PORT...)) (ADDRESS = (PROTOCOL...)(HOST = vip_srv02)(PORT...)))
tnsnames.ora
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 23
Server Side Load Balancing
re-direct
pmon
CPU Load High CPU Load Low
pmon
1122
11
44connect33connect(redirected)
55
Achtung: der Client muss jetzt den Serveramen aus dem Parameter remote_listeners auflösen!
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 24
Server Side Load Balancing
connect redirect connect(redirected)
pmon
CPU Load High CPU Load Low
pmon
1122
11
3344
55
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 25
Agenda
• Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 26
Server Side Load Balancing
• Server Side Load Balancing abhängig von zwei Parametern:
• Goal- <NULL>: Default durch dbca, aber nicht dokumentiert- None: Kein Load Balancing Advisor- Service Time: Advisor berechnet Entscheidung aus Elapsed
Time des Service + Bandbreite- Throughput: Advisor berechnet Entscheidung aus Rate mit der
die Arbeit erledigt wird + Bandbreite
• Connection Load Balancing (clb) Goal- Short: CPU basiert- Long: Connection Count
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 27
Server Side Load Balancing
Connection Load Balancing Goal
GOAL Short Long<NULL> x xNone x x Service Time x xThroughput x x
dbms_service.modify_service( service_name => 'winnetou' - , goal => dbms_service.goal_throughput - , clb_goal => dbms_service.clb_goal_long - );
• dba_services / all_services- goal = { none, service_time, throughput }- clb_goal = { long, short }
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 28
Testreihen
• Instanz A: keine Last• Instanz B: 100% CPU Last über Service• mit jedem Schritt werden 8 Verbindungen aufgebaut
clb_goal = long
goal = service_time A) 4 8 12 16B) 4 8 12 16
A) 3 8 12 20 28B) 5 8 12 12 12
A) 4 12 20 36B) 4 4 4 4
goal = throughput
clb_goal = short
A) 4 8 12 16B) 4 8 12 16
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 29
Agenda
• Services- Single Instance Datenbank- Real Application Cluster
• Client - Connect Time Failover• Server Side Load Balancing
- Ablauf- Entscheidungsgrundlage
• Services und Cluster Failover• srvctl - Das RAC Werkzeug• AWR, Statspack und Data Dictionary• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 30
Service Konfiguration
Cluster Ready Service
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 31
oracle> crs_stat
NAME TYPE TARGET STATE HOST ora.rac0.rac_b1_b2.cs application ONLINE ONLINE suse200ora.rac0.rac_b1_b2.rac01.srv application ONLINE ONLINE suse200ora.rac0.rac_b1_b2.rac02.srv application ONLINE ONLINE suse220
Service Konfiguration
oracle> crs_stat
NAME TYPE TARGET STATE HOST ora.rac0.rac_b1_b2.cs application ONLINE ONLINE suse200ora.rac0.rac_b1_b2.rac01.srv application ONLINE ONLINE suse200ora.rac0.rac_b1_b2.rac02.srv application ONLINE OFFLINE suse220
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 32
oracle> crs_stat
NAME TYPE TARGET STATE HOST ora.rac0.rac_b1_v2.cs application ONLINE ONLINE suse200ora.rac0.rac_b1_v2.rac01.srv application ONLINE ONLINE suse200
Service Konfiguration
oracle> crs_stat
NAME TYPE TARGET STATE HOST ora.rac0.rac_b1_v2.cs application ONLINE ONLINE suse200ora.rac0.rac_b1_v2.rac01.srv application ONLINE ONLINE suse220
Ein automatische "Fall Back" findet nicht statt!
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 33
metalink.oracle.com
Configuration of Load Balancing and Transparent Application Failover
Note:226880.1
Configuration of Load Balancing and Transparent Application Failover
Note:226880.1
testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen ten testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen testen tes
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 34
Agenda
• Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 35
srvctl
Hinzufügen eines Servicesrvctl add service -d <db_unique_name> -s <service_name> -r <preferred_list> [-a <available_list>] [-P <TAF_policy>]
Starten und Stoppen von Servicessrvctl start service -d <name [-s <service_name_list>] [-i <inst_name>] [-o <start_options>] [-c <connect_str> | -q]
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 36
srvctl
Aktivierung und Deaktivierung von Servicessrvctl enable|disable service -d <db_name -s <service_name1,service_name2,...> [-i <inst_name1,inst_name2,...>]
Relocating von Servicessrvctl relocate service -d rac0 -s winnetou -i rac01 -t rac02
Status eines Servicessrvctl status service -d rac0 -s winnetou [-f] [-v]
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 37
Agenda
• Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 38
AWR Informationen
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 39
Data Dictionary
• dba_services / all_services- goal = { none, service_time, throughput }- clb_goal = { long, short }
• v$services, v$active_services
• v$service_events, v$service_stats- Wait Events und Statistiken je Service
• v$service_wait_class, v$service_metric ...- Klassifizierung von Wait Events und Statistiken (10g)
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 40
Agenda
• RAC DB-Services
- Single Instance Datenbank
- Real Application Cluster
• Client - Connect Time Failover
• Server Side Load Balancing
- Ablauf
- Entscheidungsgrundlage
• Services und Cluster Failover
• srvctl - Das RAC Werkzeug
• AWR, Statspack und Data Dictionary
• Sonstiges & Fazit
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 41
Dokumentation
• Oracle Clusterware and RAC Administration and Deployment Guide- Kapitel 6 Introduction to Workload Management- Kapitel 14 Making Applications Highly Available ...- Anhang E Server Control Utility Reference
• Net Services Administrator's Guide- Kapitel 10 Configuring and Administering the Listener- Kapitel 13 Enabling Advanced Features of Oracle Net Services
• PL/SQL Packages and Types Reference- Kapitel 95 DBMS_SERVICE
• Reference (Diverse dba, v$ Views)
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 42
Interessante Notes
• Issues affecting Automatic Service RegistrationNote:235562.1
• Connection and Node Load Balancing with MTS (Shared Server)Note:75712.1
• Configuration of Load Balancing and Transparent Application FailoverNote:226880.1
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 43
Fazit
• Ein RAC System- mit Services- mit Client Side Load-Balancing- mit Server Side Load-Balancing- mit Transparent Application Failover
• ist mit den Assistenten einfach zu konfigurieren- aber aufwendig zu testen- und sehr sehr sehr komplex!
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 44
Fazit
... und jetzt stellen wir uns das ganze auf einem 4 Knoten Cluster vor!
Copyright ORDIX AG Oracle Real Application Cluster (RAC) 45
Auf Wiedersehen
Danke für die Aufmerksamkeit,mögen sich unsere Wege wieder kreuzen ...
... vielleicht auf der Konferenz an unserem Stand C11 gegenüber von