Markus Michalewicz
Transcription
Markus Michalewicz
7$)64/1HW.RQILJXUDWLRQ QLFKWQXUIíU5$& Markus Michalewicz BU Database Technologies Oracle Deutschland GmbH Page 1 2UDFOH1HWIRU5$& TAF, Load Balancing and More :KDW%HQLILWV'RHV 7$)3URYLGH" y In the case of an Oracle instance failure, TAF automatically transfers client connections to a surviving instance. y Clients already connected do not need to reconnect if a secondary instance is available and TAF has been pre-configured. y It provides high availability to an end client, and end clients do not see any errors or outages. y TAF works with MTS or dedicated sessions. Page 2 7$)FDQEHXVHGZLWK y TAF is designed for OPS/RAC y Can be implemented in RAC Guard (HA server, OPFS, PFS) y Replicated Databases y Data Guard y Fail Safe Clusters (NT, W2K) y Single Instance Environments 2UDFOH7UDQVSDUHQW$SSOLFDWLRQ)DLORYHU7$) %HQXW]HUZHUGHQDXWRPDWLVFK •DXIHLQHPLQWDNWHQ.QRWHQ %HLGH.QRWHQDNWLY •ü=XJULIIDXIHLQH'DWHQEDQN EHUQRPPHQXQGOHVHQGH =XJULIIHIRUWJHVHW]W Aktiver Aktiver 2UDFOHL '% 2UDFOHL '% .QRWHQ5$& .QRWHQ5$& empno 7369 7499 7521 7566 7654 7698 name Smith Allen Ward Jones Martin Blake Page 3 7KHDUFKLWHFWXUDOUHTXLUHPHQWV RI7$) y All the applications must be TAF aware means: OCI driver or Pro* precompiler y SQL*Plus is TAF aware y ODBC connection y JDBC Thick Driver (OCI driver) Applications are not OCI compliant Forms, Reports, etc. 7KH6ROXWLRQEHKLQGLWDOO2UDFOH1HW y Dynamic Instance Registration y Load Balancing – – Client-Side Server-Side y Connect Time Failover y Runtime Failover – Transparent Application Failover Page 4 '\QDPLF,QVWDQFH5HJLVWUDWLRQ y Instance Î Listener Communication y Use SERVICE_NAME not SIDs y Recognises / Updates via PMON – – y Start and stop listener Start and stop instance Simplifies Management '\QDPLF,QVWDQFH5HJLVWUDWLRQ± WKLQJVWREHDZDUHRI y Service Registration Delay: – If startup is 1) Listener 2) Instance then service registration is immediate. – If startup is 1) Instance 2) Listener then PMON fails the initial registration and retries every 60 sec. (connections are refused until successfully registered!) – Workaround: “$/7(56<67(05(*,67(5” upon listener startup. Page 5 &OLHQW6HUYHUVHLWLJHV/RDGEDODQFLQJ &OLHQW6HUYHUVHLWLJHV/RDGEDODQFLQJ • Verbindungsaufbau nach einem Zufallsprinzip – verwendet die Adressliste der tnsnames.ora Listener verteilen Anfragen basierend auf CPU-Last • – PMON Prozess meldet den Listenern die Knotenauslastung .QRWHQ &OLHQW 1HW]ZHUN &OLHQW &OLHQW &OLHQW UDF OVQU ,QVWDQ] 5DF 'DWHQEDQN UDF OVQU ,QVWDQ] &OLHQWQ .QRWHQ /RDG%DODQFLQJ± &OLHQW6LGH y y Client-Side – – – Connection Levelling Multiple ADDRESSes LOADBALANCE=ON Random profile . . Simple Effective Configuration Changes !"# #$$%#'& ")(* "+ !",-!& . /102346524872960"7 :& !"*10;<0"&& "+ !",-!& . /102346524872960"72"& !"*10;<0"&& " ($ #-=>?& A@ ?B",,#'& & Page 6 6HUYHU6LGH/RDG%DODQFLQJ 6HUYHU6LGH/RDG%DODQFLQJ y y Server-Side Load Levelling REMOTE_LISTENER PMON updates load info Listener redirects connections – – – 1HW]ZHUN &OLHQW &OLHQW - Simple Effective Configuration Changes .QRWHQ &OLHQW &OLHQW - OVQU OVQU &OLHQWQ UDF ,QVWDQ] 5DF 'DWHQEDQN UDF ,QVWDQ] .QRWHQ /RDG%DODQFLQJ± 6HUYHU6LGH y PMON dynamically registers the services to the specified listeners with: – – – – service names for each running instance of the database instance names of the database service handlers (dispatchers and dedicated servers) available for each instance dispatcher, instance, and node load information y 1-Minute OS Node Load Average all 30 secs. y Number of Connections to Each Instance y Number of Connections to Each Dispatcher Page 7 /RDG%DODQFLQJ± 6HUYHU6LGH KRZFRQQHFWLRQVDUHHVWDEOLVKHG y Depending on the load information, a listener decides which instance and, if shared server is configured, which dispatcher to send the incoming client request to. y In a shared server configuration, a listener selects a dispatcher in the following order: 1) least loaded node, 2) least loaded instance, and 3) least loaded dispatcher for that instance. y In a dedicated server configuration, a listener selects an instance in the following order: 1) least loaded node, and 2) least loaded instance. y An Oracle9i Real Application Clusters environment requires that the dispatchers on each instance be cross registered with the other listeners on the other nodes. This is achieved by the use of the LISTENER attribute of the DISPATCHERS parameter. 6HUYHU6LGH 6HUYHU6LGH /RDGEDODQFLQJ /RDGEDODQFLQJ VFKHPD VFKHPD &RQQHFWLRQ /RDG %DODQFH 'DWDEDVH6HUYHU 0DFKLQH &OLHQW 'LVS /LVW $ ,QVWDQFH 'LVS /LVW 'LVS % ,QVWDQFH Page 8 6HUYHU6LGH/RDGEDODQFLQJ± ZKDWWRVHWLQLQLWRUD y y y y SERVICE_NAMES = <6(59,&(B1$0(> (defaults to DB_NAME.DB_DOMAIN) INSTANCE_NAME = <,167$1&(B1$0(> LOCAL_LISTENER = <L/,67(1(5B$/,$6> REMOTE_LISTENER = <5/,67(1(5B$/,$6> (automatically configured by DBCA) optional: y dispatchers= “(PROTOCOL=TCP) (SERVICE= <6(59,&(B1$0(> (LISTENER = <DLISTENER_ALIAS>" 6HUYHU6LGH/RDGEDODQFLQJ± ZKDWWRVHWLQWQVQDPHVRUD LISTENERS_RAC.ORACLE.COM = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = stdemo06)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = stdemo07)(PORT = 1521)) ) LISTENER_RAC11.ORACLE.COM = (ADDRESS = (PROTOCOL = TCP)(HOST = stdemo06)(PORT = 1521)) LISTENER_RAC12.ORACLE.COM = (ADDRESS = (PROTOCOL = TCP)(HOST = stdemo07)(PORT = 1521)) Page 9 ([DPSOH RIOVQUFWOVHUYLFHVRXWSXW $ lsnrctl services LSNRCTL for HPUX: Version 9.0.1.2.0 - Production on 19-FEB-2002 12:36:19 Copyright (c) 1991, 2001, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))) Services Summary... Service "rac" has 2 instance(s). Instance "rac1", status READY, has 2 handler(s) for this service... C DEDFAG HI ED6CJLKMAN OPQK RJS8T UWVAJX YK JS8T U4KMANM J8T VAJNASAZ [EA\L]I E_^ E[A`E[ a HDD[E^^ b a c []IA]GA]dAbIG cefa g ]L^AIAbA[AHGLh iL]ADEkj efa c ]A[LIAbjAlAmLj ee Handler(s): "D001" established:0 refused:0 current:0 max:2026 state:ready DISPATCHER <machine: rac-node1, pid: 2157> (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1)(PORT=60150))(PRESENTATION=oracle.aurora.server.GiopServer)(SESSION=RAW)) Instance "rac2", status READY, has 2 handler(s) for this service... Handler(s): "D001" established:0 refused:0 current:0 max:2026 state:ready DISPATCHER <machine: rac-node2, pid: 18132> (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode2)(PORT=65052))(PRESENTATION=oracle.aurora.server.GiopServer)(SESSION=RAW)) C DEDFAG HI ED6CJLKMAN OPQK RJS8T n'VAJX YK JS8T U4KMANM J8T VAJNASAZ dA]G Hd9^ E[A`E[ The command completed successfully 2UDFOH7UDQVSDUHQW$SSOLFDWLRQ)DLORYHU7$) %HQXW]HUZHUGHQDXWRPDWLVFK •DXIHLQHPLQWDNWHQ.QRWHQ %HLGH.QRWHQDNWLY •ü=XJULIIDXIHLQH'DWHQEDQN EHUQRPPHQXQGOHVHQGH =XJULIIHIRUWJHVHW]W Aktiver Aktiver 2UDFOHL '% 2UDFOHL '% .QRWHQ5$& .QRWHQ5$& empno 7369 7499 7521 7566 7654 7698 name Smith Allen Ward Jones Martin Blake Page 10 &RQQHFW 7LPH)DLORYHU y y Connect time failover is not the same as the Transparent Application Failover Implement connect time failover: – y Failover = on Connect-time failover is turned on by default !"# ")(* "+ "+ !",-!& . /102346524872960"7 :& ! "*10;<0"&& !",-!& . /102346524872960"72"& ! "*10;<0"&& " ($ #-=>?& A@ ?B",,#'& & &RQQHFW7LPH)DLORYHU y Find a Listener: 1. 2. 3. 9 • • Listening? Service available? Instance available? Connected! Any Client Always Useful Page 11 7KUHH³/HYHOV´ RI7$))XQFWLRQDOLW\ y TYPE=SESSION, METHOD=BASIC (Login Failover) – y TYPE=SELECT (Statement Failover) – – – y Client is automatically logged into surviving node of cluster Node failure occurs during query Client fails over to a surviving node and is logged in Query replayed on surviving node but only rows not returned during the original query execution are returned METHOD=PRECONNECT (“Fast” Session Failover) – – Client connected to two instances at session establishment Avoid impact of “login storm” during failover to surviving node in Real Applications Cluster or Oracle Parallel Server *UXQGODJHIU7$)± 64/1HW 7161$0(6 o8pqsr)t8uvw xy?w z{t8u v{|sy?wAvsz)}~ xy8vst8ofz8 ~ y8{u |sy{~{{tsz{{y8 ux{xt{y{| s{o~ ux{xt{y{~ 8t{zo)zv8z|~o8v z{o~ssw{w8wL) 8zsto~ss { ux{xt{y{~ 8t{zo)zv8z|~o8v z{o~ssw{w8wL) 8zsto~ss { |sz8ux)8u |)u{vsy{~s u)|sz)yst~z8 vsz8{ yv ox8uo6u~ )y{t)y{t~xysxfv)uo)ysx" )y{t)")vsyf {us}y{~{{r8pqsr { {¡{)¢ pk £s¤{p8~ rf¥s¦ps~q)p¡sp§r £p r)¨ s¤s~8© q) {§ t{yo)tfy)~s xy|)uª~ {{ Page 12 7$)3DUDPHWHUVLQWQVQDPHVRUD ± RSWLRQDO o)y{o)t8uvw z{t8uv{|sywAvsz)}~ xy8vst8ofz8 ~ ux{xt{y{| s{o~ ux{xt{y{~ 8t{zo)zv8z|~o8v z{o~qsr)¤{p)£ « 8zsto~ss { ux{xt{y{~ 8t{zo)zv8z|~o8v z{o~qsr)¤{p)£¬ 8zsto~ss { u)|sz)yst~s |sz8ux)8u |)u{vsy{~s vsz8{ yv ox8uo6u~ )y{t)y{t~xysx)v)uo)y8x" )y{t)")vsy6 {us}y~{s§ k{o6u{v8yft{z|sy~1 8t}utsª?®L)yvsz8xsu tsª4L u)|sz)ystf}zsxy{~ ofª8ys~q)p¡sp§r }yo zsx~8© q8 {§ 8uvs8¯8~{t8uv8x °w zst8uv{|sywAvsz)} J5HO7$)XQG6HUYLFHV ±6±f²A³{´¶µ · ¸6¹ ±kº6»s¼½f²)¼¾k¿Àµ · ³ ¸f¸ » ¹ ±f±¶µ · ½»6¾8²L¾)ºk¾fÁµòºf½8Ä · ³ ¸f¸ » ¹ ±f±¶µ · ½»6¾8²L¾)ºk¾fÁµòºf½8Ä · ³ ¸f¸ » ¹ ±f±¶µ · ½»6¾8²L¾)ºk¾fÁµòºf½8Ä 1. · ³ ¸f¸ » ¹ ±f±¶µ · ½»6¾8²L¾)ºk¾fÁµòºf½8Ä · ºk¾6¿6¿ ¹ º8²AØ ¸ ³²³Èµ · ± ¹ »LÙ ¹ »Úµ ¸6¹6¸ ¼LºL³² ¹6¸ Ä · ± ¹ »LÙ¼Lº ¹ Ø)¿k³fÛ ¹ µÃÇ6Ç6²A³´8Ä6Ä6Ä 2. 6HUYHUVHLWLJHV7$) · Å )¾ ±f²ÆµÈÇÉfÊ8ËkÌfÍ6ÍfÎ6ÏÐsÑLÒÄ · Å ¾)±f²ÆµÈÇÉfÊ8ËkÌfÍ6ÍfÎLÕÐsÑLÒÄ · Å ¾)±f²ÆµÈÇÉfÊ8ËkÌfÍ6ÍfÎÖLÐsÑLÒÄ · Å ¾)±f²ÆµÈÇÉfÊ8ËkÌfÍ6ÍfÎ×LÐsÑLÒÄ · ½k¾6»8²ÆµÓÏÔkÕ8Ï)Ä6Ä · ½k¾6»8²ÆµÓÏÔkÕ8Ï)Ä6Ä · ½k¾6»8²ÆµÓÏÔkÕ8Ï)Ä6Ä · ½k¾6»8²ÆµÓÏÔkÕ8Ï)Ä6Ä 3. Ü fÝ ÞÝ{ßsàá)ÝâfãsäåAæå{Ýsç{èé{ß{Ýê äësâé{ìkí6æå{Ýsç{èé{ß{Ý î å{Ýsç{èé{ß{Ýæ"ï ð6äÝòñsóõô å{å ö÷øWôù ® sú6¨ krs {§srs {sq~û rs8üpý® { {¡{)¢ pk £p r)¨s¤~û ¤)©{£qLq)p)¢ {§spw { {¡{)¢ pk £pr)¨ s¤6© q8 {§þ"® { {¡{)¢ pk"rf¥s¦pÿ~û ¤)©{£qLq)p)¢ {§spw { {¡{)¢ pk"rf¥8¦p6q)p{¡sp§r þ"® { {¡{)¢ pksp rss spq~ûs{þ"® { {¡{)¢ pk¤{p¡{f¥ ~û þ"® §{¡f©8{{¡ÿ~û ¤)©{£qLq)p)¢ {§spw§s¡f©8{{¡k¡{8 (BUG 4449641 & BUG 4487927) Page 13 7$) 2&,FRQQHFW y JDBC / OCI connect Employee.java example …. DriverManager.getConnection ("jdbc:oracle:thin:scott/tiger@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(H OST=venus.de.oracle.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=mars.de.oracle.com)(P ORT=1521))(CONNECT_DATA=(SERVICE_NAME=V92M.linux)))"); Or DriverManager.getConnection ("jdbc:oracle:thin:scott/tiger@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(H OST=venus.de.oracle.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=mars.de.oracle.com)(P ORT=1521))(CONNECT_DATA=(SERVICE_NAME=V92M.linux)(FAILOVER_MODE=(TYPE=select) (METHOD=basic)(RETRIES=20)(DELAY=5)))"); y Examples are in $ORACLE_HOME/jdbc/demo/samples/jdbcoci $ORACLE_HOME/jdbc/demo/samples/generic 7$)9HULILFDWLRQ §{8ü r üq)psf£p u{6u |8¯fy{t®Æ£{§8¨ s{p®Èk{okx )qsrss§sp® { {¡{)¢ pk"rf¥s¦p® { {¡{)¢ pk£p r)¨ 8¤® { {¡sp{¤6)¢ p {f£ 8¢{q)pq{q8 {s üq)psf£p~ 8v8zo{o ¨psp {8ü8¦©¥£{§8¨ 8{p®Èk{o 8¤® s {¡{)¢ pk"rf¥s¦p® s {¡{)¢ pk £p rf¨ s¤® { {¡sp{¤6)¢ p q)p¡sp§r o)¨p 8ür6¦ ürÓ©p {sp { {¡{)¢psp q)p)£{©¡spqr)¨p s¡{¡{ s ANZAHLUSER ---------1 1 MACHINE INSTANCE# FAILOVER_TYPE FAILOVER_M ----------------------- --------- ------------- ---------sturachh1 1 NONE NONE DE-ORACLE\mmichale-lap 1 SELECT BASIC FAI --NO NO o)¨p 8ür6¦ ür r)p { {¡{)¢ p{ q ANZAHLUSER MACHINE INSTANCE# FAILOVER_TYPE FAILOVER_M FAI ---------- ----------------------- --------- ------------- ---------- --1 DE-ORACLE\mmichale-lap 2 SELECT BASIC YES Page 14 2UDFOH7UDQVSDUHQW$SSOLFDWLRQ)DLORYHU7$) %HQXW]HUZHUGHQDXWRPDWLVFK •DXIHLQHPLQWDNWHQ.QRWHQ %HLGH.QRWHQDNWLY •ü=XJULIIDXIHLQH'DWHQEDQN EHUQRPPHQXQGOHVHQGH =XJULIIHIRUWJHVHW]W Aktiver Aktiver 2UDFOHL '% 2UDFOHL '% .QRWHQ5$& .QRWHQ5$& empno 7369 7499 7521 7566 7654 7698 name Smith Allen Ward Jones Martin Blake 'UHL6]HQDULHQ.QRWHQ&UDVK y Insert(beendet)-Crash-SQL Æ ORA-25402 transaction must rollback y SELECT(beendet)-Crash-SQL Æ SELECT wird übernommen y SELECT (warten)-CRASH Æ TAF funktioniert nur, bei ENABLE=BROKEN und entsprechen eingestelltem TCP KeepAlive! Page 15 1HWZRUNLQJ 3DUDPHWHU y y Zeit vom letzten Paket bis ein Testpaket versendet wird – tcp_keepalive_time (Linux) – KeepAliveTime (Windows) – tcp_keepalive_interval (Solaris) Anzahl der Testpakete – tcp_keepalive_probes (linux) – MaxDataRetries (Windows) – y tcp_ip_abort_interval (Solaris, aber hier Zeitraum, nicht Anzahl) Zeitlicher Abstand zwischen den Probes – tcp_keepalive_intvl (Linux) – KeepAliveInterval (Windows) – tcp_rexmit_interval_max (Solaris) 0XVVEHL/LQX[6RODULVQDFKMHGHP%RRWJHVHW]WZHUGHQ 7&3,3.HHSDOLYH3DUDPHWHUV y y y y y Never change it without understanding it tcp_keepalive_interval tcp_ip_abort_cinterval Enable=broken in tnsnames.ora No need to set starting with 10g – Oracle RAC VIP implementation is the solution Page 16 1HWZRUN3DUDPHWHUV± ZKDWWRVHWLQWQVQDPHVRUD o8pqsr)t8uvw xy?w z{t8u v{|sy?wAvsz)}~ xy8vst8ofz8 ~ y8{u |sy{~{{tsz{{y8 ux{xt{y{| s{o~ ux{xt{y{~ 8t{zo)zv8z|~o8v z{o~ssw{w8wL) 8zsto~ss { ux{xt{y{~ 8t{zo)zv8z|~o8v z{o~ssw{w8wL) 8zsto~ss { |sz8ux)8u |)u{vsy{~s u)|sz)yst~z8 vsz8{ yv ox8uo6u~ )y{t)y{t~xysxfv)uo)ysx" )y{t)")vsyf {us}y{~{{r8pqsr { {¡{)¢ pk £s¤{p8~ rf¥s¦ps~q)p¡sp§r £p r)¨ s¤s~8© q) {§ t{yo)tfy)~s xy|)uª~ /LVWHQHU 5HJLVWUDWLRQ8SGDWH y y Service Registration Instance Registration Page 17 2UDFOH7UDQVSDUHQW$SSOLFDWLRQ)DLORYHU7$) %HQXW]HUZHUGHQDXWRPDWLVFK •DXIHLQHPLQWDNWHQ.QRWHQ %HLGH.QRWHQDNWLY •ü=XJULIIDXIHLQH'DWHQEDQN EHUQRPPHQXQGOHVHQGH =XJULIIHIRUWJHVHW]W Aktiver Aktiver 2UDFOHL '% 2UDFOHL '% .QRWHQ5$& .QRWHQ5$& 5HJDUGOHVVRI7$)± empno 7369 7499 7521 7566 7654 7698 name Smith Allen Ward Jones Martin Blake WKLQJVWREHDZDUHRI PD\QRWEHDFRPSOHWHUHIHUHQFH y y y y Folgende Fehler können generell trotz TAF auftreten – Lösung „rollback“ ORA-25401: cannot continue fetches ORA-25402: transaction must roll back ORA-25405: trx status unknown (bug 2109927) ORA-25408: cannot safely reply call y Folgende Fehler sind selten (vor allem im RAC), können aber auftreten. TAF deckt sie nicht ab und steigt aus – Lösung häufig (RE-)Konfiguration: ORA-01014: Oracle shutdown in progress ORA-01017: Invalid username / password ORA-01033: Oracle initialisation or shutdown in progress ORA-01089: immediate shutdown in progress – no operations ORA-01090: shutdown in progress – connection not permitted ORA-01092: Instance Terminated; Diconnection forced y Bei folgendem Fehler Konfiguration kritisch überprüfen - ggf. Support ORA-03113: eoF on communication channel y y y y y Page 18 <RXZDQWPRUHFRQWURO" y Optional: – OCI Callbacks ³&´ 7$)&DOOEDFN2&,t !"#$%'&)(#$%'&)*+,-&.*/+0%(1&.*(#2(+43 55 6 Implement the callback procedure 8729+$:;*(#2(+23 6 28(=<2>2?@A<BC2D2?E 5 6 %F98+'HGIA998J=<#2(2FLKKKNM(28(+OP0RQ8/G3S 55 2&,)RFEN6WUXFW Take action IDLORYHU IDLORYHUFDOOEDFNBIXQFWLRQ LI2&,$WWU6HW FDOOEDFNBIQ VUYK2&,B+7<3(B6(59(5 IDLORYHU2&,B$775B)2&%. 55 HUUK 2&,B68&&(66 Register TAF callback procedure Page 19 -DYD7$)&DOOEDFN2&,t LPSRUWRUDFOHMGEF2UDFOH&RQQHFWLRQ LPSRUWRUDFOHMGEF2UDFOH2&,)DLORYHU &DOO%DFNIFEN QHZ Instantiate the callback class &DOO%DFN 2UDFOH&RQQHFWLRQFRQQUHJLVWHU7$)&DOOEDFNIFEN FODVV &DOO%DFN SXEOLF LQW PVJ register TAF callback function LPSOHPHQWV LQWFDOOEDFN)Q W\SH LQW 2UDFOH2&,)DLORYHU &RQQHFWLRQ ^ FRQQ2EMHFW FW[W HYHQW^ Implement the callback class VZLWFKHYHQW^ FDVH)2B%(*,1 React 2UDFOH7UDQVSDUHQW$SSOLFDWLRQ)DLORYHU7$) %HQXW]HUZHUGHQDXWRPDWLVFK •DXIHLQHPLQWDNWHQ.QRWHQ %HLGH.QRWHQDNWLY •ü=XJULIIDXIHLQH'DWHQEDQN EHUQRPPHQXQGOHVHQGH =XJULIIHIRUWJHVHW]W Aktiver Aktiver 2UDFOHL '% 2UDFOHL '% .QRWHQ5$& .QRWHQ5$& empno 7369 7499 7521 7566 7654 7698 name Smith Allen Ward Jones Martin Blake Page 20 J 2UDFOH5HDO$SSOLFDWLRQ&OXVWHUV y Neu mit Oracle Database 10T : – Oracle Automatic StorageManagement (ASM) – Oracle portable Clusterware – Der Datenbank-Service-Gedanke – einheitliche Verwaltung mit dem Oracle Enterprise Manager (EM) Oracle ASM 3XEOLF/$1$XVIDOO± GLH7$)+HUDXVIRUGHUXQJ y Public LAN Ausfall Probleme: – – – y Server 2 Verbundene Clients werden gestoppt – TAF Keine neuen Verbindungen möglich – TAF Erkennung des Verbindungsabbruchs – TCP Mögliche Lösungen: – – y Server 1 Redundante LAN Verbindungen (SI / RAC) Ausfall eines Knotens wird toleriert (RAC) Erkennung des Verbindungsabbruchs: – Oracle 9i / 10g: Setzen der TCP Parameter (vgl. Metalink Note 13393.1 & 249213.1) – Ab Oracle 10g neue SQLNet Parameter – Speziell 10g RAC: VIPs * * 'DWD $= (vgl. Metalink Note 249213.1) San 1 San 2 Page 21 'LH2UDFOH&OXVWHUZDUH$UFKLWHNWXU5HO j k lnm o o p j k lnm o o p 140.84.20.01 140.84.20.02 d"e f f ^ _;Y"[ \ ] ^ d"e f f ^ _;Y"[ \ ] ^ X [ _ ` ^a b b;c X [ _ ` ^a b b;c UWVHXZYW[ \ ] ^ UWVHXZYW[ \ ] ^ g [ h [Za b bic g [ h [Za b bic 140.84.20.03 140.84.20.04 140.84.20.05 140.84.20.06 Virtuelle IP Adressen Instanzen ONS Prozesse Oracle Cluster Ready Services (CRS) HA Framework Oracle Cluster Synchronisation Services (CSS) Basis für Inter-prozess & -Knoten-Operationen, Node Monitoring & Membership, Client-Dienste Hardware / Betriebssystem Kernel 2UDFOH)DVW$SSOLFDWLRQ1RWLILFDWLRQ)$1 y FAN = neues Oracle 10g RAC High Availability Feature y Grundidee: gezielte Information registrierter Clients über Änderungen im 10g RAC-Cluster (HA Events und Loadbalancing) y Technisch: Vermeidung von Ausfallzeiten z.B. wg. TimeOuts y 2UDFOH 'DWDEDVH2UDFOH&OXVWHUZDUHDQG2UDFOH5HDO $SSOLFDWLRQ&OXVWHUV$GPLQLVWUDWLRQDQG'HSOR\PHQW *XLGH .DSLWHO ,QWURGXFWLRQ WR:RUNORDG0DQDJHPHQW (http://downloaduk.oracle.com/docs/cd/B19306_01/rac.102/b14197/hafeats.htm#sthref372) 5$&)DLORYHU (UNHQQXQJ $XVIDOO]HLW RKQH )D1 VHFV aPLQV !PLQV PLW )D1 VHFV VHFV VHFV Page 22 2UDFOH'DWHQEDQN6HUYLFHV *UXQGODJHYRQ)DLORYHU XQG:RUNORDG0DQDJHPHQW " @ Failover Workload Management Management qr stusviuw qxv yxviw z|{8}~ s}8rW{t " -Z ¡ ¢H ¡ £ @ Z| @ sv x}xtux}@ r qxv yxv s{8}8 s~ ~ 'HU'DWHQEDQN6HUYLFH*HGDQNH ERP_DB CRM_DB Email_DB y Grundidee: – eine Datenbank – mehrere Namen – mehrere Applikationen – eine Datenbank y Ziel: – (automatisches) Workloadmanagement – automatisches (Connection-)Loadbalancing – Zugriff auf bestimmte Connections y Technik: – :HLWHUHQWZLFNOXQJ der Net-Service-Namen Page 23 $QOHJHQYRQ'DWHQEDQN± 6HYLFHVLP'%&$RGHU(0 ERP_DB CRM_DB $XIO|VXQJGHU6HUYLFH1DPHQYLD 7161$0(6 ERP_DB ¤¥8¦§8¨©ª¨« = (DESCRIPTION= (ADDRESS_LIST = (FAILOVER = on) ªZ¦8 ) (PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=¬ ªZ¦® ) (PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=¬ ) (CONNECT_DATA = (SERVICE_NAME = ERP_DB) Service-Name (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 35) (DELAY = 5) Virtuelle IP-Adressen oder ) entsprechende Hostnamen ) ) Page 24 2UDFOH'DWHQEDQN6HUYLFHV $OV%DVLVWHFKQRORJLHQLFKWQXULQGHU'%YHUWUHWHQ $ORA_CRS_HOME/bin/crs_stat –t HA Resource ----------ora.RAC.RAC.RAC1.srv ora.RAC.RAC.RAC2.srv ora.RAC.RAC.RAC3.srv ora.RAC.RAC.RAC4.srv ora.RAC.RAC.cs ora.RAC.RAC1.inst ora.RAC.RAC2.inst ora.RAC.RAC3.inst ora.RAC.RAC4.inst Target -----ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE State ----ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE on on on on on on on on on stnsp001 stnsp002 stnsp003 stnsp004 stnsp001 stnsp001 stnsp002 stnsp003 stnsp004 $ORACLE_HOME/bin/srvctl status service -d RAWRAC -s LOAD1,LOAD2,LOAD3,LOAD4 Service Service Service Service LOAD1 LOAD2 LOAD3 LOAD4 is is is is running running running running on on on on instance(s) instance(s) instance(s) instance(s) RAWRAC3, RAWRAC3, RAWRAC3, RAWRAC3, RAWRAC2, RAWRAC2, RAWRAC2, RAWRAC2, RAWRAC1, RAWRAC1, RAWRAC1, RAWRAC1, RAWRAC4 RAWRAC4 RAWRAC4 RAWRAC4 2UDFOHJ5XQWLPH/RDGEDODQFLQJ 8QWHUVWW]WH7UHLEHU-'%&2'31(7 ¶ÎÍ/ÏÐv xÑ{x}8r }Ò·ttx8rW¸ ·t ¶/·ttxrW¸ ·2t ¹ ··2~ Ë8É8Ê º»¼2½¡ ¢H ¾8¿nÀ ÁZ¾ÿnÄ À Å Æ Ç Ì É8Ê È8É8Ê º»¼2½¡ ¢H ÁÓ@ÔZ¾¿nÀ ÁHÔÅ ¿HÅ Æ ¯ ° °±²³ ¯ ° °±²2´ º»¼2½¡ ¢H Õ ¿ÔÖH×ØZÙ Å Ä ¾Å Æ ¯ ° °±²2µ Page 25 2UDFOHJ5XQWLPH/RDGEDODQFLQJ 9RUDXVVHW]XQJHQ&RQQHFWLRQ3RRO6HUYLFHVXQG$GYLVRU\ CRM_DB ä °n°²±" °å H@æ úøù ÷ ³Wøù ç èHénêë ì í îï ð ñ ò;î"óZï ô ð õ ö µøù ç èHénêë ì í ñiû ü îï ð ñ üiõ ï õ ö Ú Û Ü Ý Þ Û ß àZá Ú Û Ü Ý Þ Û ß àHâ ç èHénêë ì í ý ï ü;þ ÿ õ ô î"õ ö Ú Û Ü Ý Þ Û ß àHã ! 2UDFOHJ 5XQWLPH/RDGEDODQFLQJ 9RUDXVVHW]XQJHQ/RDG%DODQFLQJ$GYLVRU\ y Mittels Load Balancing Advisory kann Workload über einen RAC-Cluster verteilt werden. y Ziel ist es, eingehenden Workload auf den Knoten zu lenken, auf dem der adressierte Service gut reagiert. y Ziel ist es ferner, Workload nicht zu hängenden Knoten zu senden. y Ferner berücksichtigt das Load Balancing Advisory ungleiche Knotenstrukturen sowie Prioritäten ! Page 26 2UDFOHJ /RDG%DODQFLQJ$GYLVRU\ =LHO*RDOVSUR6HUYLFH y y Für das Load Balancing Advisory können GOALs vereinbart werden. Goals beschreiben, nach welchen Maßstäben der Connection Pool Workload an einen Service auf einer bestimmten Instance zuweisen soll: – – – y THROUGHPUT SERVICE_TIME NONE Das Workload Respository muss nicht verwendet werden (Setting NONE) ! CRM_DB 2UDFOHJ 5XQWLPH/RDGEDODQFLQJ (LQVWHOOXQJHQLQGHP(QWHUSULVH0DQDJHU Page 27 *H]LHOWH$SSOLNDWLRQVEHQDFKULFKWLJXQJ 6HUYHUVHLWLJRGHUUHPRWHEHU216 JAVA +++ Node 2 down +++ Client +++ Instance down on node 1 +++ Client C-Applik. )$1 (YHQW Server / RAC Knoten ONS Oracle Cluster Ready Services (CRS) HA Framework 'HU,PSOL]LWH&RQQHFWLRQ3RRO ä °n°²±" °å H@æ úøù ÷ ³Wøù ç èHénêë ì í îï ð ñ ò;î"óZï ô ð õ ö ç èHénêë ì í ñiû ü îï ð ñ üiõ ï õ ö Ú Û Ü Ý Þ Û ß àZá c ¡ @n ¡ µøù Ú Û Ü Ý Þ Û ß àHâ ç èHénêë ì í ý ï ü;þ ÿ õ ô î"õ ö Ú Û Ü Ý Þ Û ß àHã c cc c c c c cc c c » n ¡ ¼@ ¡ @n ¡ » @¢@ ¢ Page 28 'HULPSOL]LWH&RQQHFWLRQ3RRO *UXQGODJHIU)DVW&RQQHFWLRQ)DLORYHU)&) y y y Der implizite Connection Cache registriert sich am ONS Damit werden automatisch FAN-Events empfangen Auf ein „(Service) DOWN“-Event reagiert der Connection Pool mit: Terminierung bestehender Connections gegen den Service Folge: Applikation bekommt unmittelbar einen ORACLE Fehler Connection Pool leitet neu eingehende Connections um Bereits erfolgte Connections werden nach den Vorgaben des Load Balancing Advisory umverteilt, wenn Services verfügbar – – – – c c c ¡ @n ¡ cc c c c c c » n ¡ ¼@ ¡ @n ¡ » @¢@ ¢ =XVDPPHQIDVVXQJ y y TAF FAN mit FCF Klassische Failover Absicherung TAF-eigene Fehlermeldungen Voraussetzung: OCI-Zugriff – – – – – – – – – Aktiver Aktiver ¼» ¼» Ä Z Z Failover Absicherung Workload Absicherung ORACLE-Fehlermeldungen Schnelle Benachrichtigung Voraussetzung: Impliziter Connection Pool TAF und FAN schließen sich für eine Datenbankverbindung bzw. für denselben Service aus Ä Z Z c cc c c c cc c c æ ± " ° ä °n°²±" °å H@æ ² æ æ ± " ° ä æ ² Page 29 5$&XQG&56,QWHUQHW6HPLQDUH RAC und Oracle CRS Teil 1 – Release 2 stellt sich vor http://www.oracle.com/global/de/download/2005_09_07_R AC_und_CRS_Teil_1_Markus_Michalewicz.zip RAC und Oracle CRS Teil 2 – Installation und Konfiguration http://www.oracle.com/global/de/download/2005_10_05_R AC_und_CRS_Teil_2_Markus_Michalewicz.zip RAC und Oracle CRS Teil 3 – Die Oracle HA-API http://www.oracle.com/global/de/download/2005_11_14_R AC_und_CRS_Teil_3_Markus_Michalewicz.zip RAC und Oracle CRS Teil 4 – TAF, FAN und hochverfügbare Anwendungen http://www.oracle.com/global/de/download/2005_11_30_R AC_und_CRS_Teil_4_Markus_Michalewicz.zip Page 30