《Application Continuity with Oracle Database 23ai [LRN3303].pdf》由會員分享,可在線閱讀,更多相關《Application Continuity with Oracle Database 23ai [LRN3303].pdf(40頁珍藏版)》請在三個皮匠報告上搜索。
1、Application Continuity with Oracle Database 23aiMarkus Michalewicz(Oracle)Sebastian Solbach(Oracle)Harsh Gupta(Deutsche Bank)September 11,2024Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates1The following is intended to outline our general product direction.It is intended for informatio
2、n purposes only,and may not be incorporated into any contract.It is not a commitment to deliver any material,code,or functionality,and should not be relied upon in making purchasing decisions.The development,release,timing,and pricing of any features or functionality described for Oracles products m
3、ay change and remains at the sole discretion of Oracle Corporation.The materials in this presentation pertain to Oracle Health,Oracle,Oracle Cerner,and Cerner Enviza which are all wholly owned subsidiaries of Oracle Corporation.Nothing in this presentation should be taken as indicating that any deci
4、sions regarding the integration of any EMEA Cerner and/or Enviza entities have been made where an integration has not already occurred.Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates2Safe harbor statementMarkus MichalewiczVice PresidentMission Critical DatabaseProduct ManagementOracleS
5、ebastianSolbachDistinguished Product ManagerMission Critical Database Product ManagementOracleHarshGuptaDeputy Head Global Database ServicesHead Of Oracle Cloud EngineeringDeutsche BankOracle CloudWorld Copyright 2024,Oracle and/or its affiliates3Click to edit TitleThe Problem:Applications are Impac
6、ted by Database OutagesOracle CloudWorld Copyright 2024,Oracle and/or its affiliates4WaitsReceive an ErrorNeed to reconnectNeed to restartUnsure where left offThe Goal:Business ContinuityOracle CloudWorld Copyright 2024,Oracle and/or its affiliates5Eliminate downtime for usersMasking of recoverable
7、errorsMaintenance is hiddenAutomatically reconnectIn-flight work is preservedBetter performanceSimpler for developersDetailed statisticsBuilt on Oracle Maximum Availability ArchitectureThe Solution:Transparent Application Continuity 23ai6Oracle CloudWorld Copyright 2024,Oracle and/or its affiliatesA
8、pplication Continuity(AC)For planned maintenance and unplanned outagesAvailable with Oracle RAC and Active Data GuardOracle and 3rd party connection pools that are JDK-compliant(incl.JBoss,Hikari)Supports customizable“side effects”(e.g.UTL_HTTP)Transparent Application Continuity(TAC)For planned main
9、tenance and unplanned outagesAvailable with Oracle RAC and Active Data GuardSame as AC and discovered TAC boundariesDisables“side effects”,customizable(23ai)Default on Oracle Autonomous DatabaseCopyright 2024,Oracle and/or its affiliates7Application Protection One Solution Two FlavorsFaster failover
10、 for selects with Transparent Application Continuity repositioning cursors at failover time.Lower database CPU cost compared to 19c running SPEC-J using a reduced Application Continuity code path.Lower client CPU cost with OCI driver using OCI_THREADED_V2.40%Up to 50%Up to 55%Oracle CloudWorld Copyr
11、ight 2024,Oracle and/or its affiliates8Application Continuity 23ai PerformanceLower database CPU cost using native XID when possibleUp to 95%Even faster with Native Transaction Guard*Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates9*Transaction Guard guarantees the commit outcome when a
12、n error code is returned after an error or outage.It is the basis for Application Continuity and Transparent Application Continuity.Simpler for DevelopersAllow developers to focus on functionalityOracle CloudWorld Copyright 2024,Oracle and/or its affiliates10Let the database determine when to reloca
13、te sessions during planned maintenance and failbackDrainingAllows applications to complete their work before performing maintenance or any form of draining.With Oracle Database 23ai,the drain timeout can be set per database service or session.Oracle DatabaseDetects sessions that will not drain and c
14、an failoverProactively chooses failover sessions based on rulesBounds maintenance windowsBounds moving sessionsMost requests reach failover conditions quicklySelected sessions continue with(Transparent)Application ContinuityMinimizes ungraceful termination of sessions unable to relocate before timeo
15、utReduces replay time on failoverOracle CloudWorld Copyright 2024,Oracle and/or its affiliates11Database-initiated session migration during drainingTransparent Application ContinuityRESET_STATE for allOracle CloudWorld Copyright 2024,Oracle and/or its affiliates12Prevents applications from leaking s
16、tate the most essential developer feature in 23ai Problem When an application returns a connection to the pool,cursors in FETCH and session state remains on that session,unless an action is taken to clear them.Application session state and cursors leak to later reuses.With Oracle Database 23ai RESET
17、_STATE restores the session state to login and cancels cursors in FETCH at the end of each request Oracle Database guarantees cleaning the state which is otherwise left to developers Independent of(Transparent)Application ContinuityBenefits Application security holes are prevented,code savings,lower
18、 DB CPU usage Broader protection with TAC e.g.Microservices,APEX,ORDs,Fusion Apps,SwingBench Highly demanded customer feature e.g.requested by banks,retail,governmentReduces TAC discovery of request boundaries to“not in transaction and snapshot-able session state”On capture:Select statements are hel
19、d across transactionsOn replay:Execution state restored(if not the same)Eliminates the need to close cursors in fetch40%faster at failover by repositioning cursorsVastly increases TAC coverageOracle CloudWorld Copyright 2024,Oracle and/or its affiliates13Resumable Cursors SQL SELECT order_id FROM or
20、ders WHERE order_date sysdate 7 order by order_id;while(!end_of_fetch)FETCH order_id INTO:order_num;commit;Ensure Replay uses the same session stateFailover_Restore with Database TemplatesDatabase Template=set of session statesmaintained by the databaseEliminates the need for custom callbacksSession
21、 state is automatically assigned forFAILOVER_RESTORE=LEVEL2/AUTOSame network security as advised for database links Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates14$sqlplus/as syskmSQL ALTER DATABASE DICTIONARY ENCRYPT CREDENTIALS CONTAINER=ALL;SQL select*from DICTIONARY_CREDENTIALS_E
22、NCRYPT;ENFORCEM-ENABLEDCustomizable Side Effects,Database Links,and MoreDatabase requests such as external calls can cause side effectsNot under transaction control of the database;E.g.UTL_HTTP,UTL_FILE,UTL_TCPCustomizing allows for choosing side-effects,database links and Autonomous Transactions to
23、 ReplaySet on a per-service level or use the PL/SQL API for finer controlAC default is allow“replay all”;TAC disallows“replay all”by default,Example:make database links replayable for service myserviceOracle CloudWorld Copyright 2024,Oracle and/or its affiliates15SQL execute dbms_app_cont_admin.set_
24、replay_rules(service_name=myservice,replayable=true,dbms_app_cont_admin.database_links);Consolidated Data SourceOracle CloudWorld Copyright 2024,Oracle and/or its affiliates16One package for everything set once and for allIncluded in ojdbcXX.jarOnly one Data Source needs to be included on client-sid
25、eDevelopers no longer need to switch Data Source to enable Application Continuity Client automatically enables Application Continuity based on server side service attribute settinghttps:/ pds=oracle.ucp.jdbc.PoolDataSourceFactory.getPoolDataSource();pds.setConnectionFactoryClassName(oracle.jdbc.data
26、source.impl.OracleDataSource);Application Continuity can be enabled/disabled per-service with srvctlFor any subsequent connection to the service Enable PDB-admins to create an AC/TAC service and benefit from RESET_STATE,set_draining,etc.Starting with Oracle Database 23ai DBMS_APP_CONT_ADMIN can be u
27、sedAC/TAC self service in private clouds and rapid deploymentsEnable Application ContinuityOracle CloudWorld Copyright 2024,Oracle and/or its affiliates17dbms_app_cont_admin.enable_ac(,LEVEL1,600);dbms_app_cont_admin.enable_tac(,AUTO,600,AUTO);18Oracle CloudWorld Copyright 2024,Oracle and/or its aff
28、iliatesProven in many configurations Springboot&Oracle Universal Connection Pool(UCP)https:/ Tomcat&Oracle Universal Connection Pool(UCP)https:/ JBoss EAP&native Request BoundariesConfiguration in downloadable hidden slidesJboss EAP:Management Console or CLI to update Datasource definitionAC/TAC Pla
29、nned DowntimeOracle CloudWorld Copyright 2024,Oracle and/or its affiliates19oracleoracle.jdbc.datasource.impl.OracleDataSource jdbc:oracle:thin:.dbuserdbpasswd true false .Jboss EAP:Management Console or CLI to update Datasource definitionAC/TAC Planned DowntimeOracle CloudWorld Copyright 2024,Oracl
30、e and/or its affiliates20 jdbc:oracle:thin:CURRENT_URL?TNS_ADMIN=/absolute_path/ojdbc.propertiesIn/absolute_path/ojdbc.properties,include the connection properties and values:prop1=value1 prop2=value2 .Proven in Many Configurations Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates21Progr
31、ammatically with PythonCall init_oracle_client()to enable Thick ModeUse pooled connection(with DRCP)https:/ oracledboracledb.init_oracle_client(lib_dir=“/absolute_path/instantclient_23_4”)pool=oracledb.create_pool(user=cj,password=pw,dsn=cs,min=pool_min,max=pool_max,increment=pool_inc,session_callba
32、ck=init_session)Detailed StatisticsSee whats going on at any step of the wayOracle CloudWorld Copyright 2024,Oracle and/or its affiliates22Connection Pool correctly configured?Begin/End RequestApplication Continuity enabled?Protected calls=0Small number=Low protectionHigh number=Good Protection Run
33、ACCHK for further analysisPre-analysis if Application Continuity is the right solution for your applicationAWR report for Application ContinuityOracle CloudWorld Copyright 2024,Oracle and/or its affiliates23Instance Activity Statscumulative DB time in requests577,879,3451,554,086.6412,505.77cumulati
34、ve DB time protected in requests491,764,0771,322,497.4810,642.17cumulative begin requests415,5081,117.428.99cumulative end requests415,5331,117.498.99cumulative time in requests505,808,3711,360,266.7010,946.10cumulative user calls in requests518,0671,393.2311.21cumulative user calls protected by App
35、lication Continuity518,0671,393.2311.21Determine the protection provided with ACCHKInstance&session statisticsMore advice:Replay statisticsPLSQL session stateSide effectsExternal and CDB-level reportsReport by Time IntervalPDBADMIN roleBackported to19RU19canned sql using history Table based Copyrigh
36、t 2024,Oracle and/or its affiliates24.DBMS_APP_CONT_ADMIN filters data to be collected based onServiceModuleProgram(Source)Machine nameACCHK_SET_FILTER,ACCHK_SHOW_FILTERS,ACCHK_CLEAR_FILTERGather onlyrelevant data for a focusedanalysisGranular filtering of ACCHKOracle CloudWorld Copyright 2024,Oracl
37、e and/or its affiliates25SQL EXEC dbms_app_cont_admin.acchk_set_filter(DBMS_APP_CONT_ADMIN.SERVICE_FILTER,ORACLE.Service1);SQL dbms_app_cont_admin.acchk_set(true,300);Built on Oracle Maximum Availability ArchitectureOracle CloudWorld Copyright 2024,Oracle and/or its affiliates26Documented Applicatio
38、n High Availability LevelsCopyright 2024,Oracle and/or its affiliates27https:/ application impact throughout the entire database upgrade process(Transparent)Application Continuity Hides database downtime from your usersDBMS_ROLLING(available with Active Data Guard)Enables the automated rolling appli
39、cation of version-changing upgrades and patch setsTogether They hide the final switchover needed at the end of the fully automated DBMS_ROLLING process.23ai to 23ai available now/19c to 23ai planned for future 19c RURedo ApplySQL ApplyDatabase A19cPRODSTBYPRODDatabase BPRODSTBYSTBY23ai SwitchoverTra
40、nsparently with Application ContinuityOracle CloudWorld Copyright 2024,Oracle and/or its affiliates28Application Continuity DBMS_ROLLING SupportHigher Availability and less defensive programmingCopyright 2024,Oracle and/or its affiliates29Defensive Codeand Error HandlingAvailability RecommendationsH
41、A TNSFANUCPTACROLE-BASEDSERVICESDRAININGLEVEL 1LEVEL 2ACLEVEL 3LEVEL 1Basic HALEVEL 2Prepare for Planned MaintenanceLEVEL 3Mask Outages$srvctl add service-d -s -pdb -preferred -available -notification TRUE-commit_outcome TRUE -failovertype AUTO-replay_init_time 600-failover_restore AUTO-drain_timeou
42、t 300-stopoption IMMEDIATE -role PRIMARY/PHYSICAL STANDBY-resetstate(option)Level 1:ServicesOracle CloudWorld Copyright 2024,Oracle and/or its affiliates30User-defined database services for location independenceLoad balancingApplication ContinuityWorkload drainingFor role-based services when using D
43、ata GuardFAN/ONS for OCILevel 1:Recommended Connection StringOracle CloudWorld Copyright 2024,Oracle and/or its affiliates31Standard connection string works with Oracle Single Instance,Oracle RAC,and Data GuardSSPDB=(DESCRIPTION=(CONNECT_TIMEOUT=90)(RETRY_COUNT=50)(RETRY_DELAY=250ms)(TRANSPORT_CONNE
44、CT_TIMEOUT=1000ms)(FAILOVER=ON)(LOAD_BALANCE=OFF)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=primary-scan)(PORT=1521)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=standby-scan)(PORT=1521)(CONNECT_DATA=(SERVICE_NAME=)Level 1:Fast Application Notification(FAN)Enables Fast
45、 Connection FailoverServer automatically reports Oracle Notification Server(ONS)configuration to client at authenticate Client automatically subscribes to ONS to receive FAN EventsRequirement:Recommended Connection String being usedDeploy the following JDBC JAR filesojdbcXX.jar,ons.jar,simplefan.jar
46、Port 6200 needs to be open on server sideExample FAN event sent via ONS to client:Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates32FAN event type:service_memberProperties:version=1.0 service=OLTP database=SSDB instance=SSDB host=bumucsvm1 status=upLevel 2 Onwards:Drain Connect Failover
47、Copyright 2024,Oracle and/or its affiliates33Timenode 1node 2drain timeout3)terminate in-flight requests2)connect to node 21)drain node 14)replay in-flight requests with Application Continuitydraining and planned failover Monitor Drain timeoutOracle CloudWorld Copyright 2024,Oracle and/or its affili
48、ates34Make informed decisions about tuning the drain timeoutDuration of requests is often unknown to DBAs and developersPlanned maintenanceGive applications sufficient time to drainSmall enough to proceed with maintenancev$service_drain_timeout_adviceLAST_DRAIN_TIMEOUTNumber of sessions MARKED_TO_DR
49、AINNumber of sessions DRAINEDService Time Interval Frequency(in 10s)-tac=1 sec*tac=5 sec*ac=5 sec*ac=30 sec*ac =60 sec*Deutsche BankIdentifierDeutsche BankIdentifier#PositiveImpactHarsh GuptaHead of Database EngineeringLas Vegas,Sept 2024Oracle Cloud World Deutsche BankIdentifier36Harsh Gupta,Oracle
50、 Cloud World,2024AC/TAC Deutsche Bank(DB)Goal DB Zero Downtime Planned and Unplanned MaintenanceProgram DB Analyze application design Categorize them as Easy,Medium&Complex Decision Matrix POC and Sign Off Prepare Blue-Print to achieve AC-TAC Self ServiceChallenge DB Every application is unique in i
51、tself How to analyze 2000+application How to scale project implementationOracle DB AC-TAC product team work closely with us Client business needs are well understoodDeutsche BankIdentifier37Harsh Gupta,Oracle Cloud World,2024How do we executeInventoryManagementTesting ScenarioDeutsche BankIdentifierDeutsche BankIdentifierWork Smart Enjoy HardDeutsche BankIdentifierDeutsche BankIdentifierHarsh GuptaOracle Certified Master,Oracle ACE ProThank YouDeutsche BankIdentifierFor questions,please,contact:Thank you!Markus.M Sebastian.S Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates40