WO2019019706A1 - Data table backup method based on oracle database, and server - Google Patents

Data table backup method based on oracle database, and server Download PDF

Info

Publication number
WO2019019706A1
WO2019019706A1 PCT/CN2018/083299 CN2018083299W WO2019019706A1 WO 2019019706 A1 WO2019019706 A1 WO 2019019706A1 CN 2018083299 W CN2018083299 W CN 2018083299W WO 2019019706 A1 WO2019019706 A1 WO 2019019706A1
Authority
WO
WIPO (PCT)
Prior art keywords
data table
data
backup
target data
target
Prior art date
Application number
PCT/CN2018/083299
Other languages
French (fr)
Chinese (zh)
Inventor
唐敏
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019019706A1 publication Critical patent/WO2019019706A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Definitions

  • the application belongs to the technical field of database processing, and particularly relates to a data table backup method and a server based on an Oracle database.
  • the embodiment of the present application provides a data table backup method and a server based on an Oracle database, so as to solve the problem of poor operability and low operation efficiency of the data table backup of the database in the prior art.
  • An aspect provided by the application provides a data table backup method based on an Oracle database, including:
  • the target data table is an excel table
  • the type of data in the target data table includes non-real-time update data and real-time update data;
  • the data to be backed up in the target data table is backed up by the backup table data table according to the type of data in the target data table.
  • the embodiment of the present application has the beneficial effects that: in the embodiment of the present application, a backup data table having the same table structure as the target data table is first established, and then the backup data table is set according to the target data table. Access rights, and then backing up the data to be backed up in the target data table according to the type of data in the target data table, and can perform data backup on the non-partition table without requiring professional DBA personnel to process, which can greatly improve The efficiency of data backup operations.
  • FIG. 1 is a flowchart of a data table backup method based on an Oracle database according to Embodiment 1 of the present application;
  • step S103 in FIG. 1 is a flowchart of an implementation of step S103 in FIG. 1;
  • FIG. 3 is another implementation flowchart of step S103 in FIG. 1;
  • step S103 in FIG. 1 is a further implementation flowchart of step S103 in FIG. 1;
  • FIG. 5 is a schematic diagram of a server provided in Embodiment 2 of the present application.
  • FIG. 6 is a block diagram of a program module according to Embodiment 2 of the present application.
  • FIG. 1 is a flowchart showing an implementation process of an Oracle database-based data table backup method according to Embodiment 1 of the present application, which is described in detail as follows:
  • Step S101 establishing a backup data table having the same table structure as the target data table, and setting access rights for the backup data table according to the target data table.
  • the target data table is a data table that needs to be backed up, and may be an excel table, for example, a data table based on an Oracle database.
  • the table structure of the target data table can be a table structure in the form of excel, and corresponding code information is included to implement the corresponding functions.
  • the code structure of the table structure of the data table of different functions is also different.
  • each table structure of the target data table may also contain information such as numbers and fields.
  • each table structure may include a number, which is a unique identifier of the corresponding table structure; each table structure contains a field that has a certain relevance according to design requirements.
  • the setting the access permission for the backup data table according to the target data table is specifically: combining the access rights of the target data table, and setting a certain user and a certain set of the created backup data table according to actual needs.
  • the access rights of some users For example, if the target data table only allows access by a specific user, the backup data table can be set and only specific users can be accessed to prevent data leakage.
  • Step S102 Acquire a type of data in the target data table.
  • the type of data in the target data table may include non-real time update data and real time update data.
  • non-real-time update data refers to data that is not updated or changed in real time, such as attendance data, performance data, and various summary data. Since the non-real-time update data is not updated in real time, it is only calculated by a specific time, for example, it is generated every night or at the end of each month. Therefore, for non-real-time update data, only non-calculated time is required for archiving, and no need to consider the business. influences.
  • Real-time update data refers to data that is updated or changed in real time, such as the operation log and some synchronization intermediate table data (update synchronization status field after synchronization is completed).
  • the type of the data in the target data table may be identified by the data type identifier, and each data type identifier may correspond to multiple pieces of data.
  • the data stored in a data table is a data type.
  • the acquiring the type of the data in the target data table may specifically include:
  • Determining to be non-real-time update data or real-time update data according to the data type identifier in the target data table.
  • the determining, according to the data type identifier in the target data table, the non-real-time update data or the real-time update data may be:
  • the data in the data table is determined to be non-real-time update data or real-time update data according to the data type identifier corresponding to each data table.
  • Step S103 Back up data to be backed up in the target data table by using the backup table data table according to the type of data in the target data table.
  • step S103 can be specifically implemented by the following process:
  • Step S201 the data to be backed up in the target data table is transferred to the backup data table.
  • the transferring the data to be backed up in the target data table to the backup data table is specifically: transferring the data to be backed up in the target data table to the backup data in batches according to time or a primary key In the table. For example, if the historical data of the target data table for more than 3 months is to be archived, the data within 3 months of the target data table may be inserted into the backup data table in batches by time or primary key.
  • Step S202 establishing a primary key and an index for the backup data table according to the target data table.
  • the primary key is the unique index of the data table.
  • the student table has a student number and a name.
  • the name may have a duplicate name, but the student number is unique.
  • Search for a record from the student list such as finding a person. , you can only find it according to the student number, in order to find the only one.
  • a computer manufacturer's database stores product information of the whole machine and accessories, and a table for storing product information of the whole machine is called a Pc table (reference table), and a table for storing the supply information of the parts is called a Parts table ( Refer to the table).
  • the reference table referencing The table, that is, the Pc table
  • the referenced table the parts table
  • a primary key and an index need to be established on the backup data table according to the primary key and the index in the target data table, so that The data in the backup data table can be normally referenced according to the data relationship in the target data table.
  • Step S203 changing the table name of the backup data table after the primary key and the index is established to the table name of the target data table.
  • the data to be backed up in the target data table is transferred to the backup data table, and after the primary key and the index are established for the backup data table according to the target data table, except for the table name of the data table,
  • the backup data table has been identical to the table structure and data information of the target data table. At this time, changing the table name of the backup key data table after the primary key and the index is changed to the table name of the target data table, the process of backing up the target data table can be completed.
  • the target data table as the attendance data table as an example, it is assumed that the historical data of the attendance data table for more than 3 months should be archived, and the implementation process is as follows:
  • the data within 3 months of the attendance data sheet A is inserted into the backup data table B in batches by time or primary key. Since the attendance data table A is a non-real-time update data table, it can be directly inserted into the batch through the time or the primary key. Back up data table B without regard to chronological issues;
  • the primary key, the index, and the like are established on the backup data table B by referring to the attendance data table A table, so that the data in the backup data table B can be correctly referenced;
  • the table name of the attendance data table A is renamed to the data table C, and the table name of the backup data table B is renamed to the table A, that is, the process of backing up the data in the attendance data table A can be completed.
  • step S103 can be specifically implemented by the following process:
  • Step S301 establishing a primary key and an index for the backup data table according to the target data table.
  • step S202 after the data to be backed up in the target data table is transferred to the backup data table, a primary key and an index need to be established on the backup data table according to the primary key and the index in the target data table, so that The data in the backup data table can be normally referenced according to the data relationship in the target data table.
  • step S202 For details, refer to related content in step S202, and details are not described herein again.
  • Step S302 the table name of the target data table is changed, and the table name of the backup data table after the primary key and the index is established is changed to the table name before the target data table is changed.
  • the table name can be changed by a new table name. For example, if the table name of the target data table is Table A and the table name of the backup data table is Table B, the table name of the target data table may be changed to Table C, and then the table name of the backup data table will be Change to Table A.
  • step S303 the data in the target data table after the table name is changed is transferred to the renamed backup data table in the order of the recording time from the back to the front.
  • the step S303 may specifically be: transferring the data to be backed up in the target data table to the backup data table in batches according to time or a primary key. For example, if the historical data of the target data table for more than 3 months is to be archived, the data within 3 months of the target data table may be inserted into the backup data table in batches by time or primary key.
  • the migration data should preferentially migrate the new data in step S303, avoiding an error when the program is updated, and affecting the business. In a few seconds or so, after the data is archived, only a little comparison of the data can be done to completely eliminate the impact.
  • the method further includes: performing data comparison processing according to the data in the target data table and the data in the backup data table to prevent an error when the program is updated.
  • the primary key, the index, and the like are established on the backup data table B with reference to the operation log data table A, so that the data in the backup data table B can be correctly referenced;
  • the data within 3 months of the operation log data table C is inserted into the backup data table A in batches according to the time or the primary key in the order from the back to the front of the recording time.
  • the backup data table having the same table structure as the target data table is specifically configured to: establish a time-based partition with the same table structure as the target data table. And backing up the data table, where the backup data table includes a first partition, and the start time corresponding to the first partition is a current time.
  • the backup data table is partitioned by time, including the partition P1, the partition P2, the partition P3, and the like, wherein the time starting point corresponding to the partition P1 is earlier than the current time, and the partition P2, the partition P3, and the like may be partitioned by month. For example, if the current time is May 15th, the time starting point corresponding to the partition P1 may be a certain day of May, for example, May 14.
  • the step S103 can be specifically implemented by the following process:
  • Step S401 establishing a primary key and an index for the backup data table according to the target data table.
  • step S202 after the data to be backed up in the target data table is transferred to the backup data table, a primary key and an index need to be established on the backup data table according to the primary key and the index in the target data table, so that The data in the backup data table can be normally referenced according to the data relationship in the target data table.
  • step S202 For details, refer to related content in step S202, and details are not described herein again.
  • Step S402 the table name of the target data table is changed, and the table name of the backup data table after the primary key and the index is established is changed to the table name before the target data table is changed.
  • the table name can be changed by a new table name. For example, if the table name of the target data table is Table A and the table name of the backup data table is Table B, the table name of the target data table may be changed to Table C, and then the table name of the backup data table will be Change to Table A.
  • Step S403 the target data table after the table name is changed is exchanged with the first partition, and the first partition is moved out of the backup data table after the table name is changed after the preset time.
  • the exchange between the target data table after the table name change and the first partition can be implemented by using an sql operation, for example, sql: ALTER TABLE A EXCHANGE PATITION P1 WITH TABLE C, that is, the partition P1 is exchanged with the data of the target data table C. After the preset time for data exchange is completed, the first partition can be moved out of the backup data table.
  • the historical data of more than three months in the target data table is archived, and almost every data in three months may be modified in real time.
  • the implementation process is as follows:
  • the partition of the backup data table B includes partition P1, partition P2, partition P3, etc., where The starting point time corresponding to the partition P1 is earlier than the current time;
  • the primary key, the index, and the like are established on the backup data table B with reference to the target data table A table, so that the data in the backup data table B can be correctly referenced;
  • the partition P1 is moved out of the data table A.
  • the above data table backup method based on the Oracle database first establishes a backup data table with the same table structure as the target data table, and then sets access rights for the backup data table according to the target data table, and then according to the target data table.
  • the type of the data is used to back up the data to be backed up in the target data table, and the data backup of the non-partition table can be performed without the need of professional DBA personnel to process, which can greatly improve the operation efficiency of the data backup.
  • FIG. 5 is a schematic diagram showing an operating environment of the picture matching program provided by the embodiment of the present application. For the convenience of explanation, only the parts related to the present embodiment are shown.
  • the computer readable instructions 500 are installed and run in the server 50.
  • the server 50 can include, but is not limited to, a memory 501 and a processor 502.
  • FIG. 5 shows only server 50 with components 501-522, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 501 may be an internal storage unit of the server 50, such as a hard disk or memory of the server 50, in some embodiments.
  • the memory 501 may also be an external storage device of the server 50 in other embodiments, such as a plug-in hard disk equipped on the server 50, a smart memory card (SMC), and a secure digital (Secure) Digital, SD) cards, flash cards, etc.
  • the memory 501 may also include both an internal storage unit of the server 50 and an external storage device.
  • the memory 501 is configured to store application software and various types of data installed in the server 50, such as program code of a data table backup program based on an Oracle database.
  • the memory 501 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 502 can be a central processor (Central) in some embodiments A processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 501, for example, executing the Oracle database-based data table backup program.
  • Central central processor
  • CPU central processing unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 501, for example, executing the Oracle database-based data table backup program.
  • the components 501-522 of the server 50 communicate with one another via a system bus.
  • FIG. 6 is a functional block diagram of computer readable instructions 500 provided by an embodiment of the present application.
  • the computer readable instructions 500 may be partitioned into one or more modules, the one or more modules being stored in the memory 501 and being processed by one or more processors (this Embodiments are performed by the processor 502) to complete the application.
  • the picture matching program 500 can be divided into a data table establishing module 601, a data type obtaining module 602, and a backup module 603.
  • a module refers to a series of computer readable instruction instructions that are capable of performing a particular function, and are more suitable than the program for describing the execution of the computer readable instructions 500 in the server 50. The following description will specifically describe the functions of the modules 601-603.
  • the data table establishing module 601 is configured to establish a backup data table with the same table structure as the target data table, and set access rights for the backup data table according to the target data table.
  • the target data table is an excel table.
  • the data type obtaining module 602 is configured to acquire a type of data in the target data table.
  • the type of data in the target data table includes non-real time update data and real time update data.
  • the backup module 603 is configured to back up data to be backed up in the target data table by using the backup table data table according to the type of data in the target data table.
  • the backup module 603 may be divided into a first data transfer unit, a first setup unit, and a first rename unit.
  • a first data transfer unit configured to transfer data to be backed up in the target data table to the backup data table
  • a first establishing unit configured to establish a primary key and an index for the backup data table according to the target data table
  • the first renaming unit is configured to change the table name of the backup data table after the primary key and the index is established to the table name of the target data table.
  • the backup module 603 may be divided into a second establishing unit, a second rename unit, and a second data transfer unit.
  • a second establishing unit configured to establish a primary key and an index for the backup data table according to the target data table.
  • a second renaming unit configured to change a table name of the target data table, and change a table name of the backup data table after the primary key and the index is established to a table name before the target data table is changed.
  • the second data transfer unit is configured to transfer the data in the target data table after the table name is changed to the backup data table after the rename according to the recording time from the back to the front.
  • the first data transfer unit or the second data transfer unit is specifically configured to batch transfer the data to be backed up in the target data table to the backup data table according to a time or a primary key.
  • the backup data table that is the same as the table structure of the target data table is specifically configured to: establish the same time-based partitioning with the table structure of the target data table.
  • the backup data table includes a first partition, and the start time corresponding to the first partition is a current time.
  • the backup module 603 can be divided into a third establishing unit, a third rename unit, and a third backup unit.
  • a third establishing unit configured to establish a primary key and an index for the backup data table according to the target data table.
  • the third renaming unit changes the table name of the target data table, and changes the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed.
  • the third backup unit exchanges the target data table after the table name change with the first partition, and moves the first partition out of the backup data table after the table name is changed after the preset time.
  • each functional unit and module in the foregoing system may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware.
  • Formal implementation can also be implemented in the form of software functional units.
  • the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application.

Abstract

The present invention is applicable to the technical field of database processing, provides a data table backup method based on an Oracle database, and a server. The method comprises: establishing a backup data table with the same table structure as a target data table, and setting an access right for the backup data table according to the target data table, wherein the target data table is an Excel table; acquiring the type of data in the target data table, wherein the type of data in the target data table comprises data updated in a non-real-time manner and data updated in a real-time manner; and according to the type of data in the target data table, backing up, by means of the backup data table, data to be backed up in the target data table. According to the data table backup method based on an Oracle database, and the server, data backup can be carried out on non-partitioned tables without processing by professional DBA personnel, such that the operational efficiency of data backup can be greatly improved, and the operability can be enhanced.

Description

基于Oracle数据库的数据表备份方法及服务器Data table backup method and server based on Oracle database
本申请申明享有2017年07月27日递交的申请号为201710622205.7、名称为“基于Oracle数据库的数据表备份方法及服务器”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application claims the priority of the Chinese Patent Application entitled "Database Backup Method and Server Based on Oracle Database" filed on July 27, 2017, with the application number of 201710622205.7, the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请属于数据库处理技术领域,尤其涉及基于Oracle数据库的数据表备份方法及服务器。The application belongs to the technical field of database processing, and particularly relates to a data table backup method and a server based on an Oracle database.
背景技术Background technique
各类系统在使用过程中会产生大量的数据,如客户订单数据、操作记录日志类数据、考勤绩效等结果类数据等等。随着数据量的增加,系统在使用过程中的查询速度就会越来越慢。通常的做法就是对历史数据做归档处理,将历史数据移到备份表。也正是因为数据量过大会影响到系统的性能,所以在初期设计表结构的时候就应该考虑数据归档问题。最简单常用的方法是对数据库建立分区表存储,比如按月做分区,在做数据归档时,直接将历史分区移出分区表即可。通常情况下,采用分区表存储数据而对数据进行归档处理时,需要中断业务,由专业DBA人员(Database Administrator,数据库管理员)进行处理,可操作性较差、操作效率较低。Various systems generate a large amount of data during use, such as customer order data, operation log data, attendance performance and other result data. As the amount of data increases, the query speed of the system will become slower and slower during use. The usual practice is to archive historical data and move historical data to a backup table. It is also because the data volume is too large to affect the performance of the system, so the data archiving problem should be considered when designing the table structure in the initial stage. The easiest and most common method is to create a partition table storage for the database, such as partitioning by month. When doing data archiving, move the historical partition directly out of the partition table. Generally, when a partition table is used to store data and the data is archived, the service needs to be interrupted, and the professional DBA personnel (Database Administrator) handles the processing, and the operability is poor and the operation efficiency is low.
技术问题technical problem
有鉴于此,本申请实施例提供了基于Oracle数据库的数据表备份方法及服务器,以解决现有技术中对数据库的数据表备份可操作性较差、操作效率低的问题。In view of this, the embodiment of the present application provides a data table backup method and a server based on an Oracle database, so as to solve the problem of poor operability and low operation efficiency of the data table backup of the database in the prior art.
技术解决方案Technical solution
本申请提供的一方面提供了一种基于Oracle数据库的数据表备份方法,包括:An aspect provided by the application provides a data table backup method based on an Oracle database, including:
建立与目标数据表的表结构相同的备份数据表,并根据所述目标数据表为所述备份数据表设置访问权限;所述目标数据表为excel表;Establishing a backup data table with the same table structure as the target data table, and setting access rights for the backup data table according to the target data table; the target data table is an excel table;
获取所述目标数据表中数据的类型;所述目标数据表中数据的类型包括非实时更新数据和实时更新数据;Obtaining a type of data in the target data table; the type of data in the target data table includes non-real-time update data and real-time update data;
根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份。The data to be backed up in the target data table is backed up by the backup table data table according to the type of data in the target data table.
有益效果Beneficial effect
本申请实施例与现有技术相比存在的有益效果是:本申请实施例,首先建立与目标数据表的表结构相同的备份数据表,然后根据所述目标数据表为所述备份数据表设置访问权限,再根据所述目标数据表中数据的类型,将所述目标数据表中的待备份数据进行备份,不需要专业的DBA人员进行处理即可对非分区表做数据备份,能够大大提高数据备份的操作效率。Compared with the prior art, the embodiment of the present application has the beneficial effects that: in the embodiment of the present application, a backup data table having the same table structure as the target data table is first established, and then the backup data table is set according to the target data table. Access rights, and then backing up the data to be backed up in the target data table according to the type of data in the target data table, and can perform data backup on the non-partition table without requiring professional DBA personnel to process, which can greatly improve The efficiency of data backup operations.
附图说明DRAWINGS
图1是本申请实施例一提供的基于Oracle数据库的数据表备份方法的流程图;1 is a flowchart of a data table backup method based on an Oracle database according to Embodiment 1 of the present application;
图2是图1中步骤S103的一种实现流程图;2 is a flowchart of an implementation of step S103 in FIG. 1;
图3是图1中步骤S103的另一种实现流程图;FIG. 3 is another implementation flowchart of step S103 in FIG. 1;
图4是图1中步骤S103的又一种实现流程图;4 is a further implementation flowchart of step S103 in FIG. 1;
图5是本申请实施例二提供的服务器的示意图;5 is a schematic diagram of a server provided in Embodiment 2 of the present application;
图6是本申请实施例二提供的程序模块的框图。FIG. 6 is a block diagram of a program module according to Embodiment 2 of the present application.
本发明的实施方式Embodiments of the invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for purposes of illustration and description However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the application.
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。In order to explain the technical solutions described in the present application, the following description will be made by way of specific embodiments.
实施例一Embodiment 1
图1示出了本申请实施例一提供的基于Oracle数据库的数据表备份方法的实现流程,详述如下:FIG. 1 is a flowchart showing an implementation process of an Oracle database-based data table backup method according to Embodiment 1 of the present application, which is described in detail as follows:
步骤S101,建立与目标数据表的表结构相同的备份数据表,并根据所述目标数据表为所述备份数据表设置访问权限。Step S101, establishing a backup data table having the same table structure as the target data table, and setting access rights for the backup data table according to the target data table.
其中,目标数据表为需要进行备份的数据表,可以为excel表,例如为基于Oracle数据库的数据表。目标数据表的表结构可以为excel形式的表结构,包含相应的代码信息以实现相应的功能。另外,根据功能的划分,不同功能的数据表的表结构所包含的代码信息也不尽相同。The target data table is a data table that needs to be backed up, and may be an excel table, for example, a data table based on an Oracle database. The table structure of the target data table can be a table structure in the form of excel, and corresponding code information is included to implement the corresponding functions. In addition, according to the division of functions, the code structure of the table structure of the data table of different functions is also different.
另外,目标数据表的表结构还可以包含编号和字段等信息。具体的,每个表结构可以包含一个编号,该编号为对应表结构的唯一标识;每个表结构所包含的字段根据设计需要会具有一定的关联性。In addition, the table structure of the target data table may also contain information such as numbers and fields. Specifically, each table structure may include a number, which is a unique identifier of the corresponding table structure; each table structure contains a field that has a certain relevance according to design requirements.
本步骤中,所述根据所述目标数据表对所述备份数据表设置访问权限具体为:结合所述目标数据表的访问权限,根据实际需要对所建立的备份数据表设置某个用户、某些用户的访问权限。例如,所述目标数据表只允许特定用户进行访问,则可以对备份数据表进行设置,也只允许特定用户进行访问,以防止数据泄露。In this step, the setting the access permission for the backup data table according to the target data table is specifically: combining the access rights of the target data table, and setting a certain user and a certain set of the created backup data table according to actual needs. The access rights of some users. For example, if the target data table only allows access by a specific user, the backup data table can be set and only specific users can be accessed to prevent data leakage.
步骤S102,获取所述目标数据表中数据的类型。Step S102: Acquire a type of data in the target data table.
其中,所述目标数据表中数据的类型可以包括非实时更新数据和实时更新数据。其中,非实时更新数据是指不会实时更新或变更的数据,例如考勤数据、绩效数据和各类汇总数据等。由于非实时更新数据并非实时更新,只是通过特定时间计算得出,例如每天晚上或者每月月末计算出来之后生成,因此对于非实时更新数据只需要选择非计算时间做归档,不需要考虑对业务的影响。实时更新数据是指如操作日志以及某些同步中间表数据(同步完成后会update同步状态字段)等会实时更新或变更的数据。The type of data in the target data table may include non-real time update data and real time update data. Among them, non-real-time update data refers to data that is not updated or changed in real time, such as attendance data, performance data, and various summary data. Since the non-real-time update data is not updated in real time, it is only calculated by a specific time, for example, it is generated every night or at the end of each month. Therefore, for non-real-time update data, only non-calculated time is required for archiving, and no need to consider the business. influences. Real-time update data refers to data that is updated or changed in real time, such as the operation log and some synchronization intermediate table data (update synchronization status field after synchronization is completed).
具体的,可以通过数据类型标识识别目标数据表中数据的类型,每个数据类型标识可以对应多条数据。通常情况下,一个数据表中存储的数据为一个数据类型。Specifically, the type of the data in the target data table may be identified by the data type identifier, and each data type identifier may correspond to multiple pieces of data. Typically, the data stored in a data table is a data type.
一个实施例中,所述获取所述目标数据表中数据的类型具体可以包括:In an embodiment, the acquiring the type of the data in the target data table may specifically include:
预先设置非实时更新数据和实时更新数据对应的数据类型标识;Presetting the data type identifier corresponding to the non-real time update data and the real time update data;
根据所述目标数据表中数据类型标识确定为非实时更新数据或实时更新数据。Determining to be non-real-time update data or real-time update data according to the data type identifier in the target data table.
其中,所述根据所述目标数据表中数据类型标识确定为非实时更新数据或实时更新数据具体可以为:The determining, according to the data type identifier in the target data table, the non-real-time update data or the real-time update data may be:
根据每条数据的数据类型标识确定该数据为非实时更新数据或实时更新数据;或Determining whether the data is non-real-time update data or real-time update data according to the data type identifier of each piece of data; or
根据每个数据表对应的数据类型标识,确定该数据表中的数据为非实时更新数据或实时更新数据。The data in the data table is determined to be non-real-time update data or real-time update data according to the data type identifier corresponding to each data table.
步骤S103,根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份。Step S103: Back up data to be backed up in the target data table by using the backup table data table according to the type of data in the target data table.
本步骤中,对于非实时更新数据和实时更新数据需要采取不同的处理过程,以对所述目标数据表中的待备份数据进行备份。In this step, different processes are required for non-real-time update data and real-time update data to back up the data to be backed up in the target data table.
参见图2,在所述目标数据表中数据为非实时更新数据时,步骤S103具体可以通过以下过程实现:Referring to FIG. 2, when the data in the target data table is non-real-time update data, step S103 can be specifically implemented by the following process:
步骤S201,将所述目标数据表中的待备份数据转至所述备份数据表中。Step S201, the data to be backed up in the target data table is transferred to the backup data table.
其中,所述将所述目标数据表中的待备份数据转至所述备份数据表中具体为:根据时间或主键,将所述目标数据表中的待备份数据分批转至所述备份数据表中。例如,要对目标数据表中3个月以上的历史数据做归档处理,则可以将目标数据表中3个月内的数据,通过时间或者主键分批插入到所述备份数据表中。The transferring the data to be backed up in the target data table to the backup data table is specifically: transferring the data to be backed up in the target data table to the backup data in batches according to time or a primary key In the table. For example, if the historical data of the target data table for more than 3 months is to be archived, the data within 3 months of the target data table may be inserted into the backup data table in batches by time or primary key.
步骤S202,根据所述目标数据表为所述备份数据表建立主键和索引。Step S202, establishing a primary key and an index for the backup data table according to the target data table.
其中,主键是数据表的唯一索引(index),例如学生表里有学号和姓名,姓名可能有重名的,但学号确是唯一的,要从学生表中搜索一条纪录如查找一个人,就只能根据学号去查找,这才能找出唯一的一个。又例如某个电脑生产商的数据库中保存着整机和配件的产品信息,用来保存整机产品信息的表叫做 Pc表(参照表),用来保存配件供货信息的表叫做Parts表(被参照表)。若要设置外键,在参照表(referencing table,即Pc表) 和被参照表 (referenced table,即parts表) 中,相对应的两个字段必须都设置索引。The primary key is the unique index of the data table. For example, the student table has a student number and a name. The name may have a duplicate name, but the student number is unique. Search for a record from the student list, such as finding a person. , you can only find it according to the student number, in order to find the only one. For example, a computer manufacturer's database stores product information of the whole machine and accessories, and a table for storing product information of the whole machine is called a Pc table (reference table), and a table for storing the supply information of the parts is called a Parts table ( Refer to the table). To set a foreign key, in the reference table (referencing The table, that is, the Pc table) and the referenced table (the parts table), the corresponding two fields must be indexed.
本步骤中,在将所述目标数据表中的待备份数据转至所述备份数据表中以后,需要按照目标数据表中的主键和索引,对所述备份数据表建立主键和索引,以使得所述备份数据表中的数据能够按照所述目标数据表中的数据关系被正常引用。In this step, after the data to be backed up in the target data table is transferred to the backup data table, a primary key and an index need to be established on the backup data table according to the primary key and the index in the target data table, so that The data in the backup data table can be normally referenced according to the data relationship in the target data table.
步骤S203,将建立主键和索引后的备份数据表的表名更改为所述目标数据表的表名。Step S203, changing the table name of the backup data table after the primary key and the index is established to the table name of the target data table.
其中,将所述目标数据表中的待备份数据转至所述备份数据表中,并根据所述目标数据表为所述备份数据表建立主键和索引之后,除去数据表的表名之外,所述备份数据表已经与所述目标数据表的表结构和数据信息完全相同了。此时,将建立主键和索引后的备份数据表的表名更改为所述目标数据表的表名,则能够完成对所述目标数据表进行备份的过程。The data to be backed up in the target data table is transferred to the backup data table, and after the primary key and the index are established for the backup data table according to the target data table, except for the table name of the data table, The backup data table has been identical to the table structure and data information of the target data table. At this time, changing the table name of the backup key data table after the primary key and the index is changed to the table name of the target data table, the process of backing up the target data table can be completed.
以所述目标数据表为考勤数据表为例,假设要对考勤数据表3个月以上的历史数据做归档处理,实现过程如下:Taking the target data table as the attendance data table as an example, it is assumed that the historical data of the attendance data table for more than 3 months should be archived, and the implementation process is as follows:
创建一个和考勤数据表(表名为A)相同表结构的备份数据表(表名为B),并参考考勤数据表A对备份数据表B进行赋权,以实现限定某部分用户能访问备份数据表B,查询备份数据表B中的数据;Create a backup data table (table name B) with the same table structure as the attendance data table (table name A), and refer to the attendance data table A to authorize the backup data table B, so as to limit the access of certain users to the backup. Data table B, querying the data in the backup data table B;
将考勤数据表A中3个月内的数据,通过时间或者主键分批插入到备份数据表B中,由于考勤数据表A为非实时更新数据表,因此可以直接通过时间或者主键分批插入到备份数据表B中,而不用考虑时间先后的问题;The data within 3 months of the attendance data sheet A is inserted into the backup data table B in batches by time or primary key. Since the attendance data table A is a non-real-time update data table, it can be directly inserted into the batch through the time or the primary key. Back up data table B without regard to chronological issues;
在备份数据表B上参考考勤数据表A表建立主键、索引等,以使得备份数据表B中的数据能够被正确引用;The primary key, the index, and the like are established on the backup data table B by referring to the attendance data table A table, so that the data in the backup data table B can be correctly referenced;
将考勤数据表A的表名改名为数据表C,再将备份数据表B的表名改名为表A,即可以完成对考勤数据表A中的数据进行备份的过程。The table name of the attendance data table A is renamed to the data table C, and the table name of the backup data table B is renamed to the table A, that is, the process of backing up the data in the attendance data table A can be completed.
参见图3,在所述目标数据表中数据为实时更新数据时,步骤S103具体可以通过以下过程实现:Referring to FIG. 3, when the data in the target data table is real-time update data, step S103 can be specifically implemented by the following process:
步骤S301,根据所述目标数据表为所述备份数据表建立主键和索引。Step S301, establishing a primary key and an index for the backup data table according to the target data table.
本步骤中,在将所述目标数据表中的待备份数据转至所述备份数据表中以后,需要按照目标数据表中的主键和索引,对所述备份数据表建立主键和索引,以使得所述备份数据表中的数据能够按照所述目标数据表中的数据关系被正常引用。具体解释内容可以参照步骤S202中的相关内容,在此不再赘述。In this step, after the data to be backed up in the target data table is transferred to the backup data table, a primary key and an index need to be established on the backup data table according to the primary key and the index in the target data table, so that The data in the backup data table can be normally referenced according to the data relationship in the target data table. For details, refer to related content in step S202, and details are not described herein again.
步骤S302,将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名。Step S302, the table name of the target data table is changed, and the table name of the backup data table after the primary key and the index is established is changed to the table name before the target data table is changed.
其中,可以通过一个新的表名进行表名更改的操作。例如,所述目标数据表的表名为表A,所述备份数据表的表名为表B,则可以将所述目标数据表的表名更改为表C,然后将备份数据表的表名更改为表A。Among them, the table name can be changed by a new table name. For example, if the table name of the target data table is Table A and the table name of the backup data table is Table B, the table name of the target data table may be changed to Table C, and then the table name of the backup data table will be Change to Table A.
步骤S303,将表名更改后的目标数据表中的数据按照记录时间由后到前的顺序,转至更名后的备份数据表中。In step S303, the data in the target data table after the table name is changed is transferred to the renamed backup data table in the order of the recording time from the back to the front.
其中,步骤S303具体可以为:根据时间或主键,将所述目标数据表中的待备份数据分批转至所述备份数据表中。例如,要对目标数据表中3个月以上的历史数据做归档处理,则可以将目标数据表中3个月内的数据,通过时间或者主键分批插入到所述备份数据表中。The step S303 may specifically be: transferring the data to be backed up in the target data table to the backup data table in batches according to time or a primary key. For example, if the historical data of the target data table for more than 3 months is to be archived, the data within 3 months of the target data table may be inserted into the backup data table in batches by time or primary key.
如果数据表只有插入操作,如操作日志,则本步骤不需要中断业务,对业务的影响在1秒之内,几乎可以忽略不计。如果数据表有插入更新操作,如某些同步中间表数据(同步完成后会更新同步状态字段),在步骤S303中迁移数据应优先迁移新的数据,避免程序更新的时候报错,对业务影响大约在几秒钟左右,数据归档完成后只需要稍对数据做比对处理即可完全消除影响。If the data table only has an insert operation, such as an operation log, this step does not need to interrupt the service, and the impact on the service is almost negligible within 1 second. If the data table has an insert update operation, such as some synchronization intermediate table data (the synchronization status field is updated after the synchronization is completed), the migration data should preferentially migrate the new data in step S303, avoiding an error when the program is updated, and affecting the business. In a few seconds or so, after the data is archived, only a little comparison of the data can be done to completely eliminate the impact.
可选的,在步骤S303之后,还包括:根据所述目标数据表中数据和所述备份数据表中的数据进行数据对比处理,以防止程序更新的时候报错。Optionally, after step S303, the method further includes: performing data comparison processing according to the data in the target data table and the data in the backup data table to prevent an error when the program is updated.
以所述目标数据表为操作日志为例,假设要对操作日志数据表3个月以上的历史数据做归档处理,实现过程如下:Taking the target data table as an operation log as an example, it is assumed that the historical data of the operation log data table for more than three months is to be archived, and the implementation process is as follows:
创建一个和操作日志数据表(表名为A)相同表结构的备份数据表(表名为B),并参考操作日志数据表A对备份数据表B进行赋权,以实现限定某部分用户能访问备份数据表B,查询备份数据表B中的数据;Create a backup data table (table name B) with the same table structure as the operation log data table (table name A), and authorize the backup data table B with reference to the operation log data table A, so as to define a certain portion of users. Access the backup data table B to query the data in the backup data table B;
在备份数据表B上参考操作日志数据表A表建立主键、索引等,以使得备份数据表B中的数据能够被正确引用;The primary key, the index, and the like are established on the backup data table B with reference to the operation log data table A, so that the data in the backup data table B can be correctly referenced;
将操作日志数据表A的表名改名为数据表C,再将备份数据表B的表名改名为表A;Rename the table name of the operation log data table A to the data table C, and rename the table name of the backup data table B to the table A;
将操作日志数据表C中3个月内的数据,通过时间或者主键,按照记录时间由后到前的顺序,分批插入到备份数据表A中。The data within 3 months of the operation log data table C is inserted into the backup data table A in batches according to the time or the primary key in the order from the back to the front of the recording time.
进一步的,在所述目标数据表中数据为实时更新数据时,所述建立与目标数据表的表结构相同的备份数据表具体为:建立与目标数据表的表结构相同的按照时间进行分区的备份数据表,所述备份数据表包括第一分区,所述第一分区对应的起始时间为当前时间。例如,通过时间对备份数据表进行分区,包括分区P1、分区P2、分区P3等,其中,分区P1对应的时间起点稍早于当前时间,分区P2、分区P3等可按月分区。例如,当前时间为5月15日,则分区P1对应的时间起点可以为5月份的某一天,例如5月14日。Further, when the data in the target data table is real-time update data, the backup data table having the same table structure as the target data table is specifically configured to: establish a time-based partition with the same table structure as the target data table. And backing up the data table, where the backup data table includes a first partition, and the start time corresponding to the first partition is a current time. For example, the backup data table is partitioned by time, including the partition P1, the partition P2, the partition P3, and the like, wherein the time starting point corresponding to the partition P1 is earlier than the current time, and the partition P2, the partition P3, and the like may be partitioned by month. For example, if the current time is May 15th, the time starting point corresponding to the partition P1 may be a certain day of May, for example, May 14.
其中,步骤S103具体可以通过以下过程实现:The step S103 can be specifically implemented by the following process:
步骤S401,根据所述目标数据表为所述备份数据表建立主键和索引。Step S401, establishing a primary key and an index for the backup data table according to the target data table.
本步骤中,在将所述目标数据表中的待备份数据转至所述备份数据表中以后,需要按照目标数据表中的主键和索引,对所述备份数据表建立主键和索引,以使得所述备份数据表中的数据能够按照所述目标数据表中的数据关系被正常引用。具体解释内容可以参照步骤S202中的相关内容,在此不再赘述。In this step, after the data to be backed up in the target data table is transferred to the backup data table, a primary key and an index need to be established on the backup data table according to the primary key and the index in the target data table, so that The data in the backup data table can be normally referenced according to the data relationship in the target data table. For details, refer to related content in step S202, and details are not described herein again.
步骤S402,将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名。Step S402, the table name of the target data table is changed, and the table name of the backup data table after the primary key and the index is established is changed to the table name before the target data table is changed.
其中,可以通过一个新的表名进行表名更改的操作。例如,所述目标数据表的表名为表A,所述备份数据表的表名为表B,则可以将所述目标数据表的表名更改为表C,然后将备份数据表的表名更改为表A。Among them, the table name can be changed by a new table name. For example, if the table name of the target data table is Table A and the table name of the backup data table is Table B, the table name of the target data table may be changed to Table C, and then the table name of the backup data table will be Change to Table A.
步骤S403,将表名更改后的目标数据表与所述第一分区做交换,并在预设时间后将所述第一分区移出表名更改后的备份数据表。Step S403, the target data table after the table name is changed is exchanged with the first partition, and the first partition is moved out of the backup data table after the table name is changed after the preset time.
其中,可以通过sql操作实现表名更改后的目标数据表与所述第一分区之间的交换,例如sql:ALTER TABLE A EXCHANGE PATITION P1 WITH TABLE C,即将分区P1与目标数据表C的数据做交换。在做完数据交换的预设时间之后,将第一分区移出备份数据表即可。Wherein, the exchange between the target data table after the table name change and the first partition can be implemented by using an sql operation, for example, sql: ALTER TABLE A EXCHANGE PATITION P1 WITH TABLE C, that is, the partition P1 is exchanged with the data of the target data table C. After the preset time for data exchange is completed, the first partition can be moved out of the backup data table.
例如,对目标数据表中三个月以上的历史数据做归档处理,且三个月内的几乎每一条数据都可能实时修改,实现过程如下:For example, the historical data of more than three months in the target data table is archived, and almost every data in three months may be modified in real time. The implementation process is as follows:
创建一个和目标数据表(表名为A)相同表结构的按照时间进行分区的备份数据表(表名为B),备份数据表B的分区包括分区P1、分区P2、分区P3等,其中,分区P1对应的起始点时间早于当前时间;Create a time-based partitioned backup data table (table name B) with the same table structure as the target data table (table name A). The partition of the backup data table B includes partition P1, partition P2, partition P3, etc., where The starting point time corresponding to the partition P1 is earlier than the current time;
在备份数据表B上参考目标数据表A表建立主键、索引等,以使得备份数据表B中的数据能够被正确引用;The primary key, the index, and the like are established on the backup data table B with reference to the target data table A table, so that the data in the backup data table B can be correctly referenced;
将目标数据表A的表名改名为数据表C,再将备份数据表B的表名改名为表A;Rename the table name of the target data table A to the data table C, and rename the table name of the backup data table B to the table A;
将数据表C与数据表A的P1分区做交换,具体过程为sql:ALTER TABLE A EXCHANGE PATITION P1 WITH TABLE C;Exchange data table C with the P1 partition of data table A, the specific process is sql: ALTER TABLE A EXCHANGE PATITION P1 WITH TABLE C;
在完成数据交换3个月之后,将分区P1移出数据表A。After completing the data exchange for 3 months, the partition P1 is moved out of the data table A.
上述基于Oracle数据库的数据表备份方法,首先建立与目标数据表的表结构相同的备份数据表,然后根据所述目标数据表为所述备份数据表设置访问权限,再根据所述目标数据表中数据的类型,将所述目标数据表中的待备份数据进行备份,不需要专业的DBA人员进行处理即可对非分区表做数据备份,能够大大提高数据备份的操作效率。The above data table backup method based on the Oracle database first establishes a backup data table with the same table structure as the target data table, and then sets access rights for the backup data table according to the target data table, and then according to the target data table. The type of the data is used to back up the data to be backed up in the target data table, and the data backup of the non-partition table can be performed without the need of professional DBA personnel to process, which can greatly improve the operation efficiency of the data backup.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence of the steps in the above embodiments does not mean that the order of execution is performed. The order of execution of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiments of the present application.
实施例二Embodiment 2
对应于上文实施例所述的图片匹配方法,图5示出了本申请实施例提供的图片匹配程序的运行环境示意图。为了便于说明,仅示出了与本实施例相关的部分。Corresponding to the picture matching method described in the foregoing embodiment, FIG. 5 is a schematic diagram showing an operating environment of the picture matching program provided by the embodiment of the present application. For the convenience of explanation, only the parts related to the present embodiment are shown.
在本实施例中,所述的计算机可读指令500安装并运行于服务器50中。该服务器50可包括,但不仅限于,存储器501和处理器502。图5仅示出了具有组件501-502的服务器50,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。In the present embodiment, the computer readable instructions 500 are installed and run in the server 50. The server 50 can include, but is not limited to, a memory 501 and a processor 502. FIG. 5 shows only server 50 with components 501-522, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
所述存储器501在一些实施例中可以是所述服务器50的内部存储单元,例如该服务器50的硬盘或内存。所述存储器501在另一些实施例中也可以是所述服务器50的外部存储设备,例如所述服务器50上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器501还可以既包括所述服务器50的内部存储单元也包括外部存储设备。所述存储器501用于存储安装于所述服务器50的应用软件及各类数据,例如基于Oracle数据库的数据表备份程序的程序代码等。所述存储器501还可以用于暂时地存储已经输出或者将要输出的数据。The memory 501 may be an internal storage unit of the server 50, such as a hard disk or memory of the server 50, in some embodiments. The memory 501 may also be an external storage device of the server 50 in other embodiments, such as a plug-in hard disk equipped on the server 50, a smart memory card (SMC), and a secure digital (Secure) Digital, SD) cards, flash cards, etc. Further, the memory 501 may also include both an internal storage unit of the server 50 and an external storage device. The memory 501 is configured to store application software and various types of data installed in the server 50, such as program code of a data table backup program based on an Oracle database. The memory 501 can also be used to temporarily store data that has been output or is about to be output.
所述处理器502在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行所述存储器501中存储的程序代码或处理数据,例如执行所述基于Oracle数据库的数据表备份程序等。The processor 502 can be a central processor (Central) in some embodiments A processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 501, for example, executing the Oracle database-based data table backup program.
所述服务器50的部件501-502通过系统总线相互通信。The components 501-522 of the server 50 communicate with one another via a system bus.
请参阅图6,是本申请实施例提供的计算机可读指令500的功能模块图。在本实施例中,所述的计算机可读指令500可以被分割成一个或多个模块,所述一个或者多个模块被存储于所述存储器501中,并由一个或多个处理器(本实施例为所述处理器502)所执行,以完成本申请。例如,在图6中,所述的图片匹配程序500可以被分割成数据表建立模块601、数据类型获取模块602和备份模块603。本申请所称的模块是指能够完成特定功能的一系列计算机可读指令指令段,比程序更适合于描述所述计算机可读指令500在所述服务器50中的执行过程。以下描述将具体介绍所述模块601-603的功能。Please refer to FIG. 6 , which is a functional block diagram of computer readable instructions 500 provided by an embodiment of the present application. In this embodiment, the computer readable instructions 500 may be partitioned into one or more modules, the one or more modules being stored in the memory 501 and being processed by one or more processors (this Embodiments are performed by the processor 502) to complete the application. For example, in FIG. 6, the picture matching program 500 can be divided into a data table establishing module 601, a data type obtaining module 602, and a backup module 603. A module, as referred to herein, refers to a series of computer readable instruction instructions that are capable of performing a particular function, and are more suitable than the program for describing the execution of the computer readable instructions 500 in the server 50. The following description will specifically describe the functions of the modules 601-603.
其中,数据表建立模块601,用于建立与目标数据表的表结构相同的备份数据表,并根据所述目标数据表为所述备份数据表设置访问权限。其中,所述目标数据表为excel表。The data table establishing module 601 is configured to establish a backup data table with the same table structure as the target data table, and set access rights for the backup data table according to the target data table. The target data table is an excel table.
数据类型获取模块602,用于获取所述目标数据表中数据的类型。其中,所述目标数据表中数据的类型包括非实时更新数据和实时更新数据。The data type obtaining module 602 is configured to acquire a type of data in the target data table. The type of data in the target data table includes non-real time update data and real time update data.
备份模块603,用于根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份。The backup module 603 is configured to back up data to be backed up in the target data table by using the backup table data table according to the type of data in the target data table.
可选的,在所述目标数据表中数据为非实时更新数据时,所述备份模块603可以被分割为第一数据转移单元、第一建立单元和第一更名单元。Optionally, when the data in the target data table is non-real time update data, the backup module 603 may be divided into a first data transfer unit, a first setup unit, and a first rename unit.
第一数据转移单元,用于将所述目标数据表中的待备份数据转至所述备份数据表中;a first data transfer unit, configured to transfer data to be backed up in the target data table to the backup data table;
第一建立单元,用于根据所述目标数据表为所述备份数据表建立主键和索引;a first establishing unit, configured to establish a primary key and an index for the backup data table according to the target data table;
第一更名单元,用于将建立主键和索引后的备份数据表的表名更改为所述目标数据表的表名。The first renaming unit is configured to change the table name of the backup data table after the primary key and the index is established to the table name of the target data table.
可选的,在所述目标数据表中数据为实时更新数据时,所述备份模块603可以被分割为第二建立单元、第二更名单元和第二数据转移单元。Optionally, when the data in the target data table is real-time update data, the backup module 603 may be divided into a second establishing unit, a second rename unit, and a second data transfer unit.
第二建立单元,用于根据所述目标数据表为所述备份数据表建立主键和索引。And a second establishing unit, configured to establish a primary key and an index for the backup data table according to the target data table.
第二更名单元,用于将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名。a second renaming unit, configured to change a table name of the target data table, and change a table name of the backup data table after the primary key and the index is established to a table name before the target data table is changed.
第二数据转移单元,用于将表名更改后的目标数据表中的数据按照记录时间由后到前的顺序,转至更名后的备份数据表中。The second data transfer unit is configured to transfer the data in the target data table after the table name is changed to the backup data table after the rename according to the recording time from the back to the front.
可选的,所述第一数据转移单元或第二数据转移单元具体用于:根据时间或主键,将所述目标数据表中的待备份数据分批转至所述备份数据表中。Optionally, the first data transfer unit or the second data transfer unit is specifically configured to batch transfer the data to be backed up in the target data table to the backup data table according to a time or a primary key.
可选的,在所述目标数据表中数据为实时更新数据时,所述建立与目标数据表的表结构相同的备份数据表具体为:建立与目标数据表的表结构相同的按照时间进行分区的备份数据表,所述备份数据表包括第一分区,所述第一分区对应的起始时间为当前时间。所述备份模块603可以被分割为第三建立单元、第三更名单元和第三备份单元。Optionally, when the data in the target data table is real-time update data, the backup data table that is the same as the table structure of the target data table is specifically configured to: establish the same time-based partitioning with the table structure of the target data table. The backup data table includes a first partition, and the start time corresponding to the first partition is a current time. The backup module 603 can be divided into a third establishing unit, a third rename unit, and a third backup unit.
第三建立单元,根据所述目标数据表为所述备份数据表建立主键和索引。And a third establishing unit, configured to establish a primary key and an index for the backup data table according to the target data table.
第三更名单元,将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名。The third renaming unit changes the table name of the target data table, and changes the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed.
第三备份单元,将表名更改后的目标数据表与所述第一分区做交换,并在预设时间后将所述第一分区移出表名更改后的备份数据表。The third backup unit exchanges the target data table after the table name change with the first partition, and moves the first partition out of the backup data table after the table name is changed after the preset time.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the division of each functional unit and module described above is exemplified. In practical applications, the above functions may be assigned to different functional units according to needs. The module is completed by dividing the internal structure of the device into different functional units or modules to perform all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware. Formal implementation can also be implemented in the form of software functional units. In addition, the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application. For the specific working process of the unit and the module in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the parts that are not detailed or described in the specific embodiments may be referred to the related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still implement the foregoing embodiments. The technical solutions described in the examples are modified or equivalently replaced with some of the technical features; and the modifications or substitutions do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种基于Oracle数据库的数据表备份方法,其特征在于,包括:A data table backup method based on an Oracle database, characterized in that:
    建立与目标数据表的表结构相同的备份数据表,并根据所述目标数据表对所述备份数据表设置访问权限;所述目标数据表为excel表;Establishing a backup data table with the same table structure as the target data table, and setting access rights to the backup data table according to the target data table; the target data table is an excel table;
    获取所述目标数据表中数据的类型;所述目标数据表中数据的类型包括非实时更新数据和实时更新数据;Obtaining a type of data in the target data table; the type of data in the target data table includes non-real-time update data and real-time update data;
    根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份。The data to be backed up in the target data table is backed up by the backup table data table according to the type of data in the target data table.
  2. 如权利要求1所述的基于Oracle数据库的数据表备份方法,其特征在于,在所述目标数据表中数据为非实时更新数据时,所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The method for backing up an Oracle database-based data table according to claim 1, wherein when the data in the target data table is non-real-time update data, the data is passed according to the type of the data in the target data table. The backup table data table backs up the data to be backed up in the target data table, including:
    将所述目标数据表中的待备份数据转至所述备份数据表中;Transferring the data to be backed up in the target data table to the backup data table;
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将建立主键和索引后的备份数据表的表名更改为所述目标数据表的表名。Change the table name of the backup data table after the primary key and index is established to the table name of the target data table.
  3. 如权利要求2所述的基于Oracle数据库的数据表备份方法,其特征在于,所述将所述目标数据表中的待备份数据转至所述备份数据表中具体为:The method for backing up an Oracle database-based data table according to claim 2, wherein the transferring the data to be backed up in the target data table to the backup data table is specifically:
    根据时间或主键,将所述目标数据表中的待备份数据分批转至所述备份数据表中。The data to be backed up in the target data table is batch-transferred to the backup data table according to time or primary key.
  4. 如权利要求1所述的基于Oracle数据库的数据表备份方法,其特征在于,在所述目标数据表中数据为实时更新数据时,所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The method for backing up an Oracle database-based data table according to claim 1, wherein when the data in the target data table is real-time update data, according to the type of data in the target data table, The backup table data table backs up the data to be backed up in the target data table, including:
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;Changing the table name of the target data table, and changing the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed;
    将表名更改后的目标数据表中的数据按照记录时间由后到前的顺序,转至更名后的备份数据表中。The data in the target data table after the table name is changed is transferred to the renamed backup data table in the order of the recording time from the back to the front.
  5. 如权利要求4所述的基于Oracle数据库的数据表备份方法,其特征在于,在所述目标数据表中数据为实时更新数据时,所述建立与目标数据表的表结构相同的备份数据表具体为:建立与目标数据表的表结构相同的按照时间进行分区的备份数据表,所述备份数据表包括第一分区,所述第一分区对应的起始时间为当前时间;The data table backup method based on the Oracle database of claim 4, wherein when the data in the target data table is real-time update data, the backup data table having the same table structure as the target data table is specifically configured. a backup data table that is partitioned by time according to the same table structure of the target data table, the backup data table includes a first partition, and a start time corresponding to the first partition is a current time;
    所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The backing up the data to be backed up in the target data table by using the backup table data table according to the type of the data in the target data table includes:
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;Changing the table name of the target data table, and changing the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed;
    将表名更改后的目标数据表与所述第一分区做交换,并在预设时间后将所述第一分区移出表名更改后的备份数据表。The target data table after the table name is changed is exchanged with the first partition, and the first partition is moved out of the backup data table after the table name is changed after the preset time.
  6. 一种服务器,其特征在于,包括:A server, comprising:
    数据表建立模块,用于建立与目标数据表的表结构相同的备份数据表,并根据所述目标数据表为所述备份数据表设置访问权限。其中,所述目标数据表为excel表;The data table establishing module is configured to establish a backup data table with the same table structure as the target data table, and set access rights for the backup data table according to the target data table. Wherein, the target data table is an excel table;
    数据类型获取模块,用于获取所述目标数据表中数据的类型。其中,所述目标数据表中数据的类型包括非实时更新数据和实时更新数据;a data type obtaining module, configured to acquire a type of data in the target data table. The type of data in the target data table includes non-real time update data and real time update data;
    备份模块,用于根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份。And a backup module, configured to back up data to be backed up in the target data table by using the backup table data table according to a type of data in the target data table.
  7. 根据权利要求6所述的服务器,其特征在于,在所述目标数据表中数据为非实时更新数据时,所述备份模块包括:The server according to claim 6, wherein when the data in the target data table is non-real time update data, the backup module comprises:
    第一数据转移单元,用于将所述目标数据表中的待备份数据转至所述备份数据表中;a first data transfer unit, configured to transfer data to be backed up in the target data table to the backup data table;
    第一建立单元,用于根据所述目标数据表为所述备份数据表建立主键和索引;a first establishing unit, configured to establish a primary key and an index for the backup data table according to the target data table;
    第一更名单元,用于将建立主键和索引后的备份数据表的表名更改为所述目标数据表的表名。The first renaming unit is configured to change the table name of the backup data table after the primary key and the index is established to the table name of the target data table.
  8. 根据权利要求7所述的服务器,其特征在于,所述第一数据转移单元或第二数据转移单元具体用于:根据时间或主键,将所述目标数据表中的待备份数据分批转至所述备份数据表中。The server according to claim 7, wherein the first data transfer unit or the second data transfer unit is specifically configured to: batch transfer the data to be backed up in the target data table to the batch according to time or primary key In the backup data table.
  9. 根据权利要求6所述的服务器,其特征在于,在所述目标数据表中数据为实时更新数据时,所述备份模块包括:The server according to claim 6, wherein when the data in the target data table is real-time update data, the backup module comprises:
    第二建立单元,用于根据所述目标数据表为所述备份数据表建立主键和索引;a second establishing unit, configured to establish a primary key and an index for the backup data table according to the target data table;
    第二更名单元,用于将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;a second renaming unit, configured to change a table name of the target data table, and change a table name of the backup data table after the primary key and the index is established to a table name before the target data table is changed;
    第二数据转移单元,用于将表名更改后的目标数据表中的数据按照记录时间由后到前的顺序,转至更名后的备份数据表中。The second data transfer unit is configured to transfer the data in the target data table after the table name is changed to the backup data table after the rename according to the recording time from the back to the front.
  10. 根据权利要求9所述的服务器,其特征在于,在所述目标数据表中数据为实时更新数据时,所述建立与目标数据表的表结构相同的备份数据表具体为:建立与目标数据表的表结构相同的按照时间进行分区的备份数据表,所述备份数据表包括第一分区,所述第一分区对应的起始时间为当前时间;所述备份模块包括:The server according to claim 9, wherein when the data in the target data table is real-time update data, the backup data table having the same table structure as the target data table is specifically: establishing and target data table. The backup table includes the first partition, and the start time corresponding to the first partition is the current time; the backup module includes:
    第三建立单元,根据所述目标数据表为所述备份数据表建立主键和索引;a third establishing unit, configured to establish a primary key and an index for the backup data table according to the target data table;
    第三更名单元,将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;a third renaming unit, changing a table name of the target data table, and changing a table name of the backup data table after the primary key and the index is established to a table name before the target data table is changed;
    第三备份单元,将表名更改后的目标数据表与所述第一分区做交换,并在预设时间后将所述第一分区移出表名更改后的备份数据表。The third backup unit exchanges the target data table after the table name change with the first partition, and moves the first partition out of the backup data table after the table name is changed after the preset time.
  11. 一种服务器,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A server comprising a memory, a processor, and computer readable instructions stored in the memory and operative on the processor, wherein the processor implements the following steps when the computer readable instructions are executed :
    建立与目标数据表的表结构相同的备份数据表,并根据所述目标数据表对所述备份数据表设置访问权限;所述目标数据表为excel表;Establishing a backup data table with the same table structure as the target data table, and setting access rights to the backup data table according to the target data table; the target data table is an excel table;
    获取所述目标数据表中数据的类型;所述目标数据表中数据的类型包括非实时更新数据和实时更新数据;Obtaining a type of data in the target data table; the type of data in the target data table includes non-real-time update data and real-time update data;
    根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份。The data to be backed up in the target data table is backed up by the backup table data table according to the type of data in the target data table.
  12. 根据权利要求11所述的服务器,其特征在于,其特征在于,在所述目标数据表中数据为非实时更新数据时,所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The server according to claim 11, wherein when the data in the target data table is non-real time update data, the backup table is used according to the type of data in the target data table. The data table backs up the data to be backed up in the target data table, including:
    将所述目标数据表中的待备份数据转至所述备份数据表中;Transferring the data to be backed up in the target data table to the backup data table;
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将建立主键和索引后的备份数据表的表名更改为所述目标数据表的表名。Change the table name of the backup data table after the primary key and index is established to the table name of the target data table.
  13. 根据权利要求12所述的服务器,其特征在于,其特征在于,所述将所述目标数据表中的待备份数据转至所述备份数据表中具体为:The server according to claim 12, wherein the transferring the data to be backed up in the target data table to the backup data table is specifically:
    根据时间或主键,将所述目标数据表中的待备份数据分批转至所述备份数据表中。The data to be backed up in the target data table is batch-transferred to the backup data table according to time or primary key.
  14. 根据权利要求11所述的服务器,其特征在于,在所述目标数据表中数据为实时更新数据时,所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The server according to claim 11, wherein when the data in the target data table is real-time update data, according to the type of data in the target data table, the data is The backup of the data to be backed up in the target data table includes:
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;Changing the table name of the target data table, and changing the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed;
    将表名更改后的目标数据表中的数据按照记录时间由后到前的顺序,转至更名后的备份数据表中。The data in the target data table after the table name is changed is transferred to the renamed backup data table in the order of the recording time from the back to the front.
  15. 根据权利要求14所述的服务器,其特征在于,在所述目标数据表中数据为实时更新数据时,所述建立与目标数据表的表结构相同的备份数据表具体为:建立与目标数据表的表结构相同的按照时间进行分区的备份数据表,所述备份数据表包括第一分区,所述第一分区对应的起始时间为当前时间;The server according to claim 14, wherein when the data in the target data table is real-time update data, the backup data table having the same table structure as the target data table is specifically: establishing and target data table. The table structure is the same as the backup data table partitioned by time, the backup data table includes a first partition, and the start time corresponding to the first partition is the current time;
    所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The backing up the data to be backed up in the target data table by using the backup table data table according to the type of the data in the target data table includes:
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;Changing the table name of the target data table, and changing the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed;
    将表名更改后的目标数据表与所述第一分区做交换,并在预设时间后将所述第一分区移出表名更改后的备份数据表。The target data table after the table name is changed is exchanged with the first partition, and the first partition is moved out of the backup data table after the table name is changed after the preset time.
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer readable storage medium storing computer readable instructions, wherein the computer readable instructions, when executed by a processor, implement the following steps:
    建立与目标数据表的表结构相同的备份数据表,并根据所述目标数据表对所述备份数据表设置访问权限;所述目标数据表为excel表;Establishing a backup data table with the same table structure as the target data table, and setting access rights to the backup data table according to the target data table; the target data table is an excel table;
    获取所述目标数据表中数据的类型;所述目标数据表中数据的类型包括非实时更新数据和实时更新数据;Obtaining a type of data in the target data table; the type of data in the target data table includes non-real-time update data and real-time update data;
    根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份。The data to be backed up in the target data table is backed up by the backup table data table according to the type of data in the target data table.
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,在所述目标数据表中数据为非实时更新数据时,所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The computer readable storage medium according to claim 16, wherein when the data in the target data table is non-real time update data, the backup table is used according to the type of data in the target data table. The data table backs up the data to be backed up in the target data table, including:
    将所述目标数据表中的待备份数据转至所述备份数据表中;Transferring the data to be backed up in the target data table to the backup data table;
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将建立主键和索引后的备份数据表的表名更改为所述目标数据表的表名。Change the table name of the backup data table after the primary key and index is established to the table name of the target data table.
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述将所述目标数据表中的待备份数据转至所述备份数据表中具体为:The computer readable storage medium according to claim 17, wherein the transferring the data to be backed up in the target data table to the backup data table is specifically:
    根据时间或主键,将所述目标数据表中的待备份数据分批转至所述备份数据表中。The data to be backed up in the target data table is batch-transferred to the backup data table according to time or primary key.
  19. 根据权利要求16所述的计算机可读存储介质,其特征在于,在所述目标数据表中数据为实时更新数据时,所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The computer readable storage medium according to claim 16, wherein when the data in the target data table is real-time update data, the data is passed through the backup table according to a type of data in the target data table. The table backs up the data to be backed up in the target data table, including:
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;Changing the table name of the target data table, and changing the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed;
    将表名更改后的目标数据表中的数据按照记录时间由后到前的顺序,转至更名后的备份数据表中。The data in the target data table after the table name is changed is transferred to the renamed backup data table in the order of the recording time from the back to the front.
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,在所述目标数据表中数据为实时更新数据时,所述建立与目标数据表的表结构相同的备份数据表具体为:建立与目标数据表的表结构相同的按照时间进行分区的备份数据表,所述备份数据表包括第一分区,所述第一分区对应的起始时间为当前时间;The computer readable storage medium according to claim 19, wherein when the data in the target data table is real-time update data, the establishing a backup data table having the same table structure as the target data table is specifically: establishing a backup data table partitioned by time according to a table structure of the target data table, where the backup data table includes a first partition, and a start time corresponding to the first partition is a current time;
    所述根据所述目标数据表中数据的类型,通过所述备份表数据表将所述目标数据表中的待备份数据进行备份包括:The backing up the data to be backed up in the target data table by using the backup table data table according to the type of the data in the target data table includes:
    根据所述目标数据表为所述备份数据表建立主键和索引;Establishing a primary key and an index for the backup data table according to the target data table;
    将所述目标数据表的表名进行更改,并将建立主键和索引后的备份数据表的表名更改为所述目标数据表更改前的表名;Changing the table name of the target data table, and changing the table name of the backup data table after the primary key and the index is established to the table name before the target data table is changed;
    将表名更改后的目标数据表与所述第一分区做交换,并在预设时间后将所述第一分区移出表名更改后的备份数据表。The target data table after the table name is changed is exchanged with the first partition, and the first partition is moved out of the backup data table after the table name is changed after the preset time.
PCT/CN2018/083299 2017-07-27 2018-04-17 Data table backup method based on oracle database, and server WO2019019706A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710622205.7A CN108255909B (en) 2017-07-27 2017-07-27 Data table backup method and server based on Oracle database
CN201710622205.7 2017-07-27

Publications (1)

Publication Number Publication Date
WO2019019706A1 true WO2019019706A1 (en) 2019-01-31

Family

ID=62722014

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083299 WO2019019706A1 (en) 2017-07-27 2018-04-17 Data table backup method based on oracle database, and server

Country Status (2)

Country Link
CN (1) CN108255909B (en)
WO (1) WO2019019706A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110276060A (en) * 2019-06-24 2019-09-24 北京明略软件系统有限公司 The method and device of data processing

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108984727A (en) * 2018-07-11 2018-12-11 郑州云海信息技术有限公司 A kind of Database Automatic Backup method, apparatus, equipment and storage medium
CN109271455B (en) * 2018-11-12 2021-04-09 武汉达梦数据库有限公司 Method for creating data table index during data synchronization
CN109617736A (en) * 2018-12-26 2019-04-12 杭州和利时自动化有限公司 A kind of data transmission method and relevant apparatus
CN110825735B (en) * 2019-10-10 2023-08-22 中国平安财产保险股份有限公司 Data table processing method and related equipment
CN113760600B (en) * 2020-08-05 2023-09-22 北京京东振世信息技术有限公司 Database backup method, database restoration method and related devices

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101694637A (en) * 2009-11-06 2010-04-14 金蝶软件(中国)有限公司 Method and system for restoring database
CN102508833A (en) * 2011-09-22 2012-06-20 用友软件股份有限公司 Data monitoring device and data monitoring method
US8266101B1 (en) * 2009-07-16 2012-09-11 Binpeng Shuai Share nothing database cluster and real time synchronization by signaling
CN103164431A (en) * 2011-12-13 2013-06-19 北京神州泰岳软件股份有限公司 Data storage method of relational database and storage system
CN103870600A (en) * 2014-04-02 2014-06-18 中国银行股份有限公司 Data table backup method and device based on Oracle database
CN106951490A (en) * 2017-03-14 2017-07-14 清华大学 A kind of storage of more correction data in real time and caching read method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050071391A1 (en) * 2003-09-29 2005-03-31 International Business Machines Corporation High availability data replication set up using external backup and restore
CN101604269B (en) * 2009-07-22 2011-02-16 中国科学院计算技术研究所 System and method for managing backup data
CN102752322B (en) * 2011-04-18 2015-04-15 中国科学院声学研究所 Method for storing and querying distributed data in internet of things
CN103197988A (en) * 2012-01-05 2013-07-10 中国移动通信集团湖南有限公司 Data backup and recovery method, device and database system
CN103885855A (en) * 2012-12-20 2014-06-25 航天信息股份有限公司 Data backup and recovery method and data backup and recovery device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8266101B1 (en) * 2009-07-16 2012-09-11 Binpeng Shuai Share nothing database cluster and real time synchronization by signaling
CN101694637A (en) * 2009-11-06 2010-04-14 金蝶软件(中国)有限公司 Method and system for restoring database
CN102508833A (en) * 2011-09-22 2012-06-20 用友软件股份有限公司 Data monitoring device and data monitoring method
CN103164431A (en) * 2011-12-13 2013-06-19 北京神州泰岳软件股份有限公司 Data storage method of relational database and storage system
CN103870600A (en) * 2014-04-02 2014-06-18 中国银行股份有限公司 Data table backup method and device based on Oracle database
CN106951490A (en) * 2017-03-14 2017-07-14 清华大学 A kind of storage of more correction data in real time and caching read method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110276060A (en) * 2019-06-24 2019-09-24 北京明略软件系统有限公司 The method and device of data processing
CN110276060B (en) * 2019-06-24 2022-12-09 北京明略软件系统有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN108255909B (en) 2020-08-04
CN108255909A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
WO2019019706A1 (en) Data table backup method based on oracle database, and server
US11243945B2 (en) Distributed database having blockchain attributes
US11762823B2 (en) Method and system for cloning enterprise content management systems
EP2788876B1 (en) System and method for restoring application data
CN109906448B (en) Method, apparatus, and medium for facilitating operations on pluggable databases
EP3407205B1 (en) Data operation method and data management server
CN101089857B (en) Internal store data base transaction method and system
US9135454B2 (en) Systems and methods for enabling searchable encryption
EP3051440B1 (en) Keyvalue database data table updating method and data table updating device
US9946724B1 (en) Scalable post-process deduplication
US20090083337A1 (en) Performing synchronization among relational database tables with minimal contention
CN108431807B (en) Replication of structured data records in partitioned data storage spaces
US8880464B1 (en) Methods and apparatus for synchronizing closed heterogenous systems
CN108255855B (en) Data storage method and device
US20230205912A1 (en) Directing queries to encrypted database files
WO2021218142A1 (en) Data migration method and apparatus, and electronic device and computer readable storage medium
Chen et al. Bestpeer++: A peer-to-peer based large-scale data processing platform
WO2022095366A1 (en) Redis-based data reading method and apparatus, device, and readable storage medium
Tatemura et al. Partiqle: An elastic SQL engine over key-value stores
US11132141B2 (en) System and method for synchronization of data containers
EP2722774B1 (en) Long term archiving of data in a MES system
CN104636260A (en) Data management method and system for charging services
CN102467394A (en) Method and system for realizing multi-core hot patching
WO2023066222A1 (en) Data processing method and apparatus, and electronic device, storage medium and program product
WO2013096447A1 (en) A multiphase approach to data availability

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10-08-2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18837833

Country of ref document: EP

Kind code of ref document: A1