[go: up one dir, main page]

CN111475112B - Device for improving performance of Oracle database and data reading and writing method - Google Patents

Device for improving performance of Oracle database and data reading and writing method Download PDF

Info

Publication number
CN111475112B
CN111475112B CN202010250410.7A CN202010250410A CN111475112B CN 111475112 B CN111475112 B CN 111475112B CN 202010250410 A CN202010250410 A CN 202010250410A CN 111475112 B CN111475112 B CN 111475112B
Authority
CN
China
Prior art keywords
data
hdd
disk
nonvolatile memory
block device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010250410.7A
Other languages
Chinese (zh)
Other versions
CN111475112A (en
Inventor
张一可
段利宁
张远斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010250410.7A priority Critical patent/CN111475112B/en
Publication of CN111475112A publication Critical patent/CN111475112A/en
Application granted granted Critical
Publication of CN111475112B publication Critical patent/CN111475112B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/217Database tuning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0688Non-volatile semiconductor memory arrays
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a device for improving the performance of an Oracle database and a data reading and writing method, wherein the Oracle database is configured on a server, and a CPU (central processing unit) of the server is connected with at least one HDD (hard disk drive) disk and at least one nonvolatile memory; the HDD disks correspond to the nonvolatile memories one by one, and the quantity of the HDD disks is the same; an HDD disk and a nonvolatile memory are configured as a block device; a memory block device is created on the nonvolatile memory, and the memory block device is configured as a cache device corresponding to the HDD disk. When writing data, oracle data is firstly written on the nonvolatile memory and then written back on the HDD disk in a writeback mode; when reading data, firstly detecting whether the data is on the nonvolatile memory, if so, directly reading the data from the nonvolatile memory, otherwise, continuously reading the data from the HDD magnetic disk. The invention can effectively improve the read-write capability of the database and reduce the cost of the server.

Description

一种提升Oracle数据库性能的装置及数据读写方法A device and data reading and writing method for improving Oracle database performance

技术领域technical field

本发明涉及Oracle数据库领域,具体涉及一种提升Oracle数据库性能的装置及数据库数据读写方法。The invention relates to the field of Oracle databases, in particular to a device for improving the performance of an Oracle database and a method for reading and writing database data.

背景技术Background technique

Oracle数据库(又名OracleRDBMS,是甲骨文公司的一款关系数据库管理系统)系统因其可移植性好、使用方便、功能强,适用于各类大、中、小、微机环境,成为目前流行的关系数据库管理系统。对于OLTP类型业务系统,一个系统的吞度量(承压能力)与request对CPU的消耗、外部接口、IO等等紧密关联。单个reqeust 对CPU消耗越高,外部系统接口、IO响应速度越慢,系统吞吐能力越低,反之越高。随着CPU性能提升,Oracle数据库最大的性能瓶颈在于IO性能。仅使用HDD磁盘会严重的降低数据库的性能,为了解决该问题,业界普遍采用全闪磁盘(SSD磁盘阵列)阵列提升Oracle数据库存储IO性能,随着业务的数据量越来越大,被迫选择更大容量的SASSSD或NVMeSSD,随之又产生高昂的成本问题及性能过剩问题。Oracle database (also known as OracleRDBMS, is a relational database management system of Oracle Corporation) system is suitable for all kinds of large, medium, small and microcomputer environments due to its good portability, convenient use, and powerful functions, and has become a popular relational database management system. database management system. For OLTP-type business systems, the throughput (pressure-bearing capacity) of a system is closely related to the CPU consumption of requests, external interfaces, IO, and so on. The higher the CPU consumption of a single reqeust, the slower the external system interface and IO response speed, the lower the system throughput, and vice versa. With the improvement of CPU performance, the biggest performance bottleneck of Oracle database is IO performance. Only using HDD disks will seriously reduce the performance of the database. In order to solve this problem, the industry generally uses all-flash disk (SSD disk array) arrays to improve the Oracle database storage IO performance. As the amount of business data increases, it is forced to choose Larger-capacity SASSSD or NVMeSSD, followed by high cost and excess performance.

发明内容Contents of the invention

为解决上述问题,本发明提供一种提升Oracle数据库性能的装置及数据读写方法,基于非易失性内存,构建非易失性内存和HDD磁盘的多个块设备,提升Oracle数据库IO性能。In order to solve the above problems, the present invention provides a device and a data reading and writing method for improving the performance of an Oracle database. Based on the non-volatile memory, a plurality of block devices of the non-volatile memory and HDD disks are constructed to improve the IO performance of the Oracle database.

本发明的技术方案是:一种提升Oracle数据库性能的装置,Oracle数据库配置于服务器,The technical solution of the present invention is: a device for improving the performance of the Oracle database, the Oracle database is configured on the server,

服务器的CPU上连接至少一个HDD磁盘和至少一个非易失性内存;HDD磁盘与非易失性内存一一对应,数量相同;At least one HDD disk and at least one non-volatile memory are connected to the CPU of the server; HDD disks correspond to the non-volatile memory one by one, and the number is the same;

一个HDD磁盘和一个非易失性内存配置成为一个块设备;An HDD disk and a non-volatile memory are configured as a block device;

非易失性内存上创建有内存块设备,该内存块设备被配置为对应HDD磁盘的缓存设备。A memory block device is created on the non-volatile memory, and the memory block device is configured as a cache device corresponding to the HDD disk.

进一步地,服务器上配置有块设备配置模块,将非易失性内存上的内存块设备配置为缓存设备,将HDD磁盘设置为后端设备,从而将各个HDD磁盘及其对应非易失性内存配置成为各个块设备。Further, a block device configuration module is configured on the server, and the memory block device on the non-volatile memory is configured as a cache device, and the HDD disk is set as a back-end device, so that each HDD disk and its corresponding non-volatile memory Configured as individual block devices.

进一步地,块设备配置模块为bcache缓存管理模块。Further, the block device configuration module is a bcache cache management module.

进一步地,服务器上配置有内存块设备创建模块,将非易失性内存设置为region模式,将非易失性内存的region创建为内存块设备。Further, a memory block device creation module is configured on the server, the non-volatile memory is set to a region mode, and the region of the non-volatile memory is created as a memory block device.

进一步地,内存块设备创建模块包括ipmctl工具和ndctl工具;Further, the memory block device creation module includes ipmctl tool and ndctl tool;

ipmctl工具将非易失性内存设置为region模式;ndctl工具将非易失性内存的region创建为内存块设备。The ipmctl tool sets the non-volatile memory to the region mode; the ndctl tool creates the region of the non-volatile memory as a memory block device.

进一步地,服务器上配置有Oracle ASM管理软件,将所有块设备组成一组磁盘组,进行数据条带化存储。Furthermore, Oracle ASM management software is configured on the server, and all block devices are formed into a set of disk groups for data stripe storage.

进一步地,服务器上设置至少一对CPU,每对中的两颗CPU所连接HDD磁盘数量相同;Oracle ASM管理软件将每对CPU下的两个磁盘组设置为故障转移组。Furthermore, at least one pair of CPUs is set on the server, and the two CPUs in each pair are connected to the same number of HDD disks; the Oracle ASM management software sets the two disk groups under each pair of CPUs as a failover group.

进一步地,CPU通过SAS卡连接HDD磁盘,其中SAS卡连接到CPU的PCIe插槽上。Further, the CPU is connected to the HDD disk through the SAS card, wherein the SAS card is connected to the PCIe slot of the CPU.

本发明的技术方案还包括一种基于上述装置的数据读写方法,包括以下步骤:The technical solution of the present invention also includes a data reading and writing method based on the above-mentioned device, comprising the following steps:

写数据时,Oracle数据首先写到非易失性内存上,再以writeback方式回写到HDD磁盘上;When writing data, Oracle data is first written to the non-volatile memory, and then written back to the HDD disk in writeback mode;

将Oracle热点数据持久缓存在非易失性内存上;Persistently cache Oracle hotspot data in non-volatile memory;

读数据时,首先检测数据是否在非易失性内存上,若在,则直接从非易失性内存上读取数据,否则继续从HDD磁盘上读取数据。When reading data, first check whether the data is in the non-volatile memory, if so, read the data directly from the non-volatile memory, otherwise continue to read the data from the HDD disk.

进一步地,还包括步骤:Further, steps are also included:

设置读请求时间阈值和写请求时间阈值;Set the read request time threshold and write request time threshold;

写数据时,当IO的时间超过写请求时间阈值时,绕过非易失性内存,直接写入HDD磁盘;When writing data, when the IO time exceeds the write request time threshold, bypass the non-volatile memory and directly write to the HDD disk;

读数据时,当IO的时间超过读请求时间阈值时,绕过非易失性内存,直接读取HDD磁盘。When reading data, when the IO time exceeds the read request time threshold, the non-volatile memory is bypassed and the HDD disk is read directly.

本发明提供的提升Oracle数据库性能的装置及数据读写方法,在处理器下配置数量相同的非易失性内存和HDD磁盘,构建成为非易失性内存和HDD磁盘的多个块设备,写数据时Oracle数据首先写到非易失性内存上,再以writeback方式回写到HDD磁盘上,读数据时首先检测数据是否在非易失性内存上,若在,则直接从非易失性内存上读取数据,否则继续从HDD磁盘上读取数据,有效提升数据库的读写能力。另外,本发明HDD不需要通过RAID磁盘阵列卡组成RAID阵列,只需要单块盘使用,减少了RAID磁盘阵列校验带来的性能损耗;非易失性内存条和HDD磁盘故障时不影响系统正常运行;非易失性内存和HDD磁盘同处于一颗处理器下,数据的处理无需跨CPU;对于任何Oracle数据库一体机或者Oracle数据库均可使用该装置;且相比采用大容量的全闪磁盘阵列采大大降低了服务器成本。The device and data reading and writing method for improving the performance of the Oracle database provided by the present invention are configured with the same number of non-volatile memory and HDD disks under the processor, and are constructed as multiple block devices of non-volatile memory and HDD disks. When writing data, Oracle data is first written to the non-volatile memory, and then written back to the HDD disk in writeback mode. When reading data, first check whether the data is in the non-volatile memory. Read data from the memory, otherwise continue to read data from the HDD disk, effectively improving the read and write capabilities of the database. In addition, the HDD of the present invention does not need to form a RAID array through a RAID disk array card, and only needs a single disk to be used, which reduces the performance loss caused by the RAID disk array verification; the failure of the non-volatile memory stick and the HDD disk does not affect the system Normal operation; the non-volatile memory and the HDD disk are under the same processor, and the data processing does not need to cross the CPU; this device can be used for any Oracle database all-in-one machine or Oracle database; and compared with the use of large-capacity all-flash Disk arrays greatly reduce server costs.

附图说明Description of drawings

图1是本发明实施例一结构示意图。Fig. 1 is a schematic structural diagram of Embodiment 1 of the present invention.

图2是本发明实施例一具体实现方式原理架构图。FIG. 2 is a schematic architecture diagram of a specific implementation manner of Embodiment 1 of the present invention.

图3是本发明实施例二方法流程示意图。Fig. 3 is a schematic flow chart of the method in Embodiment 2 of the present invention.

具体实施方式Detailed ways

下面结合附图并通过具体实施例对本发明进行详细阐述,以下实施例是对本发明的解释,而本发明并不局限于以下实施方式。The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are explanations of the present invention, but the present invention is not limited to the following embodiments.

如图1所示,本实施例提供一种提升Oracle数据库性能的装置,Oracle数据库配置于服务器上,为实现该装置,服务器的CPU1上连接至少一个HDD磁盘2和至少一个非易失性内存3;HDD磁盘2与非易失性内存3一一对应,数量相同。一个HDD磁盘2和一个非易失性内存3配置成为一个块设备5,其中非易失性内存3上创建有内存块设备4,该内存块设备4被配置为对应HDD磁盘2的缓存设备。需要说明的是,CPU1通过SAS卡连接HDD磁盘2,其中SAS卡连接到CPU1的PCIe插槽上。As shown in Figure 1, the present embodiment provides a device for improving the performance of the Oracle database, the Oracle database is configured on the server, in order to realize the device, at least one HDD disk 2 and at least one non-volatile memory 3 are connected to the CPU1 of the server ; The HDD disk 2 corresponds to the non-volatile memory 3 one by one, and the numbers are the same. A HDD disk 2 and a non-volatile memory 3 are configured as a block device 5 , wherein a memory block device 4 is created on the non-volatile memory 3 , and the memory block device 4 is configured as a cache device corresponding to the HDD disk 2 . It should be noted that CPU1 is connected to HDD disk 2 through a SAS card, wherein the SAS card is connected to the PCIe slot of CPU1.

本实施例中,服务器上配置有块设备5配置模块,将非易失性内存3上的内存块设备4配置为缓存设备,将HDD磁盘设置为后端设备,从而将各个HDD磁盘及其对应非易失性内存配置成为各个块设备5。具体的,块设备5配置模块为bcache(系统内核)缓存管理模块。In this embodiment, the block device 5 configuration module is configured on the server, the memory block device 4 on the non-volatile memory 3 is configured as a cache device, and the HDD disk is set as a back-end device, so that each HDD disk and its corresponding The non-volatile memory is configured as individual block devices 5 . Specifically, the block device 5 configuration module is a bcache (system kernel) cache management module.

服务器上配置有内存块设备4创建模块,将非易失性内存3设置为region(区域)模式,将非易失性内存3的region创建为内存块设备4。具体地,内存块设备4创建模块包括ipmctl工具(Intel持久内存控制工具)和ndctl工具(non-volatile memory devices非易失性内存控制工具);ipmctl工具将非易失性内存3设置为region模式;ndctl工具将非易失性内存3的region创建为内存块设备4。A memory block device 4 creation module is configured on the server, the non-volatile memory 3 is set to a region (region) mode, and the region of the non-volatile memory 3 is created as a memory block device 4. Specifically, the memory block device 4 creation module includes the ipmctl tool (Intel persistent memory control tool) and the ndctl tool (non-volatile memory devices non-volatile memory control tool); the ipmctl tool sets the non-volatile memory 3 to the region mode ; The ndctl tool creates a region of non-volatile memory 3 as a memory block device 4.

如图2所示服务器为例,服务器有两颗CPU,在服务器的每颗CPU下连接一块SAS卡,每个SAS卡上连接1-6块HDD磁盘2,每颗CPU下配置与HDD磁盘2数量相等的非易失性内存3设备。The server shown in Figure 2 is an example. The server has two CPUs. A SAS card is connected to each CPU of the server. Each SAS card is connected to 1-6 HDD disks 2. Each CPU is configured with HDD disks 2. An equal amount of non-volatile memory 3 devices.

在系统下安装ipmctl和ndctl工具将每个非易失性内存3设备配置为内存块设备4(pmem),如果非易失性内存设备数为12个,那么在系统下创建名为pmem0、pmem1…pmem11的内存块设备4。Install the ipmctl and ndctl tools under the system to configure each non-volatile memory 3 device as a memory block device 4 (pmem). If the number of non-volatile memory devices is 12, create a system named pmem0 and pmem1 under the system ... memory block device 4 for pmem11.

创建步骤:Create steps:

使用ipmctl将服务器的每个非易失性内存3的类型设置为每个非易失性内存3为一个region模式,如果有12个非易失性内存则对应会生成region0到region11:ipmctlcreate –goal PersistentMemoryType=AppDirectNotInterleavedUse ipmctl to set the type of each non-volatile memory 3 of the server to each non-volatile memory 3 as a region mode. If there are 12 non-volatile memories, region0 to region11 will be generated correspondingly: ipmctlcreate –goal PersistentMemoryType=AppDirectNotInterleaved

使用ndctl工具将非易失内存的region创建为pmem设备:Use the ndctl tool to create a region of non-volatile memory as a pmem device:

ndctl create-namespace -region=region0ndctl create-namespace -region=region0

在系统下安装激活内核bcache缓存管理模块,通过bcache模块的管理命令,将每1个内存块设备4设置为前端缓存(caching)设备,每1个HDD磁盘阵列设置为后端(backing)设备,最终生成一个bcache0、bcache1、bcache2、bcache3等块设备5。Install and activate the kernel bcache cache management module under the system. Through the management command of the bcache module, set each memory block device 4 as a front-end cache (caching) device, and each HDD disk array as a back-end (backing) device. Finally, block devices 5 such as bcache0, bcache1, bcache2, and bcache3 are generated.

假设每个CPU1下配置6个HDD磁盘2和6个非易失性内存3,那么需要在CPU_0下创建名为bcache0~6的块(bcache)设备5,在CPU_1下创建名为bcache7~12的块(bcache)设备5。Assuming that each CPU1 is configured with 6 HDD disks 2 and 6 non-volatile memory 3, then it is necessary to create a block (bcache) device 5 named bcache0~6 under CPU_0, and create a block (bcache) device 5 named bcache7~12 under CPU_1 Block (bcache) device5.

命令如下:The command is as follows:

make-bcache --cache_replacement_policy=lru -C /dev/pmem0 -B /dev/sdbmake-bcache --cache_replacement_policy=lru -C /dev/pmem0 -B /dev/sdb

其中,--cache_replacement_policy为缓存算法,lru为最近最久未使用算法,也即是在非易失性内存3上缓存热点数据。Among them, --cache_replacement_policy is the cache algorithm, and lru is the algorithm that has not been used for the longest time, that is, the hot data is cached on the non-volatile memory 3.

-C参数指定非易失性内存3设备为caching设备,The -C parameter specifies the non-volatile memory 3 device as a cache device,

-B参数指定HDD磁盘2为后端存储设备。The -B parameter specifies HDD disk 2 as the back-end storage device.

本实施例中,服务器上配置有Oracle ASM(Automatic Storage Management自动存储管理)管理软件,将所有块设备5组成一组磁盘组,进行数据条带化存储。将Oracle数据均匀分布到生成的多个块设备5上。In this embodiment, Oracle ASM (Automatic Storage Management) management software is configured on the server, and all block devices 5 are formed into a set of disk groups for data striped storage. Evenly distribute Oracle data to multiple generated block devices5.

同时,本实施例还采用ASM多副本模式解决非易失性内存3和HDD磁盘2容错问题。具体地,服务器上设置至少一对CPU1,每对中的两颗CPU所连接HDD磁盘2数量相同。OracleASM管理软件将每对CPU下的两个磁盘组设置为故障转移组。At the same time, this embodiment also uses the ASM multi-copy mode to solve the problem of fault tolerance of the non-volatile memory 3 and the HDD disk 2 . Specifically, at least one pair of CPU 1 is set on the server, and the two CPUs in each pair are connected to the same number of HDD disks 2 . The OracleASM management software sets the two disk groups under each pair of CPUs as a failover group.

以图2所示服务器连接两个CPU1为例,每颗CPU1下对应的一块HDD磁盘2和一个非易失性内存3组成1块设备5,通过OracleASM管理工具将每颗CPU1下的所有块设备5组成一组磁盘组,冗余类型为双副本。假设磁盘组名为+DATA。磁盘组+DATA的双副本分别位于不同CPU一侧,即CPU_0和CPU_1一侧的HDD互为镜像组。也即是2个磁盘组互为镜像关系,CPU_1下的磁盘组设置为CPU_0下磁盘组的故障转移组,保证HDD磁盘2和非易失性内存3缓存层故障不影响数据层设备的数据。Take the server connected to two CPUs as shown in Figure 2 as an example. A corresponding HDD disk 2 and a non-volatile memory 3 under each CPU1 form a piece of equipment 5. Through the OracleASM management tool, all the equipment under each CPU1 5 form a set of disk groups, and the redundancy type is double copy. Assume the disk group is named +DATA. The double copies of the disk group + DATA are located on different CPU sides, that is, the HDDs on the CPU_0 and CPU_1 sides are mirror groups of each other. That is, the two disk groups are mirror images of each other, and the disk group under CPU_1 is set as the failover group of the disk group under CPU_0 to ensure that failures of HDD disk 2 and non-volatile memory 3 at the cache layer do not affect the data of the data layer device.

实施例二Embodiment two

如图3所示,本实施例提供一种基于实施例一的数据读写方法,包括以下步骤:As shown in Figure 3, this embodiment provides a method for reading and writing data based on Embodiment 1, including the following steps:

写数据时,Oracle数据首先写到非易失性内存3上,再以writeback方式回写到HDD磁盘2上;When writing data, Oracle data is first written to non-volatile memory 3, and then written back to HDD disk 2 in writeback mode;

将Oracle热点数据持久缓存在非易失性内存3上;Persistently cache Oracle hotspot data on non-volatile memory 3;

读数据时,首先检测数据是否在非易失性内存3上,若在,则直接从非易失性内存3上读取数据,否则继续从HDD磁盘2上读取数据。When reading data, first check whether the data is on the non-volatile memory 3, if yes, then directly read the data from the non-volatile memory 3, otherwise continue to read data from the HDD disk 2.

进一步,可设置读请求时间阈值和写请求时间阈值,写数据时,当IO的时间超过写请求时间阈值时,绕过非易失性内存3,直接写入HDD磁盘2;读数据时,当IO的时间超过读请求时间阈值时,绕过非易失性内存3,直接读取HDD磁盘2。保证所有的离散读和写都会经过非易失性内存3,提高数据块在非易失性内存3上的命中率。Further, the read request time threshold and the write request time threshold can be set. When writing data, when the IO time exceeds the write request time threshold, the non-volatile memory 3 is bypassed and the HDD disk 2 is directly written; when the data is read, when When the IO time exceeds the read request time threshold, the non-volatile memory 3 is bypassed and the HDD disk 2 is read directly. Ensure that all discrete reads and writes will pass through the non-volatile memory 3, and improve the hit rate of data blocks on the non-volatile memory 3.

具体实施例,该方法基于bcache内核模块参数实现,具体可调整以下参数:In a specific embodiment, the method is realized based on the parameters of the bcache kernel module, and the following parameters can be specifically adjusted:

设置缓存策略为writeback回写策略,也就是数据流先经过非易失性内存3,非易失性内存3上的数据异步写入到HDD磁盘2;Set the cache strategy to the writeback strategy, that is, the data flow first passes through the non-volatile memory 3, and the data on the non-volatile memory 3 is asynchronously written to the HDD disk 2;

设置顺序IO缓存策略参数sequential_cutoff=0,意味着所有顺序数据块都要经过非易失性内存3;Set the sequential IO cache policy parameter sequential_cutoff=0, which means that all sequential data blocks must pass through non-volatile memory 3;

调整缓存写回比例参数 writeback_percent,设置在非易失性内存3上保留热点数据的比例,根据需要可设置最大在非易失性内存3上保留40%的热点数据;Adjust the cache writeback ratio parameter writeback_percent, set the ratio of hot data reserved on non-volatile memory 3, and set a maximum of 40% of hot data reserved on non-volatile memory 3 according to needs;

设置 congested_read_threshold_us和congested_write_threshold_us参数,默认情况下当读请求阈值2ms,写请求阈值为20ms,如果IO的时间超过阈值,则绕过非易失性内存3缓存设备,从而不会导致数据cachemissing问题,保证所有的离散读和写都会经过非易失性内存3,提高数据块在非易失性内存3上的命中率。Set the congested_read_threshold_us and congested_write_threshold_us parameters. By default, when the read request threshold is 2ms and the write request threshold is 20ms, if the IO time exceeds the threshold, the non-volatile memory 3 cache device will be bypassed, so as not to cause data cachemissing problems, ensuring all All discrete reads and writes will pass through the non-volatile memory 3, improving the hit rate of data blocks on the non-volatile memory 3.

以上公开的仅为本发明的优选实施方式,但本发明并非局限于此,任何本领域的技术人员能思之的没有创造性的变化,以及在不脱离本发明原理前提下所作的若干改进和润饰,都应落在本发明的保护范围内。The above disclosure is only a preferred embodiment of the present invention, but the present invention is not limited thereto, any non-creative changes that those skilled in the art can think of, and some improvements and modifications made without departing from the principle of the present invention , should fall within the protection scope of the present invention.

Claims (7)

1. A device for improving the performance of Oracle database, the Oracle database is configured on the server, characterized in that,
the CPU of the server is connected with at least one HDD disk and at least one nonvolatile memory; the HDD disks correspond to the nonvolatile memories one by one, and the quantity of the HDD disks is the same;
an HDD disk and a nonvolatile memory are configured as a block device;
a memory block device is established on the nonvolatile memory, and the memory block device is configured as a cache device corresponding to the HDD;
the server is provided with Oracle ASM management software, all the block devices under each CPU form a group of disk groups, and data striping storage is carried out;
the server is provided with at least one pair of CPUs, and the number of the HDD disks connected with the two CPUs in each pair is the same; the two disk groups under each pair of CPUs are in a mirror image relationship with each other, and the two disk groups under each pair of CPUs are set as a failover group by the Oracle ASM management software;
the CPU is connected with the HDD magnetic disk through the SAS card, wherein the SAS card is connected to the PCIe slot of the CPU.
2. The apparatus according to claim 1, wherein the server is configured with a block device configuration module, the memory block device on the nonvolatile memory is configured as a cache device, and the HDD disk is set as a backend device, so that each HDD disk and the corresponding nonvolatile memory thereof are configured as each block device.
3. The apparatus for improving performance of an Oracle database according to claim 2, wherein the block device configuration module is a bcache cache management module.
4. The apparatus according to claim 3, wherein the server is configured with a memory block device creation module, and sets the nonvolatile memory to a region mode, and creates a region of the nonvolatile memory as a memory block device.
5. The apparatus for improving performance of an Oracle database according to claim 4, wherein the memory block device creation module includes an ipmctl tool and an ndctl tool;
the ipmctl tool sets the nonvolatile memory to be in a region mode; the ndctl tool creates a region of non-volatile memory as a memory block device.
6. A data reading and writing method based on the device of any one of claims 1-5, characterized by comprising the following steps:
when writing data, oracle data is firstly written on the nonvolatile memory and then written back on the HDD disk in a writeback mode;
caching Oracle hotspot data in a nonvolatile memory persistently;
when reading data, firstly detecting whether the data is on the nonvolatile memory, if so, directly reading the data from the nonvolatile memory, otherwise, continuously reading the data from the HDD magnetic disk.
7. A method for reading and writing data according to claim 6, further comprising the steps of:
setting a read request time threshold and a write request time threshold;
during data writing, when the IO time exceeds a write request time threshold, bypassing the nonvolatile memory and directly writing the data into the HDD disk;
when reading data, when the IO time exceeds the read request time threshold, bypassing the nonvolatile memory and directly reading the HDD disk.
CN202010250410.7A 2020-04-01 2020-04-01 Device for improving performance of Oracle database and data reading and writing method Active CN111475112B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010250410.7A CN111475112B (en) 2020-04-01 2020-04-01 Device for improving performance of Oracle database and data reading and writing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010250410.7A CN111475112B (en) 2020-04-01 2020-04-01 Device for improving performance of Oracle database and data reading and writing method

Publications (2)

Publication Number Publication Date
CN111475112A CN111475112A (en) 2020-07-31
CN111475112B true CN111475112B (en) 2023-03-14

Family

ID=71750396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010250410.7A Active CN111475112B (en) 2020-04-01 2020-04-01 Device for improving performance of Oracle database and data reading and writing method

Country Status (1)

Country Link
CN (1) CN111475112B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115933994B (en) * 2023-01-09 2023-07-14 苏州浪潮智能科技有限公司 Data processing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007870A (en) * 2019-04-12 2019-07-12 苏州浪潮智能科技有限公司 A kind of storage equipment write request processing method and relevant apparatus
CN110502188A (en) * 2019-08-01 2019-11-26 苏州浪潮智能科技有限公司 A kind of date storage method and device based on data base read-write performance

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007870A (en) * 2019-04-12 2019-07-12 苏州浪潮智能科技有限公司 A kind of storage equipment write request processing method and relevant apparatus
CN110502188A (en) * 2019-08-01 2019-11-26 苏州浪潮智能科技有限公司 A kind of date storage method and device based on data base read-write performance

Also Published As

Publication number Publication date
CN111475112A (en) 2020-07-31

Similar Documents

Publication Publication Date Title
US7975168B2 (en) Storage system executing parallel correction write
US10152254B1 (en) Distributing mapped raid disk extents when proactively copying from an EOL disk
US7730257B2 (en) Method and computer program product to increase I/O write performance in a redundant array
US5586291A (en) Disk controller with volatile and non-volatile cache memories
US9304901B2 (en) System and method for handling I/O write requests
US6058489A (en) On-line disk array reconfiguration
US8190815B2 (en) Storage subsystem and storage system including storage subsystem
CN114443346A (en) System and method for parity-based fault protection of storage devices
US6961818B1 (en) Method, system and computer program product for managing data in a mirrored cache using an access balancing technique
US20090077312A1 (en) Storage apparatus and data management method in the storage apparatus
US20080201392A1 (en) Storage system having plural flash memory drives and method for controlling data storage
US20100199039A1 (en) Systems and Methods for Optimizing Host Reads and Cache Destages in a Raid System
JP2013156977A (en) Elastic cache of redundant cache data
WO2021242317A1 (en) Zns parity swapping to dram
US10152242B1 (en) Host based hints
US20240427526A1 (en) Memory controller for managing raid information
CN110795279A (en) System and method for facilitating DRAM data cache dump and rack level battery backup
CN114168067A (en) NVMe simple copy command support using dummy virtual functions
CN111475112B (en) Device for improving performance of Oracle database and data reading and writing method
CN111459400B (en) Method and apparatus for pipeline-based access management in storage servers
TW202449615A (en) Devices and methods for cache operation in storage devices
WO2021216128A1 (en) Data parking for ssds with zones
JP2015052853A (en) Storage controller, storage control method, and program
KR20250075629A (en) CMB caching using hybrid SRAM/DRAM data path
Luo et al. CDB: Critical data backup design for consumer devices with high-density flash based hybrid storage

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after: China

Address before: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China