CN114328650A - Database resource management method and device, computer equipment and storage medium - Google Patents

Database resource management method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114328650A
CN114328650A CN202111468840.7A CN202111468840A CN114328650A CN 114328650 A CN114328650 A CN 114328650A CN 202111468840 A CN202111468840 A CN 202111468840A CN 114328650 A CN114328650 A CN 114328650A
Authority
CN
China
Prior art keywords
database
resource
instance
cluster
database instance
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
CN202111468840.7A
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.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202111468840.7A priority Critical patent/CN114328650A/en
Publication of CN114328650A publication Critical patent/CN114328650A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a database resource management method, a database resource management device, a computer device, a storage medium and a computer program product. The method comprises the following steps: receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information; responding to a resource subscription request, allocating a target database instance for a resource subscriber, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions; and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of the resource subscriber so as to enable the resource subscriber to apply the database resources. By adopting the method, the user resource application time is shortened, and the resource allocation efficiency is improved.

Description

Database resource management method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of database processing technologies, and in particular, to a method and an apparatus for managing database resources, a computer device, a storage medium, and a computer program product.
Background
The Oracle database is used as a relational database, has great advantages in the aspects of data reliability, durability and the like, has good platform portability in the resource deployment and management process of the Oracle database, and can be deployed on platforms such as a virtual machine and a physical machine, so that the Oracle database is favored by more and more users.
In a traditional Database resource deployment and management process, a user manually deploys Database resources of an Oracle single node or RAC (Real Application Cluster) Cluster (collectively referred to as a Database Cluster), a Database management platform creates a personalized CDB (common Database) Database instance based on resource requirements set during manual deployment of the user, and divides a PDB (plug-able Database) to provide resource applications for the user.
However, in the conventional database resource deployment method, the time for manually deploying and creating the CDB is long when the user applies for the database resource, which further causes long time for applying the database resource and delays the on-line progress of the whole service, and therefore, a database resource deployment management method is urgently needed.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a database resource management method, apparatus, computer device, computer readable storage medium and computer program product for solving the above technical problems.
In a first aspect, the present application provides a database resource management method. The method comprises the following steps:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
In one embodiment, the resource subscription request carries an identity of a resource subscriber, and after receiving the resource subscription request, the method further includes:
inquiring whether the identity identification exists in the pre-stored identity information of each resource subscriber;
if the identity mark exists, executing the step of responding to the resource subscription request and distributing a target database instance to the resource subscriber according to a preset database instance distribution rule;
and if the identity does not exist, outputting the information without the resource subscription authority.
In one embodiment, the database instance includes a master database instance, the master database instance is a database resource classified in a resource group of a resource subscriber, and the allocating, in response to the resource subscription request, a target database instance for the resource subscriber according to a preset database instance allocation rule includes:
in response to the resource subscription request, determining that a candidate database cluster without a master database instance exists in each database cluster of the database resource pool;
and determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request, and determining an instance without a main database in the target database cluster as a distributed database instance.
In one embodiment, the determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request includes:
determining a first database cluster in the candidate database clusters according to database specification information contained in the resource subscription parameter information;
if the first database cluster only contains database clusters without master database instances, determining the database cluster only containing the database instances without master database instances as a target database cluster;
and if the first database cluster does not have a database cluster only containing no main database instance, determining a target database cluster according to the service level of the main database instance contained in the first database cluster.
In one embodiment, the database instance comprises a master-less database instance, which is an unallocated database instance, and the method further comprises:
inquiring each database cluster in the database resource pool according to a preset period, and screening out a first database cluster without the master database instance;
scanning cluster resource information in the first database clusters, and screening second database clusters meeting conditions for creating database instances in each first database cluster;
and creating a new master-free database instance in the second database cluster according to preset database instance specification information.
In one embodiment, the method further comprises:
receiving a resource query management request, wherein the resource query management request carries an identity of the resource subscriber;
determining whether the resource subscriber has resource management authority or not according to the resource subscriber identity identification;
if the resource subscriber has the resource management authority, responding to the resource query management request, and counting database instance information in the resource group of the resource subscriber and pluggable database information divided in the database instance;
and pushing the database instance information and the pluggable database information to a front end for output and display.
In a second aspect, the present application further provides a database resource management apparatus. The device comprises:
the receiving module is used for receiving a resource subscription request, and the resource subscription request carries resource subscription parameter information;
the allocation module is used for responding to the resource subscription request, allocating a target database instance to the resource subscriber according to a preset database instance allocation rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and the management module is used for adjusting the target database instance to the database instance meeting the resource specification and the cluster information in the resource subscription parameter information and classifying the adjusted target database instance into the resource group of the resource subscriber so as to enable the resource subscriber to apply the database resources.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
The database resource management method, the database resource management device, the computer equipment, the storage medium and the computer program product receive a resource subscription request, wherein the resource subscription request carries resource subscription parameter information; and responding to the resource subscription request, and distributing the target database instance for the resource subscriber according to a preset database instance distribution rule. Wherein the target database instance is a database instance created to satisfy database cluster resource supervision conditions; and adjusting the resource specification and the cluster information of the target database instance based on the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so that the resource subscriber can apply the database resources. By adopting the method, the database instances in the database cluster are created in advance under the condition of meeting the database cluster supervision based on supervision of all the database clusters, and then when a user initiates a resource subscription request, the corresponding database instances are directly distributed to the user, so that the resource application time of the user is shortened, and the resource subscription efficiency is improved.
Drawings
FIG. 1 is a flow diagram that illustrates the application of a method for database resource management in one embodiment;
FIG. 2 is a flowchart illustrating steps of a method for database resource management according to an embodiment;
FIG. 3 is a schematic flow chart illustrating the steps of user identity authentication in one embodiment;
FIG. 4 is a schematic flow chart diagram illustrating the database instance assignment step in one embodiment;
FIG. 5 is a schematic flow chart diagram illustrating the database cluster filtering step in one embodiment;
FIG. 6 is a schematic flow chart diagram illustrating the steps for determining a target database cluster in one embodiment;
FIG. 7 is a flowchart illustrating the steps of database resource management in one embodiment;
FIG. 8 is a flowchart illustrating the application of the steps in database resource management in one embodiment;
FIG. 9 is a block diagram showing the structure of a database resource management apparatus according to an embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a database resource management method is provided, in which a computer device receives a resource subscription request, and in response to the resource subscription request, allocates a target database instance to a resource subscriber according to a preset database instance allocation rule, and then the computer device adjusts the target database instance to a database instance that meets resource specification and cluster information in resource subscription parameter information, and classifies the adjusted target database instance into a resource group of the resource subscriber, so that the resource subscriber performs application of a database resource. In the embodiment of the present application, devices that deploy the Oracle database are collectively referred to as computer devices, and are not described in detail hereinafter.
The method in this embodiment may be applied to a server, and it may be understood that the method may also be applied to a terminal, and may also be applied to a system including the terminal and the server, and implemented by interaction between the terminal and the server, so that the application is not limited to a device type for deploying a database management system. As shown in fig. 2, in this embodiment, the method includes the following steps:
at step 202, a resource subscription request is received.
The resource subscription request carries resource subscription parameter information.
In implementation, the Oracle database may be deployed on a virtual machine or a small physical machine, and the Oracle database may be deployed in a single node structure deployment manner or an RAC cluster architecture deployment manner in a server or a virtual machine created in advance in the server, so as to implement application of data resources in the database. In a general scene, an Oracle database is deployed on a server and a shared storage device in an RAC cluster architecture deployment mode, so that the high availability and the stability of the database are improved. The example of cluster deployment of the Oracle database RAC is used in the present application for illustration, and for convenience of description,
the display Interface provided by the computer device can display the management Interface of the Oracle database resource management system, and the user inputs a resource subscription request through an input Interface (API) provided in the management Interface, so as to subscribe and manage the database resources. Wherein, the resource subscription request carries resource subscription parameter information.
Step 204, responding to the resource subscription request, allocating a target database instance for the resource subscriber.
The target database instance is a database instance which is created to meet the database cluster resource supervision condition. The database cluster resource supervision condition is that no master database instance exists in the database cluster or no master database instance is occupied, and the remaining database resources meet the condition of creating a new master-free database instance.
In implementation, a database resource management backend application system deployed in a computer device responds to a resource subscription request, and allocates a target database instance to a resource subscriber according to a preset database instance allocation rule and resource subscription parameter information carried in the resource subscription request. The preset database instance distribution rule is formulated and obtained based on database instance specification information, RAC cluster information and the like. In the embodiment of the present application, the allocation rule of the database instance is not limited.
It is noted that the Database instance in the present application refers to a CDB (Container Database, referred to as a Database Container) which corresponds to a Database operating system deployed on a computer device, and which calls and manages a plurality of PDBs (pluggable databases). And PDB is equivalent to the database instance that really provides the business needs. Oracle 12c only creates CDBs after deployment and installation on a computer device, and needs to generate corresponding PDBs according to the subscription requirements of resource subscribers. The Oracle 12c database uses the CDB-PDB architecture, where multiple PDBs can be loaded. According to the method and the device, the CDB database instances corresponding to the user subscription applications are matched, so that the CDB database instances among multiple users are isolated (namely, the PDB database instances of multiple users do not exist in one CDB), and the stability of a user service system is improved.
Step 206, adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of the resource subscriber, so that the resource subscriber performs application of the database resource.
In implementation, a database resource management back-end application system (resource management system for short) deployed in the computer device performs specification adjustment on the determined target database instance according to requirements in the resource subscription parameter information to obtain a personalized target database instance completely meeting requirements of a resource subscriber, that is, a database instance meeting resource specifications and cluster information in the resource subscription parameter information. Then, the database resource management back-end application system assigns the adjusted target database instance to a resource group of the resource subscriber (assigns the adjusted target database instance to the name of the resource subscriber), so that the resource subscriber performs resource query management based on the display interface of the front-end computer device, thereby realizing the application of the database resource.
In the database resource management method, a resource subscription request is received, wherein the resource subscription request carries resource subscription parameter information; in response to the resource subscription request, a target database instance is allocated for the resource subscriber. The target database instance is a database instance which is created to meet database cluster resource supervision conditions; and based on the resource subscription parameter information, adjusting the resource specification and the cluster information of the target database instance, and classifying the adjusted target database instance into the resource group of the resource subscriber so as to enable the resource subscriber to apply the database resources. By adopting the method, the database instances in the database cluster are created in advance under the condition of meeting the database cluster supervision based on supervision of all the database clusters, and then when a user initiates a resource subscription request, the corresponding database instances are directly distributed to the user, so that the resource application time of the user is shortened, and the resource subscription efficiency is improved.
In an embodiment, as shown in fig. 3, when a user subscribes to a resource, the user identity needs to be authenticated first to determine whether the user has a resource subscription right, and only the user having the resource subscription right will the resource management system process the resource subscription request initiated by the user. Therefore, the resource subscription request carries the identity of the resource subscriber, and the specific processing procedure of step 202 includes the following steps:
step 302, inquiring whether the identity exists in the pre-stored identity information of each resource subscriber.
In implementation, the shared storage space of the database resource management back-end application system stores in advance the identity information of the user when the user registers, and when receiving the resource subscription request, the resource management back-end application system traverses the query in the pre-stored identity information of each resource subscriber and judges whether the received identity identifier exists in the pre-stored identity information.
And 304, if the identity exists, executing the step of responding to the resource subscription request and allocating the target database instance to the resource subscriber.
In the implementation, if the identity indicates that the source of the resource subscription request (i.e. the resource subscriber) has the resource subscription right, the step 104 is executed. The specific execution process of step 104 has already been described in detail in this application, and is not described herein again.
And step 306, if the identity does not exist, outputting the information without the resource subscription authority.
In implementation, if the identity does not exist, indicating that the initiator of the resource subscription request (i.e., the resource subscriber) does not have the resource subscription authority, the resource management system deployed in the computer device outputs information of the resource subscription authority that does not exist.
In an embodiment, as shown in fig. 4, the database instances include a master database instance, where the master database instance is a database resource classified in a resource group of a resource subscriber, and when the database instances are distributed, the master database instance needs to be screened and excluded to provide a new master-less database instance for the resource subscriber, and then the specific processing procedure of step 204 includes:
step 402, in response to a resource subscription request, determining that a candidate database cluster without a master database instance exists in each database cluster of the database resource pool.
In an implementation, a computer device, in response to a resource subscription request, filters database clusters of a pool of database resources for determining the existence of candidate database clusters without a master database instance.
Specifically, a basic database instance is created in advance in each database cluster of the database resource pool, the database instance is a master-less database instance, following resource subscription application by multiple users, master-less database instances in part of the database clusters are classified as master database instances after being applied for subscription, and meanwhile, master-less database instances newly created based on a database cluster supervision mechanism exist in the process. Therefore, when the user applies for resource subscription, the database resource management system screens out candidate database clusters without main database instances in all database clusters of the database resource pool in response to the resource subscription request.
And step 404, determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request, and determining an instance without a main database in the target database cluster as a distributed database instance.
In implementation, the computer device determines a target database cluster in the candidate database cluster according to resource subscription parameter information carried in the resource subscription request, specifically, the resource subscription parameter information includes database instance specification information and RAC cluster information, and the resource subscription information represents a specific resource subscription requirement of a user. Furthermore, the back-end resource management system deployed in the computer equipment determines a target database cluster (namely, an RAC cluster) meeting the resource subscription condition from the preliminarily screened candidate database clusters according to the database instance specification information and the RAC cluster information, and a master-free database instance meeting the database instance specification and the RAC cluster information limited in the resource subscription request exists in the target database cluster.
In an embodiment, as shown in fig. 5, in the creating manner of the database instances in the database cluster in the present application, only one database instance is created for one database cluster at a time, so that any database cluster without a master database instance exists at the current time, and only one master database instance does not exist, and the specific processing procedure of step 404 includes the following steps:
step 502, according to the database specification information contained in the resource subscription parameter information, determining a first database cluster in the candidate database clusters.
In an implementation, in order to obtain database instances allocated to users by screening, candidate database clusters including no master database instance are preliminarily screened, and further, since the specifications of no master database instances existing in each database cluster are different, for example, no master database instance existing in RAC 1 is 24C and 256GB, no master database instance existing in RAC2 is 16C and 128GB, and … the resource platform management system further determines a first database cluster in the preliminarily screened candidate database clusters according to the database specification information included in the resource subscription parameter information.
Step 504, if there is a database cluster only including no master database instance in the first database cluster, determining the database cluster only including no master database instance as the target database cluster.
In an implementation, if there is a database cluster in the first database cluster that only includes no master database instance, then the database cluster that only includes no master database instance is determined to be the target database cluster.
Specifically, after further resource specification screening, it is determined that all the master-database-free instances included in each first database cluster are database instances satisfying the resource specification conditions of the user requirements, then screening is performed in a resource occupation manner in the database clusters, and in a preset database instance distribution rule, if a master database instance does not exist in RAC3, only one master-database-free instance is included, and a master database instance and a master-database-free instance also exist in RAC4, under the condition that other conditions of RAC3 and RAC4 clusters are equal, RAC3 is preferentially selected to realize isolation between the whole database clusters among users, so as to improve the stability of respective service systems of the users. Based on this principle, a resource management system deployed in a computer device determines, in a first database cluster, a database cluster that contains only no master database instances as a target database cluster.
Step 506, if the first database cluster does not have a database cluster only containing no master database instance, determining a target database cluster according to the business level of the master database instance contained in the first database cluster.
In implementation, if there is no database cluster in the first database cluster that only includes no master database instance, indicating that in the previous resource application, each first database cluster has been applied, that is, there is a master database instance applied, the back-end resource management system further determines the service level of the master database instance included in each first database cluster, and determines the target database cluster according to the service level matching manner in each first database cluster.
Specifically, when a user subscribes to a database resource, the resource subscription parameter information input by the user also includes service system importance level information, and service levels are divided according to preset service system importance levels, for example, the service levels are sorted according to importance levels as follows: A. b, C, in order to ensure that the more important database instances of the service system should realize cluster isolation, when the resource management system allocates database instances to users, the service level of the data resource to be applied is matched and judged with the service level of the existing main database instance in the database cluster, and the target database cluster is determined. For example, if there are three first database clusters that satisfy other conditions for database instance screening, and among the three first database clusters, the service level included by the master database instance in database cluster a is level a, the service level included by the master database instance in database cluster B is level B, and the service level included by the master database instance in database cluster C is level C, then according to preset database instance allocation rules, database cluster C is preferentially selected, and database cluster B is less preferably selected as the target database cluster. So as to ensure that service systems with high service levels do not interfere with each other.
In an embodiment, as shown in fig. 6, the database instance includes a master-less database instance, the master-less database instance is an unallocated database instance, a supervised creation mechanism of the database instance also exists in the embodiment of the present application, and based on the supervised creation mechanism, the backend resource management system of the computer device may plan and create the database instance according to a preset period to ensure timeliness of real-time application of user resources, and the method further includes:
step 602, querying each database cluster in the database resource pool according to a preset period, and screening out a first database cluster without a master database instance.
In the implementation, a basic database instance pre-exists in each database cluster of the database resource pool, the basic database instance is a master-less database instance, so that a user can apply for database resources, after a plurality of users apply for database instances in the database cluster, the master-less database instances in the database cluster are classified as master-less database instances, and at this time, a new master-less database instance needs to be created in the database cluster. And then, the back-end resource management system of the computer equipment queries each database cluster in the database resource pool according to a preset period, and screens out the first database cluster without the master database instance.
Step 604, scanning cluster resource information in the first database clusters, and screening second database clusters meeting the conditions for creating database instances in each first database cluster.
In implementation, before creating a new database instance for a database cluster, the resource management system needs to determine whether resources in the database cluster meet the resource size of a new database instance, that is, the backend resource management system of the computer device scans cluster resource information in first data clusters, and screens second database clusters meeting conditions for creating database instances in each first database cluster.
Optionally, the database cluster that does not satisfy the condition of creating the new database instance is a database cluster whose resources are completely or approximately completely occupied, an occupation tag is marked on the database cluster that is completely or approximately completely occupied, and when the resource management system at the back end performs periodic resource scanning, the database cluster on which the occupation tag is marked is excluded, so that the database resource scanning efficiency is improved.
Step 606, creating a new master-less database instance in the second database cluster according to the preset database instance specification information.
In implementation, the resource management system executes a database instance creation program according to preset database instance specification information, and creates a new master-less database instance in the determined second database cluster.
In one embodiment, as shown in fig. 7, the method further comprises:
step 702, a resource query management request is received.
Wherein, the resource inquiry management request carries the identity of the resource subscriber
In implementation, after each user applies for resource subscription, the user may query the database resource that has been applied for through a resource management display interface provided by the computer device. Specifically, a user inputs a resource query management request, and the back-end resource management system receives the resource query management request to perform resource management.
Step 704, determining whether the resource subscriber has the resource management authority according to the resource subscriber identity.
In implementation, before resource management is performed by a back-end resource management system, a user initiating a resource query management request is authenticated, specifically, the resource management system queries whether an identity of a resource subscriber exists in pre-stored user identity registration information or not according to the identity of the resource subscriber, and if so, indicates that the current user has a resource management right.
If not, the current user does not have the resource management authority, and the authority limited prompt information is output.
Step 706, if the resource subscriber has the resource management authority, responding to the resource query management request, and counting the database instance information in the resource group of the resource subscriber and the pluggable database information divided in the database instance.
In implementation, if the resource subscriber has the resource management authority, the resource management system responds to the resource query management request, and counts all CDB database instance information applied in the resource group of the resource subscriber and PDB pluggable database information divided in the CDB database instance.
Step 708, the database instance information and the pluggable database information are pushed to the front end for output and display.
In implementation, the resource management system of the computer device pushes the database instance information and the pluggable database information to the front end for output and display. As shown in fig. 8, the database instance information may include, but is not limited to, CDB database instance asset information, and PDB pluggable database information in each CDB database instance. Meanwhile, the database instance information pushed to the front end by the resource management system also provides PDB add/delete start/stop, PDB space management, PDB user management and PDB session management interfaces for the user, so that resource information query and resource management of the user are facilitated.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a database resource management device for implementing the above related database resource management method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more embodiments of the database resource management device provided below may refer to the limitations on the database resource management method in the above, and are not described herein again.
In one embodiment, as shown in fig. 9, there is provided a database resource management apparatus 900, including: a receiving module 901, an allocating module 902 and a managing module 903, wherein:
a receiving module 901, configured to receive a resource subscription request, where the resource subscription request carries resource subscription parameter information;
an allocating module 902, configured to, in response to the resource subscription request, allocate a target database instance to a resource subscriber according to a preset database instance allocation rule, where the target database instance is a database instance created to meet a database cluster resource supervision condition;
a management module 903, configured to adjust the target database instance to a database instance that meets the resource specification and the cluster information in the resource subscription parameter information, and assign the adjusted target database instance to a resource group of a resource subscriber, so that the resource subscriber performs application of a database resource.
In one embodiment, the apparatus 900 further comprises:
the query module is used for querying whether the identity identification exists in the pre-stored identity information of each resource subscriber;
the allocation module is used for executing the step of responding to the resource subscription request and allocating a target database instance to the resource subscriber according to a preset database instance allocation rule if the identity exists;
and the output module is used for outputting the information without the resource subscription authority if the identity does not exist.
In one embodiment, the database instances include a master database instance, the master database instance is a database resource classified in a resource group of a resource subscriber, and the allocation module 902 is configured to determine, in response to the resource subscription request, that there is a candidate database cluster without a master database instance among database clusters in the database resource pool;
and determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request, and determining an instance without a main database in the target database cluster as a distributed database instance.
In an embodiment, the allocating module 902 is specifically configured to determine, according to the database specification information included in the resource subscription parameter information, a first database cluster among the candidate database clusters;
if the first database cluster only contains database clusters without master database instances, determining the database cluster only containing the database instances without master database instances as a target database cluster;
and if the first database cluster does not have a database cluster only containing no main database instance, determining a target database cluster according to the service level of the main database instance contained in the first database cluster.
In one embodiment, the database instance comprises a master-less database instance, which is an unallocated database instance, and the apparatus 900 further comprises:
the screening module is used for querying each database cluster in the database resource pool according to a preset period and screening out a first database cluster without the master database instance;
the scanning module is used for scanning cluster resource information in the first database clusters and screening second database clusters meeting the conditions of creating database instances in each first database cluster;
and the creating module is used for creating a new master-free database instance in the second database cluster according to preset database instance specification information.
In one embodiment, the apparatus 900 further comprises:
a receiving module, configured to receive a resource query management request, where the resource query management request carries an identity of the resource subscriber;
the determining module is used for determining whether the resource subscriber has the resource management authority or not according to the resource subscriber identity identification;
the processing and counting module is used for responding to the resource inquiry and management request and counting database instance information in the resource group of the resource subscriber and pluggable database information divided in the database instance if the resource subscriber has the resource management authority;
and the output module is used for pushing the database instance information and the pluggable database information to the front end for output and display.
The modules in the database resource management device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing database resource data and user registration identity data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a database resource management method.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
inquiring whether the identity identification exists in the pre-stored identity information of each resource subscriber;
if the identity mark exists, executing the step of responding to the resource subscription request and distributing a target database instance to the resource subscriber according to a preset database instance distribution rule;
and if the identity does not exist, outputting the information without the resource subscription authority.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
in response to the resource subscription request, determining that a candidate database cluster without a master database instance exists in each database cluster of the database resource pool;
and determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request, and determining an instance without a main database in the target database cluster as a distributed database instance.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
determining a first database cluster in the candidate database clusters according to database specification information contained in the resource subscription parameter information;
if the first database cluster only contains database clusters without master database instances, determining the database cluster only containing the database instances without master database instances as a target database cluster;
and if the first database cluster does not have a database cluster only containing no main database instance, determining a target database cluster according to the service level of the main database instance contained in the first database cluster.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
inquiring each database cluster in the database resource pool according to a preset period, and screening out a first database cluster without the master database instance;
scanning cluster resource information in the first database clusters, and screening second database clusters meeting conditions for creating database instances in each first database cluster;
and creating a new master-free database instance in the second database cluster according to preset database instance specification information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
receiving a resource query management request, wherein the resource query management request carries an identity of the resource subscriber;
determining whether the resource subscriber has resource management authority or not according to the resource subscriber identity identification;
if the resource subscriber has the resource management authority, responding to the resource query management request, and counting database instance information in the resource group of the resource subscriber and pluggable database information divided in the database instance;
and pushing the database instance information and the pluggable database information to a front end for output and display.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
In one embodiment, the computer program when executed by the processor further performs the steps of:
inquiring whether the identity identification exists in the pre-stored identity information of each resource subscriber;
if the identity mark exists, executing the step of responding to the resource subscription request and distributing a target database instance to the resource subscriber according to a preset database instance distribution rule;
and if the identity does not exist, outputting the information without the resource subscription authority.
In one embodiment, the computer program when executed by the processor further performs the steps of:
in response to the resource subscription request, determining that a candidate database cluster without a master database instance exists in each database cluster of the database resource pool;
and determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request, and determining an instance without a main database in the target database cluster as a distributed database instance.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining a first database cluster in the candidate database clusters according to database specification information contained in the resource subscription parameter information;
if the first database cluster only contains database clusters without master database instances, determining the database cluster only containing the database instances without master database instances as a target database cluster;
and if the first database cluster does not have a database cluster only containing no main database instance, determining a target database cluster according to the service level of the main database instance contained in the first database cluster.
In one embodiment, the computer program when executed by the processor further performs the steps of:
inquiring each database cluster in the database resource pool according to a preset period, and screening out a first database cluster without the master database instance;
scanning cluster resource information in the first database clusters, and screening second database clusters meeting conditions for creating database instances in each first database cluster;
and creating a new master-free database instance in the second database cluster according to preset database instance specification information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a resource query management request, wherein the resource query management request carries an identity of the resource subscriber;
determining whether the resource subscriber has resource management authority or not according to the resource subscriber identity identification;
if the resource subscriber has the resource management authority, responding to the resource query management request, and counting database instance information in the resource group of the resource subscriber and pluggable database information divided in the database instance;
and pushing the database instance information and the pluggable database information to a front end for output and display.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
In one embodiment, the computer program when executed by the processor further performs the steps of:
inquiring whether the identity identification exists in the pre-stored identity information of each resource subscriber;
if the identity mark exists, executing the step of responding to the resource subscription request and distributing a target database instance to the resource subscriber according to a preset database instance distribution rule;
and if the identity does not exist, outputting the information without the resource subscription authority.
In one embodiment, the computer program when executed by the processor further performs the steps of:
in response to the resource subscription request, determining that a candidate database cluster without a master database instance exists in each database cluster of the database resource pool;
and determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request, and determining an instance without a main database in the target database cluster as a distributed database instance.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining a first database cluster in the candidate database clusters according to database specification information contained in the resource subscription parameter information;
if the first database cluster only contains database clusters without master database instances, determining the database cluster only containing the database instances without master database instances as a target database cluster;
and if the first database cluster does not have a database cluster only containing no main database instance, determining a target database cluster according to the service level of the main database instance contained in the first database cluster.
In one embodiment, the computer program when executed by the processor further performs the steps of:
inquiring each database cluster in the database resource pool according to a preset period, and screening out a first database cluster without the master database instance;
scanning cluster resource information in the first database clusters, and screening second database clusters meeting conditions for creating database instances in each first database cluster;
and creating a new master-free database instance in the second database cluster according to preset database instance specification information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a resource query management request, wherein the resource query management request carries an identity of the resource subscriber;
determining whether the resource subscriber has resource management authority or not according to the resource subscriber identity identification;
if the resource subscriber has the resource management authority, responding to the resource query management request, and counting database instance information in the resource group of the resource subscriber and pluggable database information divided in the database instance;
and pushing the database instance information and the pluggable database information to a front end for output and display.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for managing database resources, the method comprising:
receiving a resource subscription request, wherein the resource subscription request carries resource subscription parameter information;
responding to the resource subscription request, and distributing a target database instance to a resource subscriber according to a preset database instance distribution rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and adjusting the target database instance to a database instance meeting the resource specification and the cluster information in the resource subscription parameter information, and classifying the adjusted target database instance into a resource group of a resource subscriber so as to enable the resource subscriber to apply the database resources.
2. The method according to claim 1, wherein the resource subscription request carries an identity of a resource subscriber, and after the receiving the resource subscription request, the method further comprises:
inquiring whether the identity identification exists in the pre-stored identity information of each resource subscriber;
if the identity mark exists, executing the step of responding to the resource subscription request and distributing a target database instance to the resource subscriber according to a preset database instance distribution rule;
and if the identity does not exist, outputting the information without the resource subscription authority.
3. The method of claim 1, wherein the database instance comprises a master database instance, the master database instance is a database resource classified in a resource group of a resource subscriber, and the allocating a target database instance for the resource subscriber according to a preset database instance allocation rule in response to the resource subscription request comprises:
in response to the resource subscription request, determining that a candidate database cluster without a master database instance exists in each database cluster of the database resource pool;
and determining a target database cluster in the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request, and determining an instance without a main database in the target database cluster as a distributed database instance.
4. The method according to claim 3, wherein the determining a target database cluster among the candidate database clusters according to the resource subscription parameter information carried in the resource subscription request comprises:
determining a first database cluster in the candidate database clusters according to database specification information contained in the resource subscription parameter information;
if the first database cluster only contains database clusters without master database instances, determining the database cluster only containing the database instances without master database instances as a target database cluster;
and if the first database cluster does not have a database cluster only containing no main database instance, determining a target database cluster according to the service level of the main database instance contained in the first database cluster.
5. The method of claim 1, wherein the database instance comprises a master-less database instance, the master-less database instance being an unallocated database instance, the method further comprising:
inquiring each database cluster in the database resource pool according to a preset period, and screening out a first database cluster without the master database instance;
scanning cluster resource information in the first database clusters, and screening second database clusters meeting conditions for creating database instances in each first database cluster;
and creating a new master-free database instance in the second database cluster according to preset database instance specification information.
6. The method of claim 1, further comprising:
receiving a resource query management request, wherein the resource query management request carries an identity of the resource subscriber;
determining whether the resource subscriber has resource management authority or not according to the resource subscriber identity identification;
if the resource subscriber has the resource management authority, responding to the resource query management request, and counting database instance information in the resource group of the resource subscriber and pluggable database information divided in the database instance;
and pushing the database instance information and the pluggable database information to a front end for output and display.
7. An apparatus for managing database resources, the apparatus comprising:
the receiving module is used for receiving a resource subscription request, and the resource subscription request carries resource subscription parameter information;
the allocation module is used for responding to the resource subscription request, allocating a target database instance to the resource subscriber according to a preset database instance allocation rule, wherein the target database instance is a database instance which is created to meet database cluster resource supervision conditions;
and the management module is used for adjusting the target database instance to the database instance meeting the resource specification and the cluster information in the resource subscription parameter information and classifying the adjusted target database instance into the resource group of the resource subscriber so as to enable the resource subscriber to apply the database resources.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202111468840.7A 2021-12-03 2021-12-03 Database resource management method and device, computer equipment and storage medium Pending CN114328650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111468840.7A CN114328650A (en) 2021-12-03 2021-12-03 Database resource management method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111468840.7A CN114328650A (en) 2021-12-03 2021-12-03 Database resource management method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114328650A true CN114328650A (en) 2022-04-12

Family

ID=81049523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111468840.7A Pending CN114328650A (en) 2021-12-03 2021-12-03 Database resource management method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114328650A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115951923A (en) * 2023-03-15 2023-04-11 深圳市思为软件技术有限公司 Subscription event management method and related product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115951923A (en) * 2023-03-15 2023-04-11 深圳市思为软件技术有限公司 Subscription event management method and related product
CN115951923B (en) * 2023-03-15 2023-05-16 深圳市思为软件技术有限公司 Subscription event management method, display system, device and storage medium

Similar Documents

Publication Publication Date Title
US10298666B2 (en) Resource management for multiple desktop configurations for supporting virtual desktops of different user classes
WO2019090523A1 (en) Business deployment method under serverless architecture and function management platform
CN108399101B (en) Method, device and system for scheduling resources
US8954557B2 (en) Assigning server categories to server nodes in a heterogeneous cluster
CN107682417B (en) Task allocation method and device for data nodes
US20110166952A1 (en) Facilitating dynamic construction of clouds
CN110795244B (en) Task allocation method, device, equipment and medium
CN112532632B (en) Resource allocation method and device for multi-level cloud platform and computer equipment
CN114244717A (en) Configuration method and device of virtual network card resources, computer equipment and medium
US9851960B2 (en) Tenant allocation in multi-tenant software applications
US20220337561A1 (en) Method to implement multi-tenant/shared redis cluster using envoy
US10834220B2 (en) Apparatus for providing cloud brokerage service based on multiple clouds and method thereof
CN114175602A (en) Authority management of cloud resources
CN114328650A (en) Database resource management method and device, computer equipment and storage medium
CN113849260A (en) Instance processing core allocation method and device
CN110673787A (en) Volume configuration method and device
CN111475279B (en) System and method for intelligent data load balancing for backup
CN116366606A (en) IP address allocation method and device, electronic equipment and storage medium
CN114756380A (en) Cloud server deployment method and device, electronic equipment and storage medium
CN113608847A (en) Task processing method, device, equipment and storage medium
CN109257201B (en) License sending method and device
CN113691575A (en) Communication method, device and system
CN114338433B (en) Block chain resource allocation method, device, system and computer equipment
CN111338752B (en) Container adjusting method and device
US11442756B2 (en) Common service resource application method, related device, and system

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