CN116975166A - Method and device for processing archiving space of Oracle database - Google Patents

Method and device for processing archiving space of Oracle database Download PDF

Info

Publication number
CN116975166A
CN116975166A CN202310964806.1A CN202310964806A CN116975166A CN 116975166 A CN116975166 A CN 116975166A CN 202310964806 A CN202310964806 A CN 202310964806A CN 116975166 A CN116975166 A CN 116975166A
Authority
CN
China
Prior art keywords
archive
space
log
storage path
oracle database
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.)
Pending
Application number
CN202310964806.1A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202310964806.1A priority Critical patent/CN116975166A/en
Publication of CN116975166A publication Critical patent/CN116975166A/en
Pending legal-status Critical Current

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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • 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
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0682Tape device

Landscapes

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

Abstract

The application discloses a processing method and a processing device for an Oracle database archiving space, which acquire the utilization rate of the Oracle database archiving space; when the utilization rate is larger than the preset utilization rate, switching the storage path of the archive log from the original storage path to the NAS storage path; backing up archive logs in an archive space to a tape library; deleting the archive log in the archive space after the archive log in the archive space is backed up; switching the storage path of the archive log from the NAS storage path to the original storage path; the archive log in NAS storage is backed up to tape library. The storage path of the archive log is switched from the original storage path to the NAS storage path, so that the new archive log is not lost while the archive space is backed up, and the cost of the backup of the Oracle database can be reduced under the condition of ensuring the normal operation of the Oracle database due to the fact that the NAS storage is adopted, and the cost of the backup of the Oracle database is reduced.

Description

Method and device for processing archiving space of Oracle database
Technical Field
The application relates to the field of database backup, in particular to a processing method and a processing device for an Oracle database archiving space.
Background
The database is a warehouse for storing application data and is the core of the whole application system. In order to protect the database from various faults, the database needs to be backed up periodically, so that when the data is lost or damaged, the database is recovered in time to recover the data.
The database backup comprises an archive log backup, wherein the archive log is used for storing incremental information of the database, the archive log backup has a crucial effect on the recovery of the database, the archive space is used for storing the archive log, and if the archive space is full, the database cannot be subjected to the operations of adding, deleting and modifying.
At present, in order to avoid the problem of insufficient archiving space, enough archiving space is applied for each set of databases. However, the Oracle databases generally use SAN (Storage AreaNetwork ) storage arrays, which is expensive, and if the number of Oracle databases is larger, the more SAN storage arrays are needed, so that the cost of the Oracle databases is higher.
Therefore, how to reduce the cost of the Oracle database backup becomes a problem to be solved in the art.
Disclosure of Invention
The application provides a processing method and a processing device for an Oracle database archiving space, and aims to reduce cost of Oracle database backup.
In order to achieve the above object, the present application provides the following technical solutions:
a processing method of an Oracle database archiving space comprises the following steps:
acquiring the utilization rate of an Oracle database archiving space;
when the utilization rate is larger than the preset utilization rate, switching the storage path of the archive log from the original storage path to the NAS storage path; the original storage path indicates a path of the archive space;
calling a backup script to backup the archive log in the archive space to a tape library;
deleting the archive log in the archive space after the archive log in the archive space is backed up, so as to obtain an idle archive space;
switching the storage path of the archive log from the NAS storage path to the original storage path;
calling the backup script to backup the archive log in the NAS memory to the tape library;
and deleting the archive log in the NAS storage after the archive log backup in the NAS storage is completed.
Optionally, the obtaining the usage rate of the archive space of the Oracle database includes:
when the Oracle database archiving space is a local file system, acquiring the utilization rate of the local file system through a df command;
when the archiving space of the Oracle database is an ASM disk group, the utilization rate of the ASM disk group is obtained through a preset command.
Optionally, the method further comprises:
disposing the processing script on a server of an Oracle database;
creating a timing task and calling the processing script according to the timing task; and the timing task is a task for calling the processing script every preset time.
Correspondingly, the obtaining the usage rate of the Oracle database archiving space comprises the following steps: and calling the processing script at regular time, and acquiring the utilization rate of the archiving space of the Oracle database based on the processing script.
Optionally, after the obtaining the usage rate of the archive space of the Oracle database, the method further includes:
and when the utilization rate is not greater than a preset utilization rate, storing an archive log into the archive space until the utilization rate is greater than the preset utilization rate.
Optionally, before the switching the original storage path of the archive log to the NAS storage path when the usage rate is greater than the preset usage rate, the method further includes:
acquiring each NAS memory;
for each NAS memory, when receiving a permission request, opening the access permission and the read-write permission of the NAS memory for an Oracle database host;
when receiving a mounting instruction, mounting the NAS memory to the Oracle database host; the mount instruction indicates an instruction to mount the NAS memory to the Oracle database host.
Optionally, the method further comprises:
storing the information that the archive log is backed up to an alarm log;
when detecting that abnormal information exists in the alarm log, generating alarm information based on the abnormal information, and sending the alarm information to a user; the anomaly information indicates ERROR information.
A processing device for an Oracle database archive space, comprising:
the acquisition unit is used for acquiring the utilization rate of the archiving space of the Oracle database;
the first switching unit is used for switching the storage path of the archive log from the original storage path to the NAS storage path when the utilization rate is larger than the preset utilization rate; the original storage path indicates a path of the archive space;
the first backup unit is used for calling a backup script to backup the archive log in the archive space to a tape library;
the first deleting unit is used for deleting the archive log in the archive space after the archive log in the archive space is backed up, so as to obtain an idle archive space;
the second switching unit is used for switching the storage path of the archive log from the NAS storage path to the original storage path;
the second backup unit is used for calling the backup script and backing up the archive log in the NAS memory to the tape library;
and the second deleting unit is used for deleting the archive log in the NAS after the archive log backup in the NAS is completed.
Optionally, the acquiring unit is specifically configured to:
when the Oracle database archiving space is a local file system, acquiring the utilization rate of the local file system through a df command;
when the archiving space of the Oracle database is an ASM disk group, the utilization rate of the ASM disk group is obtained through a preset command.
Optionally, the method further comprises:
the deployment unit is used for deploying the processing script on a server of the Oracle database;
the creation unit is used for creating a timing task and calling the processing script according to the timing task; and the timing task is a task for calling the processing script every preset time.
Correspondingly, the acquisition unit is specifically configured to: and calling the processing script at regular time, and acquiring the utilization rate of the archiving space of the Oracle database based on the processing script.
Optionally, the method further comprises:
and the storage unit is used for storing the archiving log into the archiving space when the use rate is not greater than the preset use rate until the use rate is greater than the preset use rate.
According to the technical scheme provided by the application, the utilization rate of the archiving space of the Oracle database is obtained; when the utilization rate is larger than the preset utilization rate, switching the storage path of the archive log from the original storage path to the NAS storage path; backing up archive logs in an archive space to a tape library; deleting the archive log in the archive space after the archive log in the archive space is backed up; switching the storage path of the archive log from the NAS storage path to the original storage path; the archive log in NAS storage is backed up to tape library. The storage path of the archive log is switched from the original storage path to the NAS storage path, so that the new archive log is not lost while the archive space is backed up, and the cost of the backup of the Oracle database can be reduced under the condition of ensuring the normal operation of the Oracle database due to the fact that the NAS storage is adopted, and the cost of the backup of the Oracle database is reduced.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a processing method of an Oracle database archiving space provided by an embodiment of the application;
FIG. 2 is a flowchart of a method for obtaining an archive space utilization rate according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for mounting a NAS memory according to an embodiment of the present application;
fig. 4 is a schematic diagram of a processing device for an Oracle database archiving space according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
As shown in fig. 1, a flowchart of a method for processing an Oracle database archiving space according to an embodiment of the present application includes:
s101: the usage of the Oracle database archive space is obtained.
The archiving space is used for storing archiving logs; the archive log stores incremental information of a database (e.g., an Oracle database).
It should be noted that, since different Oracle databases may use different storage locations as an archiving space, the method for acquiring the archiving space adopted by different storage locations is different, and some Oracle databases use a local file system as the archiving space, and some Oracle databases use ASM disk sets as the archiving space, so that the methods for acquiring the local file system and the ASM disk sets are different.
Optionally, in another embodiment of the present application, a specific implementation of step S101 includes the following steps:
when the Oracle database archiving space is the local file system, the use rate of the local file system is obtained through the df command.
It will be appreciated that since the df command is a Linux command, the disk space occupation of the file system can be checked, and thus, the use rate of the local system can be obtained through the df command.
When the archiving space of the Oracle database is the ASM disk group, the utilization rate of the ASM disk group is obtained through a preset command.
The specific expression form of the preset command is as follows:
it should be noted that, the ARCH disk set of the ASM is used to store the archive space, and the usage rate of the ASM disk set is obtained through a preset command, that is, the usage rate of the ARCH disk set is obtained through a preset command.
Optionally, before obtaining the usage rate of the archive space of the Oracle database, a processing script needs to be deployed, and then the usage rate of the archive space of the Oracle database is obtained through the processing script, so in another embodiment of the present application, a method for obtaining the usage rate of the archive space is provided, as shown in fig. 2, including the following steps:
s201: the processing script is deployed on a server of the Oracle database.
Wherein the processing script includes, but is not limited to: arch_full_auto over.
It will be appreciated that the processing script is deployed at the server of the Oracle database so that subsequent calls to the processing script complete the backup of the archive log.
S202: and creating a timing task and calling a processing script according to the timing task.
The timing task is a task for calling a processing script every preset time.
Alternatively, the timed task may be created by a crontab command.
It will be understood that the time of the timing task may be set according to the actual situation, and may be set to a task of calling the processing script every one minute, or may be set to a task of calling the processing script every five minutes, which is not particularly limited herein, and in the embodiment of the present application, the processing script is preferably called every one minute.
Accordingly, the processing script is called first, and the usage rate of the archive space of the Oracle database can be obtained through the processing script, so that another specific embodiment of step S101 includes the following steps:
and (5) regularly calling a processing script, and acquiring the utilization rate of the archiving space of the Oracle database based on the processing script.
It can be understood that the processing script is invoked regularly, and the utilization rate of the archive space of the Oracle database is obtained based on the processing script, so that corresponding operations are executed according to the utilization rate of the archive space to complete backup of the archive log.
If the existing processing script is found to be in an execution state, the processing script is not called again, and repeated execution is avoided.
Optionally, after obtaining the usage rate of the archive space of the Oracle database, it is further required to determine whether the usage rate is greater than a preset usage rate, and if the usage rate is not greater than the preset usage rate, executing the corresponding steps, so in another embodiment of the present application, a method for storing an archive log is provided, which includes the following steps:
and when the utilization rate is not greater than the preset utilization rate, storing the archive log into an archive space until the utilization rate is greater than the preset utilization rate.
It will be appreciated that when the usage rate is not greater than the preset usage rate, then it is indicated that the archive space is still free at this time, and the archive log may be continuously stored, so that the archive log is stored in the archive space until the usage rate is greater than the preset usage rate.
S102: when the utilization rate is larger than the preset utilization rate, switching the storage path of the archive log from the original storage path to the NAS storage path.
Wherein the original storage path indicates a path of the archive space.
Alternatively, the preset usage rate may be 90%.
Alternatively, the NAS storage path may be: the/oracle/db_archtmp directory: log_archive_dest_1= '/oracle/db_archtmp' is set.
It can be understood that when the usage rate is greater than the preset usage rate, it is indicated that the usage space of the archive space may be insufficient at this time, and if the archive space is still stored in the archive space, once the archive space is full, the Oracle database cannot perform the read-write operation, resulting in a stop of the service, so that the storage path of the archive log needs to be switched from the original storage path to the NAS storage path, so that the new archive log is stored in the NAS storage through the NAS storage path.
Optionally, when the usage rate is greater than the preset usage rate, before the storage path of the archive log is switched from the original storage path to the NAS storage path, the NAS storage needs to be mounted on the Oracle database host before the switching is performed, so in another embodiment of the present application, a method for mounting the NAS storage is provided, as shown in fig. 3, including the following steps:
s301: each NAS storage is acquired.
In the embodiment of the present application, the NAS storage employed is gold-level NAS storage (capacity 5 TB), and at least 2 NAS storages are acquired to ensure high availability.
It can be understood that the number of NAS storages is determined according to the number of the sets of the Oracle databases, when the number of the sets of the Oracle databases is less than 200, the number of NAS storages is 2, and when the number of the sets of the Oracle databases is not less than 200, the number of NAS storages can be determined by referring to the calculation method in the formula (1).
Quantity of NAS memory = 2+ (Oracle database set number-200)/2 (1)
In the formula (1), when the NAS number is not an integer, the number of NAS storages is determined by rounding.
S302: for each NAS memory, when receiving the permission request, opening the access permission and the read-write permission of the NAS memory for the Oracle database host.
Specifically, the number of NAS memories is marked as alpha, and if alpha is 5, 5 NAS memories are opened for the Oracle database host computer for access rights and read-write rights.
S303: and when receiving the mounting instruction, mounting the NAS memory to an Oracle database host.
Wherein the mount instruction indicates an instruction to mount the NAS memory to the Oracle database host.
It should be noted that, placing the NAS storage into an array, mounting one NAS storage on each Oracle database host, and mounting the NAS storage to the Oracle database host specifically includes:
modulo alpha according to the last 1-bit number of the IP address, and marking the result as beta;
taking the (beta+1) th NAS address from the NAS address array;
and carrying out NAS file system mounting, wherein the mounting point is unified as/oracle/db_archtmp.
Optionally, if the NAS storage is not successfully mounted to the Oracle database host, NAS storage mounting may be sequentially attempted according to the NAS array sequence, and the specific process of the mounting is as follows:
for example, 5 NAS memories are applied for, respectively:
192.168.2.11:/vol/BAK_NAS1
192.168.2.12:/vol/BAK_NAS2
192.168.2.13:/vol/BAK_NAS3
192.168.2.14:/vol/BAK_NAS4
192.168.2.15:/vol/BAK_NAS5
the sequential mounting process is as follows: the method comprises the steps of firstly attempting to mount 192.168.2.11:/vol/BAK_NAS1, terminating if the mounting is successful, and continuing to attempt to mount 192.168.2.12:/vol/BAK_NAS2 if the mounting is unsuccessful, and so on until all 5 NAS memories are successfully mounted.
S103: and calling a backup script to backup the archive log in the archive space to the tape library.
Wherein, the backup script includes, but is not limited to: the RMAN backs up the script.
It will be appreciated that, since the tape library is a system for data storage and backup, invoking the RMAN backup script will back up the archive log in the archive space into the tape library.
S104: and deleting the archive log in the archive space after the archive log backup in the archive space is completed, so as to obtain an idle archive space.
After the archive log backup in the angelica archive space is completed, the fact that the corresponding archive log can be obtained from the tape library later is described, and at this time, the archive log in the archive space can be deleted to obtain the space archive space, so that the subsequent archive log is stored in the space archive space.
S105: and switching the storage path of the archive log from the NAS storage path to the original storage path.
Since the archive log of the archive space is deleted, there is no case where the archive space is full because the archive log is continuously stored in the archive space, and therefore, the storage path of the archive log is switched from the NAS storage path to the original storage path, and the subsequent archive log is stored in the space archive space.
S106: and calling a backup script to backup the archive log in the NAS memory to the tape library.
The archive log in the NAS memory is backed up to the tape library, namely, the archive log under the/oracle/db_archtmp directory is backed up to the tape library.
S107: and deleting the archive log in the NAS storage after the archive log backup in the NAS storage is completed.
After the archive log backup in the NAS memory is completed, deleting the archive log in the NAS memory, and releasing the space of the NAS memory so that backup failure can not be caused by full space of the NAS memory when the archive log is backed up later.
Optionally, after the archive log backup in the NAS storage is completed, the archive log completed backup information needs to be stored in the alarm log so as to monitor whether the alarm log is abnormal or not, so in another embodiment of the present application, a method for generating alarm information is provided, which includes the following steps:
and storing the information that the archiving log is backed up completely into the alarm log.
The alert log includes, but is not limited to, an alert log.
Optionally, whether the archive log is backed up or not, the backup processing procedure needs to be stored in the alarm log, that is, if the archive log fails to be backed up, the information of the backup failure of the archive log needs to be stored in the alarm log.
When detecting that abnormal information exists in the alarm log, generating alarm information based on the abnormal information, and sending the alarm information to a user.
Wherein the anomaly information indicates ERROR information, e.g., the ERROR information is: ERROR archlog space is not enough, the auto management script changed the archlog directory to/oracle/db_archtmp, please pay attention.
It should be noted that, since the keyword monitoring is deployed in advance in the Oracle database, whether abnormal information exists can be monitored by the keyword.
Optionally, if the presence of the abnormal information is detected, alarm information (for example, the NAS memory is abnormal) is generated based on the abnormal information, and the alarm information is sent to the user in the form of a short message.
In summary, when the usage rate is greater than the preset usage rate, the storage path of the archive log is switched from the original storage path to the NAS storage path, the backup script is called to backup the archive log in the archive space to the tape library, after the archive log backup in the angelica archive space is completed, the archive log in the archive space is deleted to obtain the free archive space, the storage path of the archive log is switched from the NAS storage path to the original storage path, the backup script is called to backup the archive log in the NAS storage to the tape library, in the embodiment of the application, the storage path of the archive log is switched from the original storage path to the NAS storage path, so that the new archive log is not lost while the archive space is backed up.
For the content of a method for processing an Oracle database archive space provided by the embodiment of the present application, the method for processing an Oracle database archive space is illustrated below in conjunction with a specific application scenario (including a process A1 to a process A7).
It should be noted that, the timing task adopted by the application scenario is: tasks of the processing script are invoked at regular intervals of 1 minute.
A1: the processing script is called every 1 minute, and the utilization rate of the archiving space of the Oracle database is obtained based on the processing script.
A2: when the utilization rate is larger than the preset utilization rate, the storage path of the archive log is switched from the original storage path to the NAS storage path, so that a new archive log is stored in the NAS storage.
A3: and calling a backup script to backup the archive log in the archive space to the tape library.
A4: and deleting the archive log in the archive space after the archive log backup in the archive space is completed, so as to obtain an idle archive space.
A5: and switching the storage path of the archive log from the NAS storage path to the original storage path so that the subsequent archive log is stored in the free archive space.
A6: and calling a backup script to backup the archive log in the NAS memory to the tape library.
A7: and deleting the archive log in the NAS storage after the archive log backup in the NAS storage is completed.
In summary, when the usage rate is greater than the preset usage rate, the storage path of the archive log is switched from the original storage path to the NAS storage path, so that the new archive log is stored in the NAS storage, the backup script is called to backup the archive log in the archive space to the tape library, after the archive log backup in the angelica archive space is completed, the archive log in the archive space is deleted to obtain an idle archive space, the storage path of the archive log is switched from the NAS storage path to the original storage path, so that the subsequent archive log is stored in the idle archive space, the backup script is called, and the archive log in the NAS storage is backed up to the tape library.
As shown in fig. 4, an architecture diagram of a processing device for an Oracle database archiving space according to an embodiment of the present application includes: an acquisition unit 100, a first switching unit 200, a first backup unit 300, a first deletion unit 400, a second switching unit 500, a second backup unit 600, and a second deletion unit 700.
An obtaining unit 100, configured to obtain a usage rate of an Oracle database archiving space.
The acquisition unit 100 is specifically configured to: when the archiving space of the Oracle database is a local file system, acquiring the utilization rate of the local file system through a df command; when the archiving space of the Oracle database is the ASM disk group, the utilization rate of the ASM disk group is obtained through a preset command.
A first switching unit 200, configured to switch the storage path of the archive log from the original storage path to the NAS storage path when the usage rate is greater than a preset usage rate; the original storage path indicates the path of the archive space.
The first backup unit 300 is configured to call a backup script to backup an archive log in an archive space to a tape library.
The first deleting unit 400 is configured to delete the archive log in the archive space after the archive log backup in the archive space is completed, so as to obtain an empty archive space.
And a second switching unit 500, configured to switch the storage path of the archive log from the NAS storage path to the original storage path.
And a second backup unit 600, configured to call a backup script and backup the archive log in the NAS storage to the tape library.
And a second deleting unit 700, configured to delete the archive log in the NAS storage after the archive log backup in the NAS storage is completed.
In summary, when the usage rate is greater than the preset usage rate, the storage path of the archive log is switched from the original storage path to the NAS storage path, the backup script is called to backup the archive log in the archive space to the tape library, after the archive log backup in the angelica archive space is completed, the archive log in the archive space is deleted to obtain the free archive space, the storage path of the archive log is switched from the NAS storage path to the original storage path, the backup script is called to backup the archive log in the NAS storage to the tape library, in the embodiment of the application, the storage path of the archive log is switched from the original storage path to the NAS storage path, so that the new archive log is not lost while the archive space is backed up.
Preferably, in combination with the content shown in fig. 4, the processing device further comprises: a deployment unit and a creation unit.
And the deployment unit is used for deploying the processing script on a server of the Oracle database.
The creating unit is used for creating a timing task and calling a processing script according to the timing task; the timing task is a task for calling a processing script every preset time.
Accordingly, the acquiring unit 100 is specifically configured to: and (5) regularly calling a processing script, and acquiring the utilization rate of the archiving space of the Oracle database based on the processing script.
Preferably, in combination with the content shown in fig. 4, the processing device further comprises: and the storage unit is used for storing the archiving log into the archiving space when the utilization rate is not greater than the preset utilization rate until the utilization rate is greater than the preset utilization rate.
Preferably, in combination with the content shown in fig. 4, the processing device further comprises: NAS memory acquisition unit, provisioning unit, and mount unit.
And the NAS memory acquisition unit is used for acquiring each NAS memory.
The opening unit is used for opening the access right and the read-write right of the NAS storage for the Oracle database host when receiving the right permission request for each NAS storage.
The mounting unit is used for mounting the NAS memory to the Oracle database host when receiving the mounting instruction; the mount instruction indicates an instruction to mount the NAS memory to the Oracle database host.
Preferably, in combination with the content shown in fig. 4, the processing device further comprises: a storage unit and a generation unit.
And the storage unit is used for storing the information that the archiving log is backed up to the alarm log.
The generation unit is used for generating alarm information based on the abnormal information when detecting that the abnormal information exists in the alarm log and sending the alarm information to a user; the anomaly information indicates ERROR information.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for processing an Oracle database archive space, comprising:
acquiring the utilization rate of an Oracle database archiving space;
when the utilization rate is larger than the preset utilization rate, switching the storage path of the archive log from the original storage path to the NAS storage path; the original storage path indicates a path of the archive space;
calling a backup script to backup the archive log in the archive space to a tape library;
deleting the archive log in the archive space after the archive log in the archive space is backed up, so as to obtain an idle archive space;
switching the storage path of the archive log from the NAS storage path to the original storage path;
calling the backup script to backup the archive log in the NAS memory to the tape library;
and deleting the archive log in the NAS storage after the archive log backup in the NAS storage is completed.
2. The method of claim 1, wherein said obtaining usage of Oracle database archive space comprises:
when the Oracle database archiving space is a local file system, acquiring the utilization rate of the local file system through a df command;
when the archiving space of the Oracle database is an ASM disk group, the utilization rate of the ASM disk group is obtained through a preset command.
3. The method as recited in claim 1, further comprising:
disposing the processing script on a server of an Oracle database;
creating a timing task and calling the processing script according to the timing task; the timing task is a task for calling the processing script every preset time;
correspondingly, the obtaining the usage rate of the Oracle database archiving space comprises the following steps: and calling the processing script at regular time, and acquiring the utilization rate of the archiving space of the Oracle database based on the processing script.
4. The method of claim 1, further comprising, after said obtaining the usage of Oracle database archive space:
and when the utilization rate is not greater than a preset utilization rate, storing an archive log into the archive space until the utilization rate is greater than the preset utilization rate.
5. The method of claim 1, wherein before switching the original storage path of the archive log to the NAS storage path when the usage rate is greater than a preset usage rate, further comprising:
acquiring each NAS memory;
for each NAS memory, when receiving a permission request, opening the access permission and the read-write permission of the NAS memory for an Oracle database host;
when receiving a mounting instruction, mounting the NAS memory to the Oracle database host; the mount instruction indicates an instruction to mount the NAS memory to the Oracle database host.
6. The method as recited in claim 1, further comprising:
storing the information that the archive log is backed up to an alarm log;
when detecting that abnormal information exists in the alarm log, generating alarm information based on the abnormal information, and sending the alarm information to a user; the anomaly information indicates ERROR information.
7. A processing device for an Oracle database archive space, comprising:
the acquisition unit is used for acquiring the utilization rate of the archiving space of the Oracle database;
the first switching unit is used for switching the storage path of the archive log from the original storage path to the NAS storage path when the utilization rate is larger than the preset utilization rate; the original storage path indicates a path of the archive space;
the first backup unit is used for calling a backup script to backup the archive log in the archive space to a tape library;
the first deleting unit is used for deleting the archive log in the archive space after the archive log in the archive space is backed up, so as to obtain an idle archive space;
the second switching unit is used for switching the storage path of the archive log from the NAS storage path to the original storage path;
the second backup unit is used for calling the backup script and backing up the archive log in the NAS memory to the tape library;
and the second deleting unit is used for deleting the archive log in the NAS after the archive log backup in the NAS is completed.
8. The apparatus of claim 7, wherein the acquisition unit is specifically configured to:
when the Oracle database archiving space is a local file system, acquiring the utilization rate of the local file system through a df command;
when the archiving space of the Oracle database is an ASM disk group, the utilization rate of the ASM disk group is obtained through a preset command.
9. The apparatus as recited in claim 7, further comprising:
the deployment unit is used for deploying the processing script on a server of the Oracle database;
the creation unit is used for creating a timing task and calling the processing script according to the timing task; the timing task is a task for calling the processing script every preset time;
correspondingly, the acquisition unit is specifically configured to: and calling the processing script at regular time, and acquiring the utilization rate of the archiving space of the Oracle database based on the processing script.
10. The apparatus as recited in claim 7, further comprising:
and the storage unit is used for storing the archiving log into the archiving space when the use rate is not greater than the preset use rate until the use rate is greater than the preset use rate.
CN202310964806.1A 2023-08-02 2023-08-02 Method and device for processing archiving space of Oracle database Pending CN116975166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310964806.1A CN116975166A (en) 2023-08-02 2023-08-02 Method and device for processing archiving space of Oracle database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310964806.1A CN116975166A (en) 2023-08-02 2023-08-02 Method and device for processing archiving space of Oracle database

Publications (1)

Publication Number Publication Date
CN116975166A true CN116975166A (en) 2023-10-31

Family

ID=88471120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310964806.1A Pending CN116975166A (en) 2023-08-02 2023-08-02 Method and device for processing archiving space of Oracle database

Country Status (1)

Country Link
CN (1) CN116975166A (en)

Similar Documents

Publication Publication Date Title
CN101706802B (en) Method, device and sever for writing, modifying and restoring data
CN106776130B (en) Log recovery method, storage device and storage node
CN107357688B (en) Distributed system and fault recovery method and device thereof
EP3399692A1 (en) Method and apparatus for upgrading distributed storage system
US10628298B1 (en) Resumable garbage collection
CN103761165A (en) Log backup method and log backup device
CN114090344B (en) Method, device, equipment and medium for deleting backup resources of container cluster
US7644318B2 (en) Method and system for a failover procedure with a storage system
CN110620798B (en) Control method, system, equipment and storage medium for FTP connection
CN108352995B (en) SMB service fault processing method and storage device
CN110297822B (en) Block chain-oriented key management method, device, equipment and storage medium
CN115686932A (en) Backup set file recovery method and device and computer equipment
CN115658390A (en) Container disaster tolerance method, system, device, equipment and computer readable storage medium
US20210385406A1 (en) Device state monitoring method and apparatus
CN110972497A (en) Disaster recovery method and device for virtualization platform
CN110737716A (en) data writing method and device
CN116975166A (en) Method and device for processing archiving space of Oracle database
CN105787135A (en) Method and device for backing up database logs
CN114003612A (en) Processing method and processing system for abnormal conditions of database
CN114528151A (en) Data backup and restoration method, device, equipment and medium based on control station
CN109426589B (en) File repair method and device
CN108874918B (en) Data processing device, database all-in-one machine and data processing method thereof
CN101833484B (en) Video backup method and system of vehicle-mounted digital video recorder and video recorder
CN113935045A (en) User data recovery method, device, terminal and computer storage medium
JP2004078437A (en) Method and system for duplexing file system management information

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