CN113655967A - Method and device for deleting disk, electronic equipment and computer storage medium - Google Patents

Method and device for deleting disk, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN113655967A
CN113655967A CN202110969426.8A CN202110969426A CN113655967A CN 113655967 A CN113655967 A CN 113655967A CN 202110969426 A CN202110969426 A CN 202110969426A CN 113655967 A CN113655967 A CN 113655967A
Authority
CN
China
Prior art keywords
disk
deleted
user
deleting
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
CN202110969426.8A
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 CN202110969426.8A priority Critical patent/CN113655967A/en
Publication of CN113655967A publication Critical patent/CN113655967A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • 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]

Landscapes

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

Abstract

The invention provides a method and a device for deleting a disk, electronic equipment and a computer storage medium, wherein the method comprises the steps of acquiring basic information of the disk to be deleted, which is input by a user, when the user who successfully logs in is determined to meet the requirement of operating a database; determining whether the disk to be deleted meets the deletion condition or not based on the acquired existing disk information of the disk to be deleted; if so, generating a disc deletion command script corresponding to the basic information according to a preset format; and executing the disk deleting command script to delete the disk to be deleted. In the scheme, manual checking operation is not needed, and whether the disk to be deleted meets the deletion condition or not is determined according to the existing disk information of the disk to be deleted; and generating a corresponding disk deleting command script according to a preset format when the disk to be deleted is determined to meet the deleting condition, so as to delete the disk to be deleted based on the disk deleting command script. By the method, the condition of deleting the wrong disk can be avoided, and the checking efficiency can be improved.

Description

Method and device for deleting disk, electronic equipment and computer storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for deleting a disk, an electronic device, and a computer storage medium.
Background
An Automatic Storage Management (ASM) disk for relational Management (Oracle) database deletion is a common change operation in database daily maintenance.
In the process of deleting the ASM disk, the ASM disk to be deleted needs to be checked manually, and after the check, the operation of deleting the ASM disk is performed. The efficiency of checking by a manual mode is low, and the condition of deleting an ASM disk is easy to occur, so that the normal operation of the database is influenced.
In view of this, how to avoid the situation of deleting the ASM disk by mistake and improve the checking efficiency is a problem to be solved urgently at present.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for deleting a disk, an electronic device, and a computer storage medium, so as to solve the problems that an ASM disk is easily deleted by mistake and the checking efficiency is low in the prior art.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
the first aspect of the embodiments of the present invention shows a method for deleting a disk, where the method includes:
when the successful login user is determined to meet the requirement of operating the database, acquiring basic information of a disk to be deleted, which is input by the user;
acquiring the existing disk information of the disk to be deleted based on the basic information of the disk to be deleted;
determining whether the disk to be deleted meets the deletion condition or not based on the existing disk information;
if yes, generating a disc deletion command script corresponding to the basic information according to a preset format;
and executing the disk deleting command script to delete the disk to be deleted.
Optionally, the determining that the user who successfully logs in meets the requirement of operating the database includes:
determining whether the user authority of the successfully logged-in user is a management operation authority;
if yes, judging whether a process with the same name related to the user exists or not;
if not, judging whether the quantity of the ASM examples meets the preset quantity or not;
and if so, determining that the successfully logged-in user meets the requirement of operating the database.
Optionally, the determining, based on the existing disk information, whether the disk to be deleted meets the deletion condition includes:
judging whether the number of the failure groups in the existing disk information accords with a preset numerical range or not;
if yes, judging whether the size and the number of the disks in the existing disk information meet preset rules or not;
if the data are consistent with the data, judging whether the space data of the disk to be deleted is smaller than the corresponding disk group free space, wherein the disk group free space is determined based on the storage area network SAN disk information acquired from the database;
if the number of the disks to be deleted is smaller than the preset number, determining that the disks to be deleted meet the deletion condition.
Optionally, after generating the delete command script corresponding to the basic information according to a preset format, the method further includes:
and generating a command log corresponding to the disc deleting command script based on the disc deleting command script.
A second aspect of the embodiments of the present invention shows a disk deletion apparatus, where the apparatus includes:
the first acquisition unit is used for acquiring basic information of the disk to be deleted, which is input by a user, when the user who successfully logs in is determined to meet the requirement of operating a database;
a second obtaining unit, configured to obtain existing disk information of the disk to be deleted based on the basic information of the disk to be deleted;
the processing unit is used for determining whether the disk to be deleted accords with the deletion condition or not based on the existing disk information, and if so, the generating unit is executed;
the first generating unit is used for generating a disc deletion command script corresponding to the basic information according to a preset format;
and the deleting unit is used for executing the disk deleting command script so as to delete the disk to be deleted.
Optionally, the obtaining unit that determines that the user who successfully logs in meets the requirement of the operation database is specifically configured to: determining whether the user authority of the successfully logged-in user is a management operation authority; if yes, judging whether a process with the same name related to the user exists or not; if not, judging whether the quantity of the ASM examples meets the preset quantity or not; and if so, determining that the successfully logged-in user meets the requirement of operating the database.
Optionally, the processing unit includes:
the first judging module is used for judging whether the number of the failure groups in the existing disk information accords with a preset numerical range, and if so, the second judging module is executed;
the second judging module is used for judging whether the size and the number of the disks in the existing disk information accord with preset rules or not, and if so, executing a third judging module;
the third judging module is used for judging whether the space data of the disk to be deleted is smaller than the corresponding disk group free space, and if so, executing the determining module, wherein the disk group free space is determined based on the storage area network SAN disk information acquired from the database;
and the determining module is used for determining that the disk to be deleted meets the deletion condition.
Optionally, the method further includes:
and the second generation unit is used for generating a command log corresponding to the disc deletion command script based on the disc deletion command script after the first generation unit is executed.
A third aspect of the embodiment of the present invention shows that the electronic device is configured to run a program, where the method for deleting a disk as shown in the first aspect of the embodiment of the present invention is performed when the program runs.
A fourth aspect of the embodiments of the present invention shows a computer storage medium, where the storage medium includes a storage program, and when the program runs, a device in which the storage medium is located is controlled to execute the disk deletion method shown in the first aspect of the embodiments of the present invention.
Based on the method, the device, the electronic equipment and the computer storage medium for deleting the disk provided by the embodiment of the invention, the method comprises the following steps: when the successful login user is determined to meet the requirement of operating the database, acquiring basic information of a disk to be deleted, which is input by the user; acquiring the existing disk information of the disk to be deleted based on the basic information of the disk to be deleted; determining whether the disk to be deleted meets the deletion condition or not based on the existing disk information; and if so, generating a disk deleting command script corresponding to the basic information according to a preset format, and executing the disk deleting command script to delete the disk to be deleted. In the embodiment of the invention, manual checking operation is not needed, and whether the disk to be deleted meets the deleting condition or not is determined according to the existing disk information of the disk to be deleted; and generating a corresponding disk deleting command script according to a preset format when the disk to be deleted is determined to meet the deleting condition, so as to delete the disk to be deleted based on the disk deleting command script. By means of the method, the situation that the ASM disk is wrongly deleted can be avoided, and the checking efficiency can be improved.
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, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for deleting a disk according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another disk deletion method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a disk deletion apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another disk deletion apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the embodiment of the invention, manual checking operation is not needed, and whether the disk to be deleted meets the deleting condition or not is determined according to the existing disk information of the disk to be deleted; and generating a corresponding disk deleting command script according to a preset format when the disk to be deleted is determined to meet the deleting condition, so as to delete the disk to be deleted based on the disk deleting command script. By means of the method, the situation that the ASM disk is wrongly deleted can be avoided, and the checking efficiency can be improved.
The disk deletion method disclosed by the embodiment of the invention can be used in an Oracle database for relational management, wherein the Oracle database is an Oracle company providing Oracle-based all-in-one equipment, namely physical equipment comprising a server, a network, storage and the like, and the disk deletion method is operated on the equipment so as to realize the function of automatically deleting the ASM disk.
The method for deleting the disk, disclosed by the embodiment of the invention, is designed by taking a multi-node real-time application cluster Oracle RAC as an operation object, and can be realized by using a computer language perl so that the method is adaptive to an Oracle 11g or 19c version.
Referring to fig. 1, a flowchart of a method for deleting a disk according to an embodiment of the present invention is shown, where the method includes:
s101: judging whether the user successfully logging in meets the requirement of the operation database, executing S102 when the user successfully logging in is determined to meet the requirement of the operation database, and if the user successfully logging in is determined not to meet the requirement of the operation database, indicating that the database cannot be operated and logging out.
In the specific implementation process of step S101, when a login instruction triggered by a user is detected, an account and a password input by the user are acquired, and it is determined whether the account and the password are consistent with an account and a password pre-stored in a database, and if not, a prompt interface indicating that the login is failed is displayed. If the user login information is consistent with the operation information, the current user login success is indicated, the information such as the global environment variable defined by the user and the input SQL statement is obtained, so that whether the user successfully logging in meets the requirement of the operation database or not is judged, S102 is executed when the user successfully logging in is determined to meet the requirement of the operation database, and if the user successfully logging in is determined not to meet the requirement of the operation database, the database cannot be operated, and the user quits the login.
It should be noted that the database shown in the embodiment of the present invention is an Oracle database.
The requirements for operating the database include managing the operating rights, the number of user-related processes of the same name and ASM instances.
S102: and acquiring the basic information of the disk to be deleted, which is input by the user.
In step S102, the basic information of the disk to be deleted at least includes a disk group name, a rebalancing value, and a disk number corresponding to the disk to be deleted.
In the process of specifically implementing step S102, a disk group name, a rebalance value, and a disk number corresponding to a disk to be deleted, which are input by a user, are obtained.
It should be noted that the disk is an Automatic Storage Management (ASM) disk.
The rebalance value is an Oracle parameter used for controlling the concurrency number of the data in the disk.
S103: and acquiring the existing disk information of the disk to be deleted based on the basic information of the disk to be deleted.
In the process of implementing step S103 specifically, the database is searched by the disk group name, the rebalance value, and the disk number corresponding to the disk to be deleted, and the location information, the spatial information (the used spatial information and the remaining spatial information), the disk size, the disk number, and the number of failed groups of the disk to be deleted are determined.
S104: and determining whether the disk to be deleted meets the deletion condition or not based on the existing disk information, if so, executing S105, and if not, indicating that the database cannot be continuously operated, and logging out.
In the process of implementing step S104 specifically, it is determined whether the disk to be deleted meets the deletion condition by using the existing disk information, if so, S105 is executed, and if not, it is determined that the database cannot be operated continuously, and the login is exited.
It should be noted that the deletion condition includes determining a preset value range, meeting a preset rule, and determining a free space of the disk group.
S105: and generating a disc deleting command script corresponding to the basic information according to a preset format.
In the process of implementing step S105 specifically, a to-be-deleted disk meeting the deletion condition is generated into a disk deletion command script according to a preset format, and a corresponding disk deletion command is displayed to the user.
Optionally, based on the method for deleting a disk shown in the foregoing embodiment of the present invention, after step S105 is executed to generate a disk deletion command script corresponding to the basic information according to a preset format, the method further includes: and generating a command log corresponding to the disc deleting command script based on the disc deleting command script.
S106: and executing the disk deleting command script to delete the disk to be deleted.
In the process of implementing step S106 specifically, the disk deletion command script obtained in step S105 is executed to delete the disk to be deleted.
In the embodiment of the invention, manual checking operation is not needed, and whether the disk to be deleted meets the deleting condition or not is determined according to the existing disk information of the disk to be deleted; and generating a corresponding disk deleting command script according to a preset format when the disk to be deleted is determined to meet the deleting condition, so as to delete the disk to be deleted based on the disk deleting command script. By means of the method, the situation that the ASM disk is wrongly deleted can be avoided, and the checking efficiency can be improved.
Based on the above-mentioned method for deleting a disk according to the embodiment of the present invention, the embodiment of the present invention further specifically discloses a process of the above-mentioned method for deleting a disk, as shown in fig. 2, which is a schematic flow chart of the method for deleting a disk according to the embodiment of the present invention, and the method includes:
s201: and determining whether the user authority of the successfully logged-in user is a management operation authority, if so, executing the step S202, otherwise, indicating that the database cannot be operated, and logging out.
In the process of specifically implementing step S201, when it is determined that the user logs in successfully, the user right of the user is obtained according to the user account information, and it is determined whether the user right is a management operation right, that is, whether the user is a management root user, if so, it is indicated that the user can operate the database, and step S202 is executed, otherwise, it is indicated that the database cannot be operated, and the login is exited.
S202: and judging whether a process with the same name related to the user exists or not, if not, executing the step S203, and if so, indicating that the database cannot be operated and logging out.
In the process of implementing step S202 specifically, it is determined whether the user repeatedly executes the tool corresponding to the database, that is, repeatedly executes the processes with the same name, if not, step S203 is executed, and if so, it indicates that the database cannot be operated, and log out is performed.
The repeated execution of the application corresponding to the database means that the execution is not completed for the first time, and the application corresponding to the database is restarted.
S203: and judging whether the quantity of the ASM examples accords with the preset quantity, if so, executing the step S204, and if not, indicating that the database cannot be operated and logging out.
In step S203, the preset number is preset, and may be set to 1, for example.
In the process of implementing step S203 specifically, in order to ensure that the object operated by the application is single or not, it is necessary to determine whether there is an ASM instance in the current database, if so, step S204 is executed, and if not, it indicates that the database cannot be operated, and log out.
It should be noted that the execution sequence of steps S201 to S203 may be as described above, or may be executed simultaneously, or executed according to another execution sequence, which is not limited in this embodiment of the present invention.
S204: and determining that the successfully logged-in user meets the requirement of operating the database.
S205: and acquiring the existing disk information of the disk to be deleted based on the basic information of the disk to be deleted.
It should be noted that the specific implementation process of step S205 is the same as the specific implementation process of step S103, and can be referred to each other.
S206: and judging whether the number of the failure groups in the existing disk information meets a preset numerical range, if so, executing the step S207, and if not, indicating that the database cannot be operated and logging out.
In the process of implementing step S206 specifically, the size of the number of failed groups in the disk information is compared with the size of the preset value range, if the number of failed groups is within the preset value range, it indicates that the number of failed groups meets the specification, step S207 is executed, if the number of failed groups is not within the preset value range, it indicates that the number of failed groups meets the specification, at this time, the database cannot be operated, and logging-out is performed.
It should be noted that the preset value range is preset according to the actual specification, and the embodiment of the present invention is not limited thereto.
S207: and judging whether the size and the number of the disks in the existing disk information meet preset rules, if so, executing the step S208, and if not, indicating that the database cannot be operated, and logging out.
In step S207, the preset rules include a disk size standard rule and a preset threshold storage rule.
In the process of implementing step S207 specifically, it is determined whether the size of the disk to be deleted satisfies the standard rule of the size of the disk, whether the number of the disks satisfies the preset threshold, and the disks to be deleted satisfy the storage rules from different storage cabinets, if both the sizes satisfy the preset threshold, step S208 is executed, and if any one does not satisfy the storage rules, or if a plurality of the sizes do not satisfy the storage rules, it is determined that the database cannot be operated, and logging out is performed.
S208: and judging whether the space data of the disk to be deleted is smaller than the free space of the corresponding disk group, if so, executing the step S209, and if so, indicating that the database cannot be operated and logging out.
In step S208, the disk group free space is determined based on the storage area network SAN disk information acquired from the database.
Optionally, the information of all the SAN disks of the storage area network of the operating system is obtained from the database.
It should be noted that the SAN disk information includes location information, space information, ID number, disk size information, and the like of all the disks.
In the process of implementing the step S208 specifically, determining a disk group free space corresponding to a disk to be deleted based on the storage area network SAN disk information; and comparing the spatial data of the disk to be deleted with the size of the free space of the corresponding disk group, if the spatial data of the disk to be deleted is smaller than the free space of the corresponding disk group, executing the step S209, and if the spatial data of the disk to be deleted is larger than or equal to the free space of the corresponding disk group, indicating that the database cannot be operated and logging out.
It should be noted that, the specific implementation sequence of step S206 to step S208 is not limited to the above sequence, and may also be executed simultaneously or in other execution sequences, which is not limited to this embodiment of the present invention.
S209: and determining that the disk to be deleted meets the deletion condition.
S210: and generating a disc deleting command script corresponding to the basic information according to a preset format.
S211: and executing the disk deleting command script to delete the disk to be deleted.
It should be noted that the specific implementation procedures of step S210 and step S211 are the same as the specific implementation procedures of step S105 and step S106, and they can be referred to each other.
In the embodiment of the invention, the checking operation is not needed to be carried out manually, and the user authority of the user who successfully logs in is determined to be the management operation authority without the homonymous process related to the user, and the number of ASM instances is in accordance with the preset number, judging whether the number of failed groups in the existing disk information is in accordance with the preset value range, judging whether the size of the disk and the number of the disks in the existing disk information are in accordance with the preset rule, judging whether the space data of the disk to be deleted is smaller than the free space of the corresponding disk group to determine whether the disk to be deleted is in accordance with the deletion condition, when the number of the failed groups is determined to accord with the preset value range, the size of the magnetic disk and the number of the magnetic disk accord with the preset rule, and the space data of the magnetic disk to be deleted is smaller than the free space of the corresponding magnetic disk group, and generating a corresponding disk deleting command script according to a preset format so as to delete the disk to be deleted based on the disk deleting command script. By means of the method, the situation that the ASM disk is wrongly deleted can be avoided, and the checking efficiency can be improved.
Corresponding to the method for deleting a disk shown in the above embodiment of the present invention, an embodiment of the present invention also discloses a device for deleting a disk, as shown in fig. 3, which is a schematic structural diagram of the device for deleting a disk shown in the embodiment of the present invention, and the device includes:
the first obtaining unit 301 is configured to obtain basic information of a disk to be deleted, which is input by a user, when it is determined that the user who successfully logs in meets the requirement of operating the database.
A second obtaining unit 302, configured to obtain existing disk information of the disk to be deleted based on the basic information of the disk to be deleted.
And the processing unit 303 is configured to determine whether the disk to be deleted meets a deletion condition based on the existing disk information, and if so, execute the generating unit.
A first generating unit 304, configured to generate a delete command script corresponding to the basic information according to a preset format.
A deleting unit 305, configured to execute the delete command script to delete the disk to be deleted.
Optionally, the method further includes: and a second generation unit configured to generate a command log corresponding to the disc deletion command script based on the disc deletion command script after the first generation unit 304 is executed.
It should be noted that, the specific principle and the implementation process of each unit in the disk deletion apparatus disclosed in the above embodiment of the present invention are the same as those of the disk deletion method shown in the above embodiment of the present invention, and reference may be made to corresponding parts in the disk deletion method disclosed in the above embodiment of the present invention, which are not described herein again.
In the embodiment of the invention, manual checking operation is not needed, and whether the disk to be deleted meets the deleting condition or not is determined according to the existing disk information of the disk to be deleted; and generating a corresponding disk deleting command script according to a preset format when the disk to be deleted is determined to meet the deleting condition, so as to delete the disk to be deleted based on the disk deleting command script. By means of the method, the situation that the ASM disk is wrongly deleted can be avoided, and the checking efficiency can be improved.
Optionally, based on the foregoing deletion apparatus for a disk shown in the embodiment of the present invention, the obtaining unit 301 that determines that a user who successfully logs in meets a requirement of operating a database is specifically configured to: determining whether the user authority of the successfully logged-in user is a management operation authority; if yes, judging whether a process with the same name related to the user exists or not; if not, judging whether the quantity of the ASM examples meets the preset quantity or not; and if so, determining that the successfully logged-in user meets the requirement of operating the database.
In the embodiment of the invention, whether a user meets the requirement of an operation database is determined according to the user authority, the homonymy process and the number of ASM instances, and when the user meets the requirement of the operation database, whether the disk to be deleted meets the deletion condition is determined according to the existing disk information of the disk to be deleted; and generating a corresponding disk deleting command script according to a preset format when the disk to be deleted is determined to meet the deleting condition, so as to delete the disk to be deleted based on the disk deleting command script. By means of the method, the situation that the ASM disk is wrongly deleted can be avoided, and the checking efficiency can be improved.
Optionally, based on the foregoing deletion apparatus for a disk shown in the embodiment of the present invention, as shown in fig. 3, referring to fig. 4, the processing unit 303 includes:
the first determining module 3031 is configured to determine whether the number of failed groups in the existing magnetic disk information meets a preset value range, and if so, execute the second determining module 3032.
The second determining module 3032 is configured to determine whether the size of the disk and the number of the disks in the existing disk information meet preset rules, and if both the size and the number of the disks meet preset rules, execute a third determining module 3033.
The third determining module 3033 is configured to determine whether the spatial data of the disk to be deleted is smaller than a corresponding disk group free space, and if so, execute the determining module 3034, where the disk group free space is determined based on the storage area network SAN disk information obtained from the database.
The determining module 3034 is configured to determine that the disk to be deleted meets the deletion condition.
In the embodiment of the invention, the checking operation is not needed to be carried out manually, and the user authority of the user who successfully logs in is determined to be the management operation authority without the homonymous process related to the user, and the number of ASM instances is in accordance with the preset number, judging whether the number of failed groups in the existing disk information is in accordance with the preset value range, judging whether the size of the disk and the number of the disks in the existing disk information are in accordance with the preset rule, judging whether the space data of the disk to be deleted is smaller than the free space of the corresponding disk group to determine whether the disk to be deleted is in accordance with the deletion condition, when the number of the failed groups is determined to accord with the preset value range, the size of the magnetic disk and the number of the magnetic disk accord with the preset rule, and the space data of the magnetic disk to be deleted is smaller than the free space of the corresponding magnetic disk group, and generating a corresponding disk deleting command script according to a preset format so as to delete the disk to be deleted based on the disk deleting command script. By means of the method, the situation that the ASM disk is wrongly deleted can be avoided, and the checking efficiency can be improved.
The embodiment of the invention also discloses electronic equipment, which is used for operating the database storage process, wherein the deletion method of the disk disclosed in the figure 1 and the figure 2 is executed when the database storage process is operated.
The embodiment of the invention also discloses a computer storage medium, which comprises a storage database storage process, wherein when the storage database storage process runs, the device where the storage medium is located is controlled to execute the disk deletion method disclosed in the figures 1 and 2.
In the context of this disclosure, a computer storage medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. 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 invention. Thus, the present invention 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 deleting a disk, the method comprising:
when the successful login user is determined to meet the requirement of operating the database, acquiring basic information of a disk to be deleted, which is input by the user;
acquiring the existing disk information of the disk to be deleted based on the basic information of the disk to be deleted;
determining whether the disk to be deleted meets the deletion condition or not based on the existing disk information;
if yes, generating a disc deletion command script corresponding to the basic information according to a preset format;
and executing the disk deleting command script to delete the disk to be deleted.
2. The method of claim 1, wherein determining that a user who successfully logs in meets the requirements of operating a database comprises:
determining whether the user authority of the successfully logged-in user is a management operation authority;
if yes, judging whether a process with the same name related to the user exists or not;
if not, judging whether the quantity of the ASM examples meets the preset quantity or not;
and if so, determining that the successfully logged-in user meets the requirement of operating the database.
3. The method of claim 1, wherein the determining whether the disk to be deleted meets a deletion condition based on the existing disk information comprises:
judging whether the number of the failure groups in the existing disk information accords with a preset numerical range or not;
if yes, judging whether the size and the number of the disks in the existing disk information meet preset rules or not;
if the data are consistent with the data, judging whether the space data of the disk to be deleted is smaller than the corresponding disk group free space, wherein the disk group free space is determined based on the storage area network SAN disk information acquired from the database;
if the number of the disks to be deleted is smaller than the preset number, determining that the disks to be deleted meet the deletion condition.
4. The method of claim 1, further comprising, after generating a delete command script corresponding to the basic information according to a preset format:
and generating a command log corresponding to the disc deleting command script based on the disc deleting command script.
5. An apparatus for deleting a disk, the apparatus comprising:
the first acquisition unit is used for acquiring basic information of the disk to be deleted, which is input by a user, when the user who successfully logs in is determined to meet the requirement of operating a database;
a second obtaining unit, configured to obtain existing disk information of the disk to be deleted based on the basic information of the disk to be deleted;
the processing unit is used for determining whether the disk to be deleted accords with the deletion condition or not based on the existing disk information, and if so, the generating unit is executed;
the first generating unit is used for generating a disc deletion command script corresponding to the basic information according to a preset format;
and the deleting unit is used for executing the disk deleting command script so as to delete the disk to be deleted.
6. The apparatus according to claim 5, wherein the obtaining unit that determines that the successfully logged-in user satisfies the requirement of operating the database is specifically configured to: determining whether the user authority of the successfully logged-in user is a management operation authority; if yes, judging whether a process with the same name related to the user exists or not; if not, judging whether the quantity of the ASM examples meets the preset quantity or not; and if so, determining that the successfully logged-in user meets the requirement of operating the database.
7. The apparatus of claim 5, wherein the processing unit comprises:
the first judging module is used for judging whether the number of the failure groups in the existing disk information accords with a preset numerical range, and if so, the second judging module is executed;
the second judging module is used for judging whether the size and the number of the disks in the existing disk information accord with preset rules or not, and if so, executing a third judging module;
the third judging module is used for judging whether the space data of the disk to be deleted is smaller than the corresponding disk group free space, and if so, executing the determining module, wherein the disk group free space is determined based on the storage area network SAN disk information acquired from the database;
and the determining module is used for determining that the disk to be deleted meets the deletion condition.
8. The apparatus of claim 5, further comprising:
and the second generation unit is used for generating a command log corresponding to the disc deletion command script based on the disc deletion command script after the first generation unit is executed.
9. An electronic device, wherein the electronic device is configured to execute a program, and wherein the program executes the method for deleting a disk according to any one of claims 1 to 4.
10. A computer storage medium, characterized in that the storage medium includes a storage program, wherein when the program runs, a device in which the storage medium is located is controlled to execute the disk deletion method according to any one of claims 1 to 4.
CN202110969426.8A 2021-08-23 2021-08-23 Method and device for deleting disk, electronic equipment and computer storage medium Pending CN113655967A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110969426.8A CN113655967A (en) 2021-08-23 2021-08-23 Method and device for deleting disk, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110969426.8A CN113655967A (en) 2021-08-23 2021-08-23 Method and device for deleting disk, electronic equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN113655967A true CN113655967A (en) 2021-11-16

Family

ID=78492105

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110969426.8A Pending CN113655967A (en) 2021-08-23 2021-08-23 Method and device for deleting disk, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN113655967A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114067845A (en) * 2021-11-30 2022-02-18 中国工商银行股份有限公司 Processing method of disk information of disk, demagnetization system and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104573052A (en) * 2015-01-21 2015-04-29 浪潮电子信息产业股份有限公司 Method for replacing storage based on Oracle ASM
CN105912698A (en) * 2016-04-25 2016-08-31 乐视控股(北京)有限公司 Deletion method and system of data file in disk
CN105955671A (en) * 2016-05-16 2016-09-21 汉柏科技有限公司 Disc management method and device
CN106407397A (en) * 2016-09-20 2017-02-15 郑州云海信息技术有限公司 An oracle asm Rebalance-based data migration method and device
US10437470B1 (en) * 2015-06-22 2019-10-08 Amazon Technologies, Inc. Disk space manager
CN111625857A (en) * 2020-04-17 2020-09-04 中国建设银行股份有限公司 Login monitoring method, system, equipment and storage medium based on ORACLE database
CN111767009A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 Disk cleaning method, device and equipment
CN112000283A (en) * 2020-08-06 2020-11-27 苏州浪潮智能科技有限公司 Method, system and storage medium for realizing safe storage and replacement of Oracle database based on ASM

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104573052A (en) * 2015-01-21 2015-04-29 浪潮电子信息产业股份有限公司 Method for replacing storage based on Oracle ASM
US10437470B1 (en) * 2015-06-22 2019-10-08 Amazon Technologies, Inc. Disk space manager
CN105912698A (en) * 2016-04-25 2016-08-31 乐视控股(北京)有限公司 Deletion method and system of data file in disk
CN105955671A (en) * 2016-05-16 2016-09-21 汉柏科技有限公司 Disc management method and device
CN106407397A (en) * 2016-09-20 2017-02-15 郑州云海信息技术有限公司 An oracle asm Rebalance-based data migration method and device
CN111625857A (en) * 2020-04-17 2020-09-04 中国建设银行股份有限公司 Login monitoring method, system, equipment and storage medium based on ORACLE database
CN111767009A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 Disk cleaning method, device and equipment
CN112000283A (en) * 2020-08-06 2020-11-27 苏州浪潮智能科技有限公司 Method, system and storage medium for realizing safe storage and replacement of Oracle database based on ASM

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114067845A (en) * 2021-11-30 2022-02-18 中国工商银行股份有限公司 Processing method of disk information of disk, demagnetization system and electronic equipment

Similar Documents

Publication Publication Date Title
CN109299205B (en) Method and device for warehousing spatial data used by planning industry
KR101331452B1 (en) Method for providing database management and the database management server there of
CN113655967A (en) Method and device for deleting disk, electronic equipment and computer storage medium
CN111030840A (en) Method and device for generating topological graph, electronic equipment and storage medium
CN109583201A (en) The system and method for identifying malice intermediate language file
CN105426128A (en) Index maintenance method and device
CN110363381B (en) Information processing method and device
CN104363112A (en) Parameter management method and parameter management device
JP2006293611A (en) Plant monitoring control system
CN111414348A (en) Method and device for modifying database instance parameters
CN111651122B (en) Data deleting method, device, server and storage medium
US20130290245A1 (en) Database history management method and system thereof
CN112000971A (en) File permission recording method, system and related device
CN112965745B (en) System access method, device, equipment and computer readable medium
CN110442466A (en) Prevent request repeated accesses method, apparatus, computer equipment and storage medium
CN110442634A (en) The method and device of data storage
CN115269548A (en) Method and system for generating data warehouse development model and related equipment
CN111984740B (en) Service data table processing method, device, computer equipment and storage medium
CN110807037B (en) Data modification method and device, electronic equipment and storage medium
CN113032333B (en) Sensor file adding method, device and equipment for server monitoring project
CN111881112A (en) Database configuration method and device and related equipment
CN113760856A (en) Database management method and device, computer readable storage medium and electronic device
CN111767299A (en) Database operation method, device and system, storage medium and electronic equipment
CN117235609B (en) Inductive classification method, device, equipment and medium for BIM (building information modeling) components
CN111934910B (en) Fault processing method, equipment and storage 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