CN110413616B - Backup method and device for database undo table space - Google Patents

Backup method and device for database undo table space Download PDF

Info

Publication number
CN110413616B
CN110413616B CN201910636866.4A CN201910636866A CN110413616B CN 110413616 B CN110413616 B CN 110413616B CN 201910636866 A CN201910636866 A CN 201910636866A CN 110413616 B CN110413616 B CN 110413616B
Authority
CN
China
Prior art keywords
data
backup
database
mirror image
undo
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
CN201910636866.4A
Other languages
Chinese (zh)
Other versions
CN110413616A (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 Inspur 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 CN201910636866.4A priority Critical patent/CN110413616B/en
Publication of CN110413616A publication Critical patent/CN110413616A/en
Application granted granted Critical
Publication of CN110413616B publication Critical patent/CN110413616B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • 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

Abstract

The invention provides a backup method of a database undo table space, which comprises the following steps: creating an undo backup table space in a database, and creating a backup table in the undo backup table space; monitoring the operations of adding, deleting and modifying data in the database; in response to the monitored operations of adding, deleting and modifying the data in the database, writing the front mirror image of the data into a temporary table; and reading the front mirror image of the data in the temporary table in real time and writing the front mirror image of the data into the backup table. By the aid of the method and the device, logical backup of the spatial data of the undo table is realized, readability of the spatial data of the undo table is greatly improved, and risks caused by loss of the spatial data of the undo table are reduced.

Description

Backup method and device for database undo table space
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for backing up a table space of a database undoo.
Background
The data in the undo table space of the database plays an important role, the front mirror image of the data can be backed up, the data can be used for inquiring the data at a certain past time point, and the data can also be used for data recovery, so that the backup of the undo table space is very important. However, at present, the backup of the undo table space is only performed physically, that is, the backup is performed through the database rman, or the backup of the undo table space is stopped, and there is no logical backup method for backing up the data in the undo table space. The data backed up by the logic can be intuitively used for inquiry, data recovery and the like, and is very transparent to upper-layer application, so the logic backup is very necessary.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method for logically backing up a database undo table space, so that data backed up by the logical backup can be used for querying and data recovery, etc. intuitively.
Based on the above object, an aspect of the embodiments of the present invention provides a method for backing up a table space of a database undo, including the following steps:
creating an undo backup table space in the database, and creating a backup table in the undo backup table space;
monitoring the operations of adding, deleting and modifying the data in the database;
in response to monitoring the operations of adding, deleting and modifying the data in the database, writing a front mirror image of the data into a temporary table; and
and reading the front mirror image of the data in the temporary table in real time, and writing the front mirror image of the data into the backup table.
In some embodiments, the method further comprises:
and deleting the front mirror image in the temporary table after the front mirror image of the data is written into the backup table.
In some embodiments, the writing the pre-mirror image of the data to a temporary table in response to monitoring the add-delete-modify operation on the data in the database comprises:
capturing a front mirror image of data of the adding and deleting operations through a trigger, and writing the front mirror image of the data into a temporary table.
In some embodiments, the temporary table is configured to be stored in other table spaces of the database.
In some embodiments, the temporary table is configured to be stored in the backup tablespace of the database.
Another aspect of the embodiments of the present invention provides a backup device for a database undo table space, including:
at least one processor; and
a memory storing program code executable by the processor, the program code, when executed by the processor, performing the steps of:
creating an undo backup table space in the database, and creating a backup table in the undo backup table space;
monitoring the operations of adding, deleting and modifying the data in the database;
in response to monitoring the operations of adding, deleting and modifying the data in the database, writing a front mirror image of the data into a temporary table; and
and reading the front mirror image of the data in the temporary table in real time, and writing the front mirror image of the data into the backup table.
In some embodiments, the method further comprises:
and deleting the front mirror image in the temporary table after the front mirror image of the data is written into the backup table.
In some embodiments, in response to monitoring an add-drop-modify operation on data in the database, writing the front image of the data to a temporary table comprises:
capturing a front mirror image of data of the adding and deleting operations through a trigger, and writing the front mirror image of the data into a temporary table.
In some embodiments, the temporary table is configured to be stored in other table spaces of the database.
In some embodiments, the temporary table is configured to be stored in the backup tablespace of the database.
The invention has the following beneficial technical effects: the backup method and the backup device for the data base undo table space provided by the embodiment of the invention realize the logical backup of the undo table space data, greatly improve the readability of the undo table space data, and simultaneously reduce the risk caused by the loss of the undo table space data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a flow chart of a method for backing up a database undo tablespace according to the present invention;
FIG. 2 is a schematic diagram of a method for backing up a database undo tablespace according to the present invention;
fig. 3 is a schematic diagram of a hardware structure of a backup device for a database undo table space according to the present invention.
Detailed Description
Embodiments of the present invention are described below. However, it is to be understood that the disclosed embodiments are merely examples and that other embodiments may take various and alternative forms. The figures are not necessarily to scale; certain features may be exaggerated or minimized to show details of particular components. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a representative basis for teaching one skilled in the art to variously employ the present invention. As one of ordinary skill in the art will appreciate, various features illustrated and described with reference to any one of the figures may be combined with features illustrated in one or more other figures to produce embodiments that are not explicitly illustrated or described. The combination of features shown provides a representative embodiment for a typical application. However, various combinations and modifications of the features consistent with the teachings of the present invention may be desired for certain specific applications or implementations.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
Based on the above object, an embodiment of the present invention provides a method for backing up a table space of a database undo on the one hand, as shown in fig. 1, including the following steps:
s101, creating an undoo backup table space in the database, and creating a backup table in the undoo backup table space;
s102, monitoring the operations of adding, deleting and modifying the data in the database;
s103, in response to the monitored operations of adding, deleting and modifying the data in the database, writing the front mirror image of the data into a temporary table; and
s104, reading the front mirror image of the data in the temporary table in real time, and writing the front mirror image of the data into the backup table.
In some embodiments, when a database performs an add-drop-and-modify operation to modify data, a front mirror of the data is deposited into the undo table space, and new data is deposited into the data table space. As shown in fig. 2, the data capturing device monitors the adding and deleting actions of the data in the database in real time, captures the front mirror image (data to be modified) of the data modification data and writes the front mirror image into the temporary table, and meanwhile, the data capturing device confirms that the front mirror image of the data is written into the undo table space. The data capture device is a trigger, when data is added or deleted, the front mirror image of the modified data is captured, and the front mirror image of the data is written into a temporary table.
In some embodiments, the front mirror of the data in the temporary table is read by the data copying device and then written into the already created backup table. The data duplicating device is implemented as a storage process, reads data in the temporary table in real time, and then writes it into the backup table that has been created in the undo backup table space in real time.
In some embodiments, after the data copying device writes the data into the backup table, the data copying device deletes the content recorded in the temporary table.
In some embodiments, the temporary table may be located in the undo backup tablespace of the database, or in other tablespaces of the database.
Where technically feasible, the technical features listed above for the different embodiments may be combined with each other or changed, added, omitted, etc. to form further embodiments within the scope of the invention.
It can be seen from the foregoing embodiment that the backup method for the data base undo table space provided by the embodiment of the present invention implements logical backup of undo table space data, greatly improves readability of the undo table space data, and also reduces risk caused by loss of the undo table space data.
In view of the foregoing, another aspect of the embodiments of the present invention provides an embodiment of an apparatus for backing up a table space of a database.
The backup device of the database undo table space comprises a memory and at least one processor, wherein the memory stores a computer program capable of running on the processor, and the processor executes the computer program to execute any one of the methods.
Fig. 3 is a schematic diagram of a hardware structure of an embodiment of a backup apparatus for a database undo table space provided by the present invention.
Taking the computer device shown in fig. 3 as an example, the computer device includes a processor 301 and a memory 302, and may further include: an input device 303 and an output device 304.
The processor 301, the memory 302, the input device 303 and the output device 304 may be connected by a bus or other means, and fig. 3 illustrates the connection by a bus as an example.
The memory 302 is a non-volatile computer-readable storage medium, and can be used for storing non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the backup method of the database undo table space in the embodiment of the present application. The processor 301 executes various functional applications of the server and data processing by running the nonvolatile software programs, instructions and modules stored in the memory 302, that is, implements the backup method of the database undo table space of the above-described method embodiment.
The memory 302 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to a backup method of the database undo table space, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 302 optionally includes memory located remotely from processor 301, which may be connected to a local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 303 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus of the backup method of the database undo table space. The output means 304 may comprise a display device such as a display screen.
Program instructions/modules corresponding to the one or more backup methods for the database undo table spaces are stored in the memory 302, and when executed by the processor 301, perform the backup method for the database undo table spaces in any of the above-described method embodiments.
Any embodiment of the computer device executing the backup method for the database undo table space may achieve the same or similar effects as any corresponding embodiment of the method described above.
Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
In addition, the apparatuses, devices and the like disclosed in the embodiments of the present invention may be various electronic terminal devices, such as a mobile phone, a Personal Digital Assistant (PDA), a tablet computer (PAD), a smart television and the like, or may be a large terminal device, such as a server and the like, and therefore the scope of protection disclosed in the embodiments of the present invention should not be limited to a specific type of apparatus, device. The client disclosed in the embodiment of the present invention may be applied to any one of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of both.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Further, it should be appreciated that the computer-readable storage media (e.g., memory) described herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions described herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The steps of a method or algorithm described in connection with the disclosure herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disk, or the like.
The above-described embodiments are possible examples of implementations and are presented merely for a clear understanding of the principles of the invention. Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of an embodiment of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (6)

1. A backup method of a database undoo table space is characterized by comprising the following steps:
storing the front mirror image of the data into an undo table space;
creating an undo backup table space separated from the undo table space in the database, and creating a backup table in the undo backup table space;
monitoring the operations of adding, deleting and modifying the data in the database;
in response to monitoring the operations of adding, deleting and modifying the data in the database, writing a front mirror image of the data into a temporary table, wherein the temporary table is configured to be stored in the undo backup table space of the database; and
and reading the front mirror image of the data in the temporary table in real time, and writing the front mirror image of the data into the backup table.
2. The method of claim 1, further comprising:
and deleting the front mirror image in the temporary table after the front mirror image of the data is written into the backup table.
3. The method of claim 1, wherein writing the pre-mirror image of the data to a temporary table in response to monitoring the incremental or destructive modification operations on the data in the database comprises:
capturing a front mirror image of data of the adding and deleting operations through a trigger, and writing the front mirror image of the data into a temporary table.
4. A backup apparatus for a database undo tablespace, comprising:
at least one processor; and
a memory storing program code executable by the processor, the program code, when executed by the processor, performing the steps of:
storing the front mirror image of the data into an undo table space;
creating an undo backup table space separated from the undo table space in the database, and creating a backup table in the undo backup table space;
monitoring the operations of adding, deleting and modifying the data in the database;
in response to monitoring the operations of adding, deleting and modifying the data in the database, writing a front mirror image of the data into a temporary table, wherein the temporary table is configured to be stored in the undo backup table space of the database; and
and reading the front mirror image of the data in the temporary table in real time, and writing the front mirror image of the data into the backup table.
5. The apparatus of claim 4, further comprising:
and deleting the front mirror image in the temporary table after the front mirror image of the data is written into the backup table.
6. The apparatus of claim 4, wherein writing the pre-mirror image of the data to a temporary table in response to monitoring the incremental or destructive modification operations on the data in the database comprises:
capturing a front mirror image of data of the adding and deleting operations through a trigger, and writing the front mirror image of the data into a temporary table.
CN201910636866.4A 2019-07-15 2019-07-15 Backup method and device for database undo table space Active CN110413616B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910636866.4A CN110413616B (en) 2019-07-15 2019-07-15 Backup method and device for database undo table space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910636866.4A CN110413616B (en) 2019-07-15 2019-07-15 Backup method and device for database undo table space

Publications (2)

Publication Number Publication Date
CN110413616A CN110413616A (en) 2019-11-05
CN110413616B true CN110413616B (en) 2022-04-22

Family

ID=68361423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910636866.4A Active CN110413616B (en) 2019-07-15 2019-07-15 Backup method and device for database undo table space

Country Status (1)

Country Link
CN (1) CN110413616B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115328924B (en) * 2022-10-17 2023-03-21 北京奥星贝斯科技有限公司 Method and device for creating table space, storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104881418A (en) * 2014-02-28 2015-09-02 阿里巴巴集团控股有限公司 Method and device for quickly reclaiming rollback space in MySQL
CN106126403A (en) * 2016-06-16 2016-11-16 北京中亦安图科技股份有限公司 Oracle database failure analysis methods and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104881418A (en) * 2014-02-28 2015-09-02 阿里巴巴集团控股有限公司 Method and device for quickly reclaiming rollback space in MySQL
CN106126403A (en) * 2016-06-16 2016-11-16 北京中亦安图科技股份有限公司 Oracle database failure analysis methods and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"7.5管理撤销表空间";李明俊;《Oracle11g数据库与应用开发教程》;20130331;第178-180页 *

Also Published As

Publication number Publication date
CN110413616A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
TWI502384B (en) File tracking methods and network communication devices using the same
CN111045603B (en) Bad block replacement method and device for solid state disk
US9519673B2 (en) Management of I/O and log size for columnar database
CN102541691B (en) Log check point recovery method applied to memory data base OLTP (online transaction processing)
CN111240595A (en) Method, system, equipment and medium for optimizing storage cache
US10031948B1 (en) Idempotence service
US20090327295A1 (en) Maintenance of exo-file system metadata on removable storage device
US20210182160A1 (en) System and method for generating file system and block-based incremental backups using enhanced dependencies and file system information of data blocks
CN103049539A (en) Method and device for storing file data in file system
WO2023040200A1 (en) Data deduplication method and system, and storage medium and device
CN110647423B (en) Method, device and readable medium for creating storage volume mirror image based on application
CN110413616B (en) Backup method and device for database undo table space
CN110688342A (en) Method, device and readable medium for decompressing file in Linux system
CN112016028A (en) Information recording method and device, and information storage method, device and system
WO2017113317A1 (en) File editing method and file editor
CN111309264B (en) Method, system, device and medium for making directory quota compatible with snapshot
CN110780855A (en) Method, device and system for uniformly managing and controlling interface
CN107341203A (en) The access control and optimiged index method and apparatus of a kind of distributed search engine
CN111176666B (en) BIOS + ME mirror image refreshing method, system, equipment and readable medium
CN110059087B (en) Data attribute identification method, device and equipment in block chain type account book
CN111274140A (en) Device, method and server for automatic case execution site recovery
CN107562790B (en) Method and system for realizing batch warehousing of data processing
CN110879760A (en) Unified storage system and method and electronic equipment
CN110851398A (en) Garbage data recovery processing method and device and electronic equipment
CN111723007B (en) Test case merging method, system, equipment and medium

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