1 / 66

Oracle 数据库集群和分区 技术

Oracle 数据库集群和分区 技术. 讲座议题. 为什么要使用 Oracle RAC 数据库 RAC 的硬、软件体系架构 RAC 的工作原理和 Cache Fusion 均衡负载和高可用性 Transparent Application Failover. 为什么要使用 Oracle RAC 数据库 ?. 稳定的、24*7的高可靠性系统 均衡负载和强大的处理能力 灵活开放的扩展能力 随用随付、降低采购和维护成本. 采用集群数据库技术. Trans-Pacific Flight. This:. Or this:. Rock Concert.

mendezs
Download Presentation

Oracle 数据库集群和分区 技术

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Oracle数据库集群和分区技术

  2. 讲座议题 • 为什么要使用 Oracle RAC 数据库 • RAC 的硬、软件体系架构 • RAC 的工作原理和Cache Fusion • 均衡负载和高可用性 • Transparent Application Failover

  3. 为什么要使用Oracle RAC 数据库? • 稳定的、24*7的高可靠性系统 • 均衡负载和强大的处理能力 • 灵活开放的扩展能力 • 随用随付、降低采购和维护成本

  4. 采用集群数据库技术 • Trans-Pacific Flight This: Or this: • Rock Concert This: Or this:

  5. Computer B Computer A 操作系统级的HA主备机模式 • 高可用性: • 主机运行,备机等待 • 主机故障、备机接管 • 接管磁盘阵列控制 • IP地址自动漂移 • 重新在备机启动数据库 • 重新连接应用程序 • 实施简单 • 缺点: • 切换间存在停顿 • 备机空闲

  6. 提供24*7 的安全可靠性 • 透明的应用程序故障切换、消除单点故障 • 应用程序和用户连接在故障发生时,可以自动透明地连接到其它的服务器上 • 应用程序和查询不会中断,用户感觉不到故障的发生 • 安全认证信息可持续保留 Node A in a cluster fails, users are migrated • Computer • A • Computer • A • Computer • B • Computer • B

  7. “冷”故障接管的限制 • 冷接管速度慢 • 移动硬盘卷、mount 上逻辑卷、启动 Oracle 实例,打开数据文件 • 不能够预先连接到备份 Server 上 • 出现故障后,所有的会话都必须重新连接到数据库实例上 • 冷的数据库缓存 • 接管后数据库的缓存是“冷”的,减低数据库的性能 • 不能够很容易的扩展

  8. Oracle10g RAC 128节点的网格数据库

  9. 自动动态负载均衡实现可伸缩性 CPU Load • 数据库启动时,向监听进程注册 • 节点向监听进程报告 CPU 的使用情况 • 当建立连接时,监听进程选择最空闲的节点处理请求 • Node • Dispatchers • Listener CPU Load • Listener • Node • Dispatchers

  10. 灵活的可伸缩性和强大的处理能力

  11. 讲座议题 • 为什么要使用 Oracle RAC 数据库 • RAC 的硬、软件体系架构 • RAC 的工作原理和Cache Fusion • 均衡负载和高可用性 • Transparent Application Failover

  12. Oracle RAC集群数据库技术硬件结构 • Application Servers/ Network • Centralized Management Console Users • Low Latency Interconnect No Single Point Of Failure • High Speed Switch or Interconnect • ClusteredDatabase Instances Scalable & throughput Shared Cache • Hub or Switch Fabric • Storage Area Network • Drive and Exploit Industry Advances in Clustering • Mirrored Disk Subsystem

  13. Cluster 硬件结构 • 节点 ( Node ) • 内部连接 ( Interconnect ) • 共享磁盘 ( Shared disk )

  14. 自包容的服务器,单 CPU 或者多 CPU 系统 ( SMP/NUMA ) 一个集群需要两个或者更多的节点 每个节点支持一个 RAC Instance 每个节点可以支持不同类型的应用 每个节点不要求配置完全相同,但建议同配置 节点可以动态的添加和删除 节点 ( Nodes ) • Node

  15. 连接节点之间,节点间通讯的高速通道 可以使用标准的网络协议,如: TCP/IP 使用高速的连接协议 ( high speed interconnects ) 可以获得更好的性能 UDP VIA 厂商专有的,经过验证的协议 内部连接 ( Interconnect )

  16. 网络配置 Workstation Public LAN Public LAN Optional Optional NODE2 NODE3 NODE1 Cluster Interconnect Cluster Interconnect • 每个节点需三个IP地址 • 一个公共服务地址(提供客户访问) • 一个私有的内部地址 (仅内部使用) • 一个虚拟IP地址 (与公共服务地址同一网段)

  17. 共享磁盘上的共享的设备 传统上的 裸设备卷 ( UNIX ) 逻辑盘 ( Windows ) Oracle OCFS,ASM 集群文件系统 厂商专有的,经过验证的系统,如Veritas, GPFS 共享磁盘系统 ( Shared Disk ) 共享磁盘系统

  18. server 2 Oracle 9i RAC instance 2 DB cache clusterware operating system • Oracle9i RAC Architecture public network server 1 Server 3, 4, …. Oracle 9i RAC instance 1 cluster interconnect DB cache cache to cache clusterware operating System shared storage quorum redo log instance 1 … redo log instance 3 … /var/opt/oracle/srvConfig.loc srvcfg control files database files

  19. Oracle 10g RAC Architecture public network server 1 server 2 Server 3, 4, …. Oracle 10g RAC instance 1 Oracle 10g RAC Instance 2 cluster interconnect DB cache DB cache cache to cache CRS CRS operating System operating system shared storage /var/opt/oracle/ocr.loc /var/opt/oracle/ocr.loc redo log instance 1 … voting redo log instance 3 … ocr control files database files

  20. The Server Control Utility (SRVCTL) 管理整个 Cluster 环境 为其他管理工具提供对 RAC 的管理 基于 GSD 基础之上 Oracle RAC 系统管理工具 • Agent • Agent • SRVCTL • SRVCTL • GSD • GSD • Node 1 • Node 2

  21. 讲座议题 • 为什么要使用 Oracle RAC 数据库 • RAC 的硬、软件体系架构 • RAC 的工作原理和Cache Fusion • 均衡负载和高可用性 • Transparent Application Failover

  22. Scaleup and Speedup Original system • Hard-ware 100% of task Time Cluster system scaleup Cluster system speedup • Hard-ware • Hard-ware 50% of task up to 200%oftask Time Time up to 300%oftask • Hard-ware • Hard-ware 50% of task Time Time • Hard-ware Time

  23. Speedup and Scaleup for Different Types of Workloads • Workload • OLTP and Internet • DSS with parallel query • Batch (mixed) • Speedup • No • Yes • Possible • Scaleup • Yes • Yes • Yes

  24. Cache Fusion • Cache Fusion 提供 Oracle 集群数据库透明的可扩展性 • Cash Fusion 机制使 Oracle Instance 间可以直接传递数据块 • Cache Fusion 能够跟踪资源的位置和状态 • Global Cache Service 管理整个集群数据库的缓存资源 • Resource Master(Global Resource Directory) 分布在活动的 Instance 中,并可以动态的 remaster

  25. Cache FusionTM体系结构 • 在节点A对数据进行了修改并提交,在节点B对同一数据块进行读操作,可通过高速链路访问 • 多版本数据缓存支持节点A继续对数据块进行修改 Node A Node B • Select • 数据传输 Database buffers Database buffers • 两节点间的数据传输直接通过内部高速通道实现,大大减少了硬盘I/O Database

  26. Cache FusionTM提高了效率 Oracle8 • 100 msec • 100x • 20 msec Oracle9i • 1 msec • .01 msec • 本地内存的数据 • 远程节点的数据 • 硬盘上的数据

  27. ID • …20232629 • … • Grantedto Instance • …A,B,CA,BCB,C • … • ID • …21242730 • … • Grantedto Instance • …BA,CA,B,CB,C • … • ID • …22252831 • … • Grantedto Instance • …A,CCA,B,CB,C • … Global Resource DirectoryExample • Node 1 • Node 2 • Node 3 • Instance A • Instance B • Instance C • Global Resources • Global Resources • Global Resources

  28. 全局缓存服务资源模式 • 缓存资源采用以下三种模式之一: • NULL • Shared (S) • Exclusive (X)

  29. 缓存融合举例n

  30. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Cache Fusion Block Transfers:Example Overview

  31. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 1: Read with No Transfer Request toobtain a shared resource on C • N • 1

  32. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 1: Read with No Transfer • N–>S • 1 • 2 • The request is granted and the requesting instance is informed

  33. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 1: Read with No Transfer • S • 1 • 2 • Read request • 3

  34. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 1: Read with No Transfer Block imagedelivered • S • 4 • 1008 • 1 • 2 • 3

  35. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 2: Read to Write Transfer Request to obtain an exclusive resource on B • N • 1 • S • 1008

  36. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 2: Read to Write Transfer • N • 1 • S • 1008 • 2 Instruction to transfer the block to B for exclusive access

  37. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 2: Read to Write Transfer • N • 1008 • 1 Block and resource status (including C’s plan to close its resource) • S–>N • 3 • 1008 • 2

  38. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 2: Read to Write Transfer Resource assumptionand status message • 4 • N–>X • 1009 • 1 • N • 3 • 1008 • 2

  39. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 3: Write to Write Transfer • X • N • 1009 • 1 • Request to obtain resource inexclusive mode

  40. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 3: Write to Write Transfer • X • N • 1009 • 1 • 2 Instruction to transferexclusive resource to B

  41. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 3: Write to Write Transfer Exclusive-keep copy of buffer • X–>N • N • 3 • 1009 • 1009 • 1 • 2

  42. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 3: Write to Write Transfer • N–>X • N • 3 • 1013 • 1009 • 1 • 4 • 2

  43. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 4: Write to Read Transfer • X • N • 1013 • 1009 Request to obtainresource in shared mode • N • 1

  44. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 4: Write to Read Transfer • X • N • 1013 • 1009 • 2 Instruction to transfer shared resource to C • N • 1

  45. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 4: Write to Read Transfer Shared-keep copy of buffer • X–>S • N • 3 • 1013 • 1009 • 2 • N • 1 • 1013

  46. Instance A Instance B Instance C Resourcemaster • 1008 Instance D Example 4: Write to Read Transfer • S • N • 3 • 1013 • 1009 • 2 • N–>S • 1 • 1013 Resource assumptioninformation • 4

  47. 讲座议题 • 为什么要使用 Oracle RAC 数据库 • RAC 的硬、软件体系架构 • RAC 的工作原理和Cache Fusion • 均衡负载和高可用性 • Transparent Application Failover

  48. Load Balancing with Oracle Net Services Database • Instances • Listeners • Clients

  49. Client Load Balancing • sales.us.acme.com= • (DESCRIPTION= • (ADDRESS_LIST= • (LOAD_BALANCE=on) • (ADDRESS= • (PROTOCOL=tcp) • (HOST=sales1) • (PORT=1521)) • (ADDRESS= • (PROTOCOL=tcp) • (HOST=sales2) • (PORT=1521))) • (CONNECT_DATA= • (SERVICE_NAME= • sales.us.acme.com))) • Listeners • Clients

  50. Connection Load Balancing • Parameter file on node1 • local_listener = node1_lsnr • remote_listener = node2_lsnr • node1_lsnr= • (DESCRIPTION= • (ADDRESS_LIST= • (ADDRESS= • (PROTOCOL=tcp) • (HOST=node1) • (PORT=1580)) • ) • ) • node2_lsnr= • (DESCRIPTION= • (ADDRESS_LIST= • (ADDRESS= • (PROTOCOL=tcp) • (HOST=node2) • (PORT=1580)) • ) • )

More Related