CN110737717B - Database migration method and device - Google Patents

Database migration method and device Download PDF

Info

Publication number
CN110737717B
CN110737717B CN201810716189.2A CN201810716189A CN110737717B CN 110737717 B CN110737717 B CN 110737717B CN 201810716189 A CN201810716189 A CN 201810716189A CN 110737717 B CN110737717 B CN 110737717B
Authority
CN
China
Prior art keywords
database
target server
migrated
migration
judging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810716189.2A
Other languages
Chinese (zh)
Other versions
CN110737717A (en
Inventor
刘志杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201810716189.2A priority Critical patent/CN110737717B/en
Publication of CN110737717A publication Critical patent/CN110737717A/en
Application granted granted Critical
Publication of CN110737717B publication Critical patent/CN110737717B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention discloses a database migration method and device. The method comprises the following steps: acquiring parameter information of a database to be migrated and a target server; judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server; and if the target server meets the database migration condition, migrating the database to be migrated to the target server. The method automatically finishes the selection of the target server and the judgment of the database migration condition, realizes the automatic database migration, removes the dependence of the database migration on the manual work, and has higher efficiency of the automatic database migration compared with the manual processing.

Description

Database migration method and device
Technical Field
The invention relates to the technical field of server operation and maintenance, in particular to a database migration method and device.
Background
In the daily operation and maintenance work of the database, an important work is to migrate the database of the server, that is, when the database of a certain server overflows, the database needs to be timely migrated to another server with sufficient space, so as to ensure the normal work of the database.
In the prior art, database migration work is mainly completed manually. When the database in the server needs to be migrated, a migration scheme is firstly established manually, and then the database migration is carried out. The database migration work period is long, the database migration efficiency is low, and heavy operation and maintenance burden is brought to operation and maintenance personnel.
Disclosure of Invention
In view of the above, the present invention has been made to provide a database migration method that overcomes or at least partially solves the above problems, and that enables automated database migration.
In order to achieve the purpose, the invention provides the following technical scheme:
a database migration method, comprising:
acquiring parameter information of a database to be migrated and a target server;
judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server;
and if the target server meets the database migration condition, migrating the database to be migrated to the target server.
Optionally, when the number of the target servers is multiple, the determining, according to the parameter information of the database to be migrated and the target server, whether the target server meets a database migration condition specifically includes:
respectively judging whether each target server meets the database migration condition or not according to the parameter information of the database to be migrated and each target server;
the method further comprises the following steps:
when a plurality of target servers meet database migration conditions, adding the target servers meeting the database migration conditions into a migration list, and determining matching degree scores between the target servers and the database to be migrated according to the database to be migrated and parameter information of the target servers in the migration list;
and screening out the target server with the highest matching degree score from the migration list so as to migrate the database to be migrated to the target server with the highest matching degree score.
Optionally, the parameter information includes a disk capacity, and the determining whether the target server meets the database migration condition includes:
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not;
if so, judging that the target server meets the database migration condition; or,
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not, and whether the ratio of the residual disk capacity of the target server to the total disk capacity of the target server is larger than a first preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, the parameter information further includes a memory space, and before determining whether the target server meets the database migration condition, the method further includes:
acquiring the residual memory space of the target server;
acquiring a memory space occupied by the database to be migrated;
calculating the difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
calculating the ratio of the residual effective memory space of the target server to the residual memory space;
the judging whether the target server meets the database migration condition further comprises:
judging whether the ratio of the residual effective memory space of the target server to the residual memory space is larger than a second preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, the parameter information further includes a CPU utilization rate, and before determining whether the target server satisfies the database migration condition, the method further includes:
acquiring the data volume of the database to be migrated;
calculating the data retrieval amount of the database to be migrated according to the data amount;
calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
the judging whether the target server meets the database migration condition further comprises:
judging whether the CPU utilization rate is smaller than a third preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, when the target server does not satisfy the database migration condition, the method further includes:
adjusting the configuration of the target server which does not meet the database migration condition within the set configuration requirement range; or
Dividing the database to be migrated into a plurality of sub databases;
for each sub-database, the following operations are performed:
judging whether the target server meets a database migration condition or not according to the parameter information of the sub-database and the target server;
and if the target server meets the database migration condition, migrating the sub-database to the target server.
A database migration apparatus comprising:
the parameter acquisition unit is used for acquiring parameter information of the database to be migrated and the target server;
the judging unit is used for judging whether the target server meets the database migration condition or not according to the parameter information of the database to be migrated and the target server;
and the migration unit is used for migrating the database to be migrated to the target server when the judgment processing unit judges that the target server meets the database migration condition.
Optionally, the parameter information includes a disk capacity, and the determining unit includes:
the first judgment module is used for judging whether the disk capacity required by the database to be migrated is smaller than the residual disk capacity of the target server;
the second judgment module is used for judging that the target server meets the database migration condition when the judgment result of the first judgment module is yes; or,
a third judging module, configured to judge whether the disk capacity that the database to be migrated needs to occupy is smaller than the remaining disk capacity of the target server, and whether a ratio of the remaining disk capacity of the target server to the total disk capacity of the target server is greater than a first preset ratio;
and the fourth judging module is used for judging that the target server meets the database migration condition when the third judging module judges that the result is yes.
Optionally, the parameter information further includes a memory space, and the apparatus further includes:
the first acquisition module is used for acquiring the residual memory space of the target server;
the second acquisition module is used for acquiring the memory space occupied by the database to be migrated;
the first calculation module is used for calculating the difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
the second calculation module is used for calculating the ratio of the residual effective memory space of the target server to the residual memory space;
the judging unit further includes:
a fifth judging module, configured to judge whether a ratio of a remaining effective memory space of the target server to the remaining memory space is greater than a second preset ratio;
a sixth judging module, configured to, when the fifth judging module judges that the result is yes, judge that the target server meets a database migration condition;
or, the parameter information further includes CPU utilization, and the apparatus further includes:
the third acquisition module is used for acquiring the data volume of the database to be migrated;
the third calculation module is used for calculating the data retrieval amount of the database to be migrated according to the data amount;
the fourth calculation module is used for calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
the judging unit further includes:
a seventh judging module, configured to judge whether the CPU utilization is smaller than a third preset ratio;
and the eighth judging module is used for judging that the target server meets the database migration condition when the seventh judging module judges that the result is yes.
A storage medium having stored thereon a program which, when executed by a processor, implements the database migration method described above.
A processor configured to execute a program, wherein the program executes the database migration method described above.
By the technical scheme, the database migration method provided by the invention can automatically acquire the parameter information of the database to be migrated and the target server; judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server; and if the target server meets the database migration condition, migrating the database to be migrated to the target server. The processing process automatically finishes the selection of the target server and the judgment of the database migration condition, realizes the automatic database migration, removes the dependence of the database migration on the manual work, and has higher efficiency of the automatic database migration compared with the manual processing.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various additional advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart illustrating a database migration method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another database migration method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another database migration method provided by the embodiment of the present invention;
FIG. 4 is a flow chart illustrating a further database migration method according to an embodiment of the present invention;
fig. 5 is a schematic flow chart illustrating a further database migration method according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram illustrating a database migration apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram illustrating another database migration apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention discloses a database migration method, which is shown in figure 1 and comprises the following steps:
s101, acquiring parameter information of a database to be migrated and a target server;
specifically, the database to be migrated is a database located in a certain server, and when the database is full of stored data, is about to overflow, or has an error, and cannot provide a data storage service for the server, the database needs to be migrated out of the server where the database is located, so that a new database with sufficient storage space is replaced to continue providing the data storage service for the server, or the database to be migrated is migrated to another server to be operated to provide the service for the original server where the database is located. In the above processing method, the database to be migrated is a database itself in which data is stored, and when the database is migrated, the entire database is generally migrated. Another alternative is to migrate the data in the database to be migrated out of the database to be migrated and reserve the database to continue to provide the data storage service for the server, that is, the database to be migrated actually represents the data in the database to be migrated. No matter which actual migration method is, the database to be migrated may represent an object that needs to be migrated to the target server.
One embodiment of the present invention provides that at least one target server can be configured in advance for the database of the server as a standby server when the server is built, that is, the server to which the built server can be selectively migrated when the built server database needs to be migrated is preset, and the preset servers are used as the target servers. Therefore, the target server refers to a preset target server corresponding to the database to be migrated. The database to be migrated may be migrated to any one of the preset target servers suitable for migration, but may not be migrated to a server other than the preset at least one target server.
In another embodiment, as the amount of data stored in the database increases, when the database migration is required, one or more servers may be randomly selected as target servers, and it is determined whether the database migration condition is met.
The parameter information includes information such as data version information, data size, user connection number, and operation parameters of the database to be migrated and the target server, and for the target server, hardware resource information thereof, such as memory space, disk capacity, cpu parameter, and memory type.
The embodiment of the invention sets that in the server system, the server parameter information table is maintained to record the parameter information of each server and the parameter information of the database of each server in real time. Alternatively, the database to be migrated and the parameter information of the target server may also be obtained in other realizable manners, which is not limited strictly in the embodiments of the present invention.
S102, judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server;
specifically, after parameter information of a database to be migrated and parameter information of a target database are obtained, one or more of resources such as a disk space (or called disk capacity), a memory usage rate and a cpu usage rate of a server which needs to be occupied by the database to be migrated and resources such as the remaining disk capacity, the memory usage rate and the cpu usage rate of the target server are compared, so that whether the at least one target server meets a database migration condition is determined. Theoretically, when the disk capacity of the target server is larger than the disk empty capacity of the server that needs to be occupied by the database to be migrated, it is indicated that the database migration condition is met by preliminary judgment, and the database migration can be performed. After the relevant indexes of resources such as the memory utilization rate and the cpu utilization rate are met, the target server is preferably suitable for performing database migration. And if the target server does not meet the database migration condition in the target servers, the migration of the database to be migrated cannot be supported.
It should be noted that, in the embodiment of the present invention, when determining whether the target server satisfies the migration condition of the database, the normal operation of the target server needs to be considered, and under the condition that the normal operation of the target server is not affected, that is, after resources such as a disk space, a memory usage rate, and a cpu usage rate required by the normal operation of the target server are deducted, resources such as a disk space, a memory idle rate, and a cpu idle rate remaining in the migration target service are compared with resources such as a disk space, a memory usage rate, and a cpu usage rate that the database to be migrated needs to occupy the server, so as to determine whether the target server satisfies the migration condition.
And if the target server meets the database migration condition, executing step S103, and migrating the database to be migrated to the target server.
Specifically, after determining that the target server meets the database migration condition, the to-be-migrated database may be migrated to the target server. The specific database migration method can be realized by referring to the existing database migration method, and the embodiment of the invention is not described in detail.
Through the introduction, the technical scheme of the embodiment of the invention can automatically acquire the parameter information of the database to be migrated and the target server; judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server; and if the target server meets the database migration condition, migrating the database to be migrated to the target server. The processing process automatically finishes the selection of the target server and the judgment of the database migration condition, realizes the automatic database migration, removes the dependence of the database migration on the manual work, and has higher efficiency of the automatic database migration compared with the manual processing.
Optionally, in another embodiment of the present invention, as shown in fig. 2, it is further disclosed that when the number of the target servers corresponding to the to-be-migrated database is multiple, the determining, according to the parameter information of the to-be-migrated database and the target server, whether the target server meets the database migration condition specifically includes:
s202, respectively judging whether each target server meets the database migration condition or not according to the parameter information of the database to be migrated and each target server;
specifically, when the database to be migrated corresponds to the plurality of target servers, it is determined whether the target servers meet the database migration condition, and actually, it is determined whether each of the plurality of target servers meets the database migration condition. Namely, according to the parameter information of the database to be migrated and each target server, whether each target server meets the database migration condition is respectively judged. It is understood that whether each target server satisfies the database migration condition is determined separately, that is, whether each target server satisfies the database migration condition is determined separately for each target server. In a specific implementation, each target server may be traversed sequentially in a traversal manner, and corresponding determination is performed once when a target server is traversed.
Meanwhile, when the database to be migrated corresponds to a plurality of target servers meeting the database migration condition, the database migration method disclosed by the embodiment of the invention further comprises the following steps:
when a plurality of target servers meet the database migration condition, executing step S203, adding the plurality of target servers meeting the database migration condition to a migration list, and determining a matching degree score between each target server and the database to be migrated according to the database to be migrated and parameter information of each target server in the migration list;
specifically, when it is determined through the judgment that a plurality of target servers meeting the database migration condition exist in the target server corresponding to the database to be migrated, the embodiment of the present invention may add the target servers meeting the database migration condition determined through the judgment to a preset migration list. It can be understood that, the target servers in the migration list generally satisfy the database migration condition, and may perform the migration of the database to be migrated. When the migration list stores servers which do not meet the database migration conditions, the servers can be distinguished through the identifiers, so that target servers suitable for database migration are screened from the servers which meet the migration conditions each time.
Further, in order to screen a target server most suitable for migration from the plurality of target servers meeting the data migration condition in the migration list, in the embodiment of the present invention, a matching degree score between each target server in the migration list and the database to be migrated is calculated respectively. The matching degree score represents the approximation degree between the resources required by the migration of the database to be migrated and the idle resources which can be used for accommodating the migration database by the target server. The closer the idle resource of the target server for receiving the migration database is to the resource required by the migration of the database to be migrated, the higher the matching degree score between the target server and the database to be migrated is, so that the resource of the target server can fully accommodate the database to be migrated, the independence of the data stored after the migration of the database to be migrated is ensured, the resources can be fully utilized, and the resource waste is avoided.
And after the matching degree score of each target server in the migration list and the database to be migrated is obtained through calculation, the obtained matching degree scores are respectively and correspondingly stored in the migration list. That is, for each target server in the migration list, the matching degree score of the target server and the database to be migrated is correspondingly stored.
S204, screening the target server with the highest matching degree score from the migration list so as to execute the step S205 and migrate the database to be migrated to the target server with the highest matching degree score.
Specifically, each target server in the migration list may be used to execute migration of the to-be-migrated database, and when the to-be-migrated database is specifically migrated, it becomes a question worth studying to which target server in the migration list to migrate to.
In the embodiment of the present invention, since the matching degree score between each target server in the migration list and the database to be migrated is obtained through calculation in step S203, the target server with the highest matching degree score is screened from the migration list in the embodiment of the present invention, and is used as the finally determined target server for migrating the database to be migrated.
Then, step S205 is executed to migrate the database to be migrated to the target server with the highest matching score, that is, to migrate the database to be migrated to the finally determined target server to which the database to be migrated is migrated.
Step S201 in this embodiment corresponds to step S101 in the method embodiment shown in fig. 1, and for the specific content, please refer to the content of the method embodiment shown in fig. 1, which is not described herein again.
Optionally, another embodiment of the present invention further discloses that the parameter information includes a disk capacity, and referring to fig. 3, the determining whether the target server meets the database migration condition includes:
s302, judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server;
if yes, executing step S303, and judging that the target server meets the database migration condition;
specifically, the residual disk capacity of the target server is obtained according to the parameter information of the target server, the disk capacity information required to be occupied by the database to be migrated is obtained according to the parameter information of the database to be migrated, and then the obtained residual disk capacity of the target server is compared with the disk capacity required to be occupied by the database to be migrated to determine whether the target server meets the database migration condition.
If the disk capacity occupied by the database to be migrated is less than the residual disk capacity of the target server, determining that the target server meets the database migration condition; otherwise, judging that the target server does not meet the database migration condition.
Alternatively, the following determination method may be adopted:
s304, judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not, and whether the ratio of the residual disk capacity of the target server to the total disk capacity of the target server is larger than a first preset ratio or not;
if yes, step S303 is executed to determine that the target server meets the database migration condition.
Specifically, in the above determining method, not only the relationship between the remaining disk capacity of the target server and the disk capacity occupied by the database to be migrated needs to be determined, but also whether the ratio of the remaining disk capacity of the target server to the total disk capacity of the target server is greater than a first preset ratio needs to be determined. The two determining steps may be executed simultaneously, or any one of the determining steps may be executed first, and then the other determining step is executed, which is not limited in the embodiment of the present invention.
In addition, in consideration of the basic attributes of the disks, early warning information is often sent out when the ratio of the remaining disk capacity to the total disk capacity (which may be referred to as the disk utilization) reaches a certain ratio, so that when a disk is selected, it is necessary to ensure that the disk utilization meets the requirements in addition to ensuring that the disk remaining space meets the requirements. The first preset ratio is preset, and the ratio of the first preset ratio can be changed according to actual conditions. It can be understood that the larger the ratio of the remaining disk capacity of the target server to the total disk capacity is, the lower the disk utilization rate of the target server is, the more the corresponding disk capacity that can be used for executing the database migration is, and the stronger the disk processing performance of the target server is, therefore, by setting the first preset ratio to determine whether the target server meets the database migration condition, it can be ensured that the target server with absolutely sufficient disk capacity and good performance is selected for the database migration.
The embodiment of the invention sets, and simultaneously judges whether the disk capacity occupied by the database to be migrated is less than the residual disk capacity of the target server or not and whether the ratio of the residual disk capacity of the target server to the total disk capacity of the target server is greater than a first preset ratio or not so as to judge whether the target server meets the database migration condition or not. And only when the disk capacity occupied by the database to be migrated is less than the residual disk capacity of the target server and the ratio of the residual disk capacity of the target server to the total disk capacity of the target server is greater than a first preset ratio, judging that the target server meets the database migration condition, otherwise, judging that the target server does not meet the database migration condition.
Steps S301 and S305 in this embodiment correspond to steps S101 and S103 in the method embodiment described in fig. 1, respectively, and for details, please refer to the contents of the method embodiment described in fig. 1, which is not described herein again.
Optionally, in another embodiment of the present invention, the parameter information further includes a memory space, as shown in fig. 4, before determining whether the target server meets the database migration condition, the method further includes:
s402, acquiring the residual memory space of the target server;
s403, acquiring a memory space occupied by the database to be migrated;
s404, calculating a difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
s405, calculating the ratio of the residual effective memory space of the target server to the residual memory space;
specifically, in the processing procedure, the remaining memory space of the target server and the memory space occupied by the database to be migrated are obtained respectively, and the difference between the two memory spaces is obtained, that is, the effective memory space remaining in the target server after the database to be migrated is migrated to the target server. Then, calculating to obtain a ratio (which may be called as a memory space residual rate) between the effective memory space and the remaining memory space of the target server, that is, calculating to obtain that the larger the memory space residual rate of the target server is after the to-be-migrated database is migrated to the target server, the larger the memory space residual rate of the target server is, the more the to-be-migrated database is migrated to the target server, the lower the occupancy of the remaining memory of the target server is, and the memory processing capacity of the target server is not affected too much; on the contrary, if the calculated ratio of the remaining effective memory space of the target server to the remaining memory space is small, it can be said that the occupancy rate of the remaining memory of the target server is high when the to-be-migrated database is migrated to the target server, which may bring a large influence on the memory processing capability of the target server.
Based on the above reasons, in the embodiment of the present invention, when determining whether the target server satisfies the database migration condition, the ratio between the remaining effective memory space of the target server and the remaining memory space is obtained by calculation according to the above steps, and is used as one of the factors for determining whether the target server satisfies the database migration condition.
Based on the processing procedure shown in fig. 3 for determining whether the target server satisfies the database migration condition, the determining procedure in the embodiment of the present invention further includes:
s408, judging whether the ratio of the residual effective memory space of the target server to the residual memory space is larger than a second preset ratio or not;
if yes, executing step S409, and judging that the target server meets the database migration condition.
Specifically, as described above, the larger the ratio of the remaining effective memory space of the target server to the remaining memory space is, the stronger the migration acceptance capability of the target server to the database to be migrated is, and the memory overload may not be brought to the target server by the database migration action. Therefore, in the embodiment of the present invention, a second preset ratio is set to determine whether the target server meets the database migration condition, and when the ratio of the remaining effective memory space of the target server to the remaining memory space of the target server is greater than the second preset ratio, the target server is considered to have sufficient memory resources to perform database migration, that is, the target server meets the database migration condition; otherwise, judging that the target server does not meet the database migration condition.
Steps S401 and S410 in this embodiment correspond to steps S301 and S306 in the method example shown in fig. 4, respectively, for details, please refer to the contents of the method embodiment shown in fig. 3, which is not described herein again.
Optionally, in another embodiment of the present invention, the parameter information further includes a CPU utilization rate, as shown in fig. 5, before determining whether the target server meets the database migration condition, the method further includes:
s502, acquiring the data volume of the database to be migrated;
s503, calculating the data retrieval amount of the database to be migrated according to the data amount;
s504, calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
specifically, the data volume of the database to be migrated refers to the total amount of data stored in the database to be migrated, including data that is frequently read and used, and data that is simply stored in the database.
The data retrieval amount of the database to be migrated refers to the amount of data that needs to be retrieved or read out of the total amount of data in the database, that is, data other than data that is used for storage only. The data retrieval quantity represents the data quantity which is really required to be read or used in the database to be migrated, and for the processing of the data, more CPU resources of the server are required to be occupied.
According to the processing procedure, the data volume of the database to be migrated is obtained, the data retrieval volume in the data volume of the database to be migrated is obtained through calculation according to the data volume of the database to be migrated and by combining with experience such as the type of stored data, the frequency of data use and the like, and then the CPU utilization rate of the target server in data retrieval is obtained through calculation according to the data retrieval volume of the database to be migrated, wherein the data retrieval volume specifically refers to the data retrieval volume for retrieving the database to be migrated, and the CPU utilization rate of the target server in data retrieval is calculated according to the data retrieval volume of the database to be migrated by combining with relevant parameter indexes of a CPU by adopting a relevant calculation method in the prior art.
The CPU utilization when the target server executes data retrieval characterizes a CPU ratio used by the target server to execute data retrieval on the database after the database to be migrated is migrated to the target server, that is, a CPU utilization increase amount brought to the target server after the database to be migrated is migrated to the target server.
Based on the processing procedure shown in fig. 3 for determining whether the target server satisfies the database migration condition, the determining procedure in the embodiment of the present invention further includes:
s507, judging whether the CPU utilization rate is smaller than a third preset ratio or not;
if yes, step S508 is executed to determine that the target server meets the database migration condition.
Specifically, the above description shows that the CPU utilization when the target server performs data retrieval is obtained by calculation, which represents the CPU utilization increase brought to the target server after the database to be migrated is migrated to the target server. Theoretically, the smaller the increase in CPU utilization brought to the target server by the migration database, the better. The smaller the increase of the CPU utilization rate brought to the target server, the smaller the load change brought to the CPU of the target server by the database migration, the less the CPU performance of the target server is influenced, and the more the corresponding target server is suitable for database migration.
Therefore, in the embodiment of the present invention, a third preset ratio is set, and when it is determined whether the target server satisfies the database migration condition, it is determined whether the CPU utilization when the target server performs data retrieval, which is calculated according to the above steps, is smaller than the third preset ratio. If the CPU utilization rate of the target server for executing data retrieval is smaller than the third preset ratio, the CPU utilization rate increment brought to the target server by the database migration is smaller, and the target server can be used for executing the database migration, namely, the target server is judged to meet the database migration condition; if the CPU utilization rate of the target server during data retrieval is not less than the third preset ratio, it indicates that the CPU utilization rate increment brought to the target server by the database migration is large, and if the data retrieval is performed, the CPU utilization rate of the target server may be overloaded, so that it is determined that the target server does not satisfy the database migration condition.
It should be noted that, in the present application, the first preset ratio, the second preset ratio and the third preset ratio are only names that are different and do not represent that the numerical values are necessarily different, and each ratio may be specifically set or modified according to different requirements on the processing capability of the database, so that the numerical values of the first preset ratio, the second preset ratio and the third preset ratio may be the same or different, and the embodiment of the present invention is not specifically limited.
Steps S501 and S509 in this embodiment correspond to steps S301 and S306 in the method example shown in fig. 4, respectively, and for details, please refer to the contents of the method embodiment shown in fig. 3, which is not described herein again.
Optionally, in another embodiment of the present invention, when the target server does not satisfy the database migration condition, the method further includes: and adjusting the configuration of the target server which does not meet the database migration condition within the set configuration requirement range.
Specifically, when determining whether the target server satisfies the database migration condition according to the parameter information of the database to be migrated and the target server, if it is determined that the target server does not satisfy the database migration condition, the embodiment of the present invention adjusts the configuration of the target server that does not satisfy the database migration condition so as to satisfy the database migration condition. Hardware resources such as disk capacity, memory, and cpu of the target server are enlarged so that the target server has sufficient disk capacity, memory, and cpu to satisfy the database migration condition. Of course, the adjustment herein may include not only the actual adjustment, but also sending out an adjustment reminder or suggestion, such as: and recommending to delete the files which are stored in the target server for a certain time and are not accessed, or recommending to what extent the memory of the target server is expanded, and the like.
The adjustment needs to be performed within a set configuration requirement range, and cannot be performed freely without limitation. For example, if the disk capacity of the target server is insufficient and the target server does not satisfy the database migration condition, the disk capacity of the target server may be increased to a certain extent within the disk capacity extremum of the target server, so that the target server has sufficient disk capacity to satisfy the database migration condition. However, if the disk capacity of the target server is adjusted to the extreme value so that the disk capacity of the target server cannot meet the database migration condition, the disk capacity of the target server cannot be adjusted so that the disk capacity of the target server cannot meet the database migration condition, and the target server can only be abandoned.
It should be noted that, in the embodiment of the present invention, when the disk capacity of the target server is adjusted, the adjustment may be performed during the operation of the server, but for the adjustment of the memory and the cpu, the adjustment may often be performed in an idle state such as shutdown of the server, and then the server is restarted.
In the embodiment of the present invention, a countermeasure for judging that the target server does not satisfy the database migration condition is further disclosed, which includes:
dividing the database to be migrated into a plurality of sub databases;
for each sub-database, the following operations are performed:
judging whether the target server meets a database migration condition or not according to the parameter information of the sub-database and the target server;
specifically, since the sub-databases are obtained by dividing the database to be migrated, the parameter information of each sub-database is also determined when the parameter information of the database to be migrated is known.
For a specific determination process of determining whether the target server satisfies the database migration condition of the sub-database, please refer to the determination process described in any of the above embodiments, which is not described herein again.
And if the target server meets the database migration condition, migrating the sub-database to the target server.
Specifically, after the target server is judged to satisfy the database migration condition, the sub-database is migrated to the target server.
And migrating each sub-database obtained by dividing the database to be migrated according to the processing steps, and migrating the database to be migrated after all the sub-databases are migrated to the target server.
In addition, it should be noted that the technical solution of the embodiment of the present invention can be used for performing migration processing on a database to be migrated when a target server does not satisfy a database migration condition, and can also perform migration on a plurality of sub-databases after the database to be migrated is divided when the database to be migrated is large, thereby effectively improving migration efficiency.
The embodiment of the present invention also discloses a database migration apparatus, as shown in fig. 6, the apparatus includes:
a parameter obtaining unit 100, configured to obtain parameter information of a database to be migrated and a target server;
a determining unit 110, configured to determine whether the target server meets a database migration condition according to the parameter information of the database to be migrated and the target server;
a migration unit 120, configured to, when the determination processing unit determines that the target server meets the database migration condition, migrate the database to be migrated to the target server.
Optionally, in another embodiment of the present invention, the parameter information includes a disk capacity, and referring to fig. 7, the determining unit 110 includes:
a first determining module 1101, configured to determine whether the disk capacity required by the database to be migrated is smaller than the remaining disk capacity of the target server;
a second determining module 1102, configured to determine that the target server meets a database migration condition when the determination result of the first determining module 1101 is yes; or,
a third determining module 1103, configured to determine whether the disk capacity that the database to be migrated needs to occupy is smaller than the remaining disk capacity of the target server, and whether a ratio of the remaining disk capacity of the target server to the total disk capacity of the target server is greater than a first preset ratio;
a fourth determining module 1104, configured to determine that the target server meets the database migration condition when the determination result of the third determining module 1103 is yes.
Optionally, in another embodiment of the present invention, the parameter information further includes a memory space, and the apparatus further includes:
the first acquisition module is used for acquiring the residual memory space of the target server;
the second acquisition module is used for acquiring the memory space occupied by the database to be migrated;
the first calculation module is used for calculating the difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
the second calculation module is used for calculating the ratio of the residual effective memory space of the target server to the residual memory space;
the judging unit further includes:
a fifth judging module, configured to judge whether a ratio of a remaining effective memory space of the target server to the remaining memory space is greater than a second preset ratio;
a sixth judging module, configured to, when the judgment result of the fifth judging module is yes, judge that the target server meets the database migration condition.
Optionally, in another embodiment of the present invention, the parameter information further includes a CPU utilization, and the apparatus further includes:
the third acquisition module is used for acquiring the data volume of the database to be migrated;
the third calculation module is used for calculating the data retrieval amount of the database to be migrated according to the data amount;
the fourth calculation module is used for calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
the judging unit further includes:
a seventh judging module, configured to judge whether the CPU utilization is smaller than a third preset ratio;
and the eighth judging module is used for judging that the target server meets the database migration condition when the seventh judging module judges that the result is yes.
It should be noted that, for the specific working contents of each unit and module of the database migration apparatus disclosed in the foregoing embodiments, please refer to the contents of the foregoing method embodiments, which are not described herein again.
The database migration device comprises a processor and a memory, wherein the parameter acquisition unit, the judgment unit, the migration unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. One or more than one kernel can be set, and automatic database migration is realized by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, and the program implements the database migration method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the database migration method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
acquiring parameter information of a database to be migrated and a target server;
judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server;
and if the target server meets the database migration condition, migrating the database to be migrated to the target server.
Optionally, when the number of the target servers is multiple, the determining, according to the parameter information of the database to be migrated and the target server, whether the target server meets a database migration condition specifically includes:
respectively judging whether each target server meets the database migration condition or not according to the parameter information of the database to be migrated and each target server;
the method further comprises the following steps:
when a plurality of target servers meet database migration conditions, adding the target servers meeting the database migration conditions into a migration list, and determining matching degree scores between the target servers and the database to be migrated according to the database to be migrated and parameter information of the target servers in the migration list;
and screening the target server with the highest matching degree score from the migration list so as to migrate the database to be migrated to the target server with the highest matching degree score.
Optionally, the parameter information includes a disk capacity, and the determining whether the target server meets the database migration condition includes:
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not;
if so, judging that the target server meets the database migration condition; or,
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not, and whether the ratio of the residual disk capacity of the target server to the total disk capacity of the target server is larger than a first preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, the parameter information further includes a memory space, and before determining whether the target server meets the database migration condition, the method further includes:
acquiring the residual memory space of the target server;
acquiring a memory space required to be occupied by the database to be migrated;
calculating the difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
calculating the ratio of the residual effective memory space of the target server to the residual memory space;
the judging whether the target server meets the database migration condition further comprises:
judging whether the ratio of the residual effective memory space of the target server to the residual memory space is larger than a second preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, the parameter information further includes a CPU utilization rate, and before determining whether the target server satisfies the database migration condition, the method further includes:
acquiring the data volume of the database to be migrated;
calculating the data retrieval amount of the database to be migrated according to the data amount;
calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
the judging whether the target server meets the database migration condition further comprises:
judging whether the CPU utilization rate is smaller than a third preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, when the target server does not satisfy the database migration condition, the method further includes:
adjusting the configuration of the target server which does not meet the database migration condition within the set configuration requirement range; or
Dividing the database to be migrated into a plurality of sub databases;
for each sub-database, the following operations are performed:
judging whether the target server meets a database migration condition or not according to the parameter information of the sub-database and the target server;
and if the target server meets the database migration condition, migrating the sub-database to the target server.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring parameter information of a database to be migrated and a target server;
judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server;
and if the target server meets the database migration condition, migrating the database to be migrated to the target server.
Optionally, when the number of the target servers is multiple, the determining, according to the parameter information of the database to be migrated and the target server, whether the target server meets a database migration condition specifically includes:
respectively judging whether each target server meets the database migration condition or not according to the parameter information of the database to be migrated and each target server;
the method further comprises the following steps:
when a plurality of target servers meet database migration conditions, adding the target servers meeting the database migration conditions into a migration list, and determining matching degree scores between the target servers and the database to be migrated according to the database to be migrated and parameter information of the target servers in the migration list;
and screening out the target server with the highest matching degree score from the migration list so as to migrate the database to be migrated to the target server with the highest matching degree score.
Optionally, the parameter information includes a disk capacity, and the determining whether the target server meets the database migration condition includes:
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not;
if so, judging that the target server meets the database migration condition; or,
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not, and whether the ratio of the residual disk capacity of the target server to the total disk capacity of the target server is larger than a first preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, the parameter information further includes a memory space, and before determining whether the target server meets the database migration condition, the method further includes:
acquiring the residual memory space of the target server;
acquiring a memory space occupied by the database to be migrated;
calculating the difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
calculating the ratio of the residual effective memory space of the target server to the residual memory space;
the judging whether the target server meets the database migration condition further comprises:
judging whether the ratio of the residual effective memory space of the target server to the residual memory space is larger than a second preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, the parameter information further includes a CPU utilization rate, and before determining whether the target server satisfies the database migration condition, the method further includes:
acquiring the data volume of the database to be migrated;
calculating the data retrieval amount of the database to be migrated according to the data amount;
calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
the judging whether the target server meets the database migration condition further comprises:
judging whether the CPU utilization rate is smaller than a third preset ratio or not;
if so, judging that the target server meets the database migration condition.
Optionally, when the target server does not satisfy the database migration condition, the method further includes:
adjusting the configuration of the target server which does not meet the database migration condition within the set configuration requirement range; or alternatively
Dividing the database to be migrated into a plurality of sub databases;
for each sub-database, the following operations are performed:
judging whether the target server meets a database migration condition or not according to the parameter information of the sub-database and the target server;
and if the target server meets the database migration condition, migrating the sub-database to the target server.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (9)

1. A method of database migration, comprising:
acquiring parameter information of a database to be migrated and a target server;
judging whether the target server meets a database migration condition or not according to the parameter information of the database to be migrated and the target server;
if the target server meets the database migration condition, migrating the database to be migrated to the target server;
when the target server does not satisfy the database migration condition, the method further includes:
adjusting the configuration of the target server which does not meet the database migration condition within the set configuration requirement range; or
Dividing the database to be migrated into a plurality of sub databases;
for each sub-database, the following operations are performed:
judging whether the target server meets a database migration condition or not according to the parameter information of the sub-database and the target server;
if the target server meets the database migration condition, migrating the sub-database to the target server;
when the number of the target servers is multiple, the method for judging whether the target servers meet the database migration condition according to the parameter information of the database to be migrated and the parameter information of the target servers specifically includes:
respectively judging whether each target server meets the database migration condition or not according to the parameter information of the database to be migrated and each target server;
the method further comprises the following steps:
when a plurality of target servers meet database migration conditions, adding the plurality of target servers meeting the database migration conditions into a migration list, and determining matching degree scores between each target server and the database to be migrated according to the database to be migrated and parameter information of each target server in the migration list;
screening out a target server with the highest matching degree score from the migration list so as to migrate the database to be migrated to the target server with the highest matching degree score;
the matching degree score represents the approximation degree between the resources required by migration of the database to be migrated and the idle resources which can be used for accepting the migration database by the target server, and the closer the idle resources which can be used for accepting the migration database by the target server are to the resources required by migration of the database to be migrated, the higher the matching degree score between the target server and the database to be migrated is, so that the resources of the target server can fully accommodate the database to be migrated, the independence of data stored after migration of the database to be migrated is ensured, the resources can be fully utilized, and resource waste is avoided.
2. The method of claim 1, wherein the parameter information includes disk capacity, and wherein the determining whether the target server satisfies the database migration condition includes:
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not;
if so, judging that the target server meets the database migration condition; or,
judging whether the disk capacity occupied by the database to be migrated is smaller than the residual disk capacity of the target server or not, and whether the ratio of the residual disk capacity of the target server to the total disk capacity of the target server is larger than a first preset ratio or not;
if so, judging that the target server meets the database migration condition.
3. The method of claim 2, wherein the parameter information further includes memory space, and before determining whether the target server satisfies the database migration condition, the method further comprises:
acquiring the residual memory space of the target server;
acquiring a memory space occupied by the database to be migrated;
calculating the difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
calculating the ratio of the residual effective memory space of the target server to the residual memory space;
the judging whether the target server meets the database migration condition further comprises:
judging whether the ratio of the residual effective memory space of the target server to the residual memory space is larger than a second preset ratio or not;
if so, judging that the target server meets the database migration condition.
4. The method of claim 2, wherein the parameter information further includes CPU usage, and before determining whether the target server satisfies the database migration condition, the method further comprises:
acquiring the data volume of the database to be migrated;
calculating the data retrieval amount of the database to be migrated according to the data amount;
calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
the judging whether the target server meets the database migration condition further comprises:
judging whether the CPU utilization rate is smaller than a third preset ratio or not;
if so, judging that the target server meets the database migration condition.
5. A database migration apparatus, comprising:
the parameter acquisition unit is used for acquiring parameter information of the database to be migrated and the target server;
the judging unit is used for judging whether the target server meets the database migration condition or not according to the parameter information of the database to be migrated and the target server;
the migration unit is used for migrating the database to be migrated to the target server when the judgment processing unit judges that the target server meets the database migration condition; when the target server does not meet the database migration condition, adjusting the configuration of the target server which does not meet the database migration condition within a set configuration requirement range; or dividing the database to be migrated into a plurality of sub databases; for each sub-database, the following operations are performed: judging whether the target server meets a database migration condition or not according to the parameter information of the sub-database and the target server; if the target server meets the database migration condition, migrating the sub-database to the target server;
the database migration apparatus is further configured to, when the number of the target servers is multiple, determine whether the target server meets a database migration condition according to the parameter information of the database to be migrated and the target server, and specifically includes:
respectively judging whether each target server meets the database migration condition or not according to the parameter information of the database to be migrated and each target server;
the device further comprises:
when a plurality of target servers meet database migration conditions, adding the plurality of target servers meeting the database migration conditions into a migration list, and determining matching degree scores between each target server and the database to be migrated according to the database to be migrated and parameter information of each target server in the migration list;
screening out a target server with the highest matching degree score from the migration list so as to migrate the database to be migrated to the target server with the highest matching degree score;
the matching degree score represents the approximation degree between the resources required by migration of the database to be migrated and the idle resources which can be used for accepting the migration database by the target server, and the closer the idle resources which can be used for accepting the migration database by the target server are to the resources required by migration of the database to be migrated, the higher the matching degree score between the target server and the database to be migrated is, so that the resources of the target server can fully accommodate the database to be migrated, the independence of data stored after migration of the database to be migrated is ensured, the resources can be fully utilized, and resource waste is avoided.
6. The apparatus according to claim 5, wherein the parameter information includes a disk capacity, and the determining unit includes:
the first judgment module is used for judging whether the disk capacity required by the database to be migrated is smaller than the residual disk capacity of the target server;
the second judgment module is used for judging that the target server meets the database migration condition when the judgment result of the first judgment module is yes; or,
a third judging module, configured to judge whether the disk capacity that the database to be migrated needs to occupy is smaller than the remaining disk capacity of the target server, and whether a ratio of the remaining disk capacity of the target server to the total disk capacity of the target server is greater than a first preset ratio;
and the fourth judging module is used for judging that the target server meets the database migration condition when the third judging module judges that the result is yes.
7. The apparatus of claim 6, wherein the parameter information further comprises memory space, the apparatus further comprising:
the first acquisition module is used for acquiring the residual memory space of the target server;
the second acquisition module is used for acquiring the memory space occupied by the database to be migrated;
the first calculation module is used for calculating the difference value between the residual memory space of the target server and the memory space occupied by the database to be migrated to obtain the residual effective memory space of the target server;
the second calculation module is used for calculating the ratio of the residual effective memory space of the target server to the residual memory space;
the judging unit further includes:
a fifth judging module, configured to judge whether a ratio of a remaining effective memory space of the target server to the remaining memory space is greater than a second preset ratio;
a sixth judging module, configured to, when the fifth judging module judges that the result is yes, judge that the target server meets a database migration condition;
or, the parameter information further includes CPU utilization, and the apparatus further includes:
the third acquisition module is used for acquiring the data volume of the database to be migrated;
the third calculation module is used for calculating the data retrieval amount of the database to be migrated according to the data amount;
the fourth calculation module is used for calculating the CPU utilization rate of the target server when executing data retrieval according to the data retrieval amount;
the judging unit further includes:
a seventh judging module, configured to judge whether the CPU utilization is smaller than a third preset ratio;
and the eighth judging module is used for judging that the target server meets the database migration condition when the seventh judging module judges that the result is yes.
8. A storage medium, characterized in that the storage medium has stored thereon a program which, when executed by a processor, implements the database migration method according to any one of claims 1 to 4.
9. A processor, configured to execute a program, wherein the program executes to perform the database migration method according to any one of claims 1 to 4.
CN201810716189.2A 2018-07-03 2018-07-03 Database migration method and device Active CN110737717B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810716189.2A CN110737717B (en) 2018-07-03 2018-07-03 Database migration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810716189.2A CN110737717B (en) 2018-07-03 2018-07-03 Database migration method and device

Publications (2)

Publication Number Publication Date
CN110737717A CN110737717A (en) 2020-01-31
CN110737717B true CN110737717B (en) 2022-09-09

Family

ID=69234349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810716189.2A Active CN110737717B (en) 2018-07-03 2018-07-03 Database migration method and device

Country Status (1)

Country Link
CN (1) CN110737717B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562889B (en) * 2020-05-14 2023-05-02 杭州海康威视系统技术有限公司 Data processing method, device, system and storage medium
CN111694517B (en) * 2020-05-28 2024-02-13 新浪技术(中国)有限公司 Distributed data migration method, system and electronic equipment
CN111782396B (en) * 2020-07-01 2022-12-23 浪潮云信息技术股份公司 Concurrency elastic control method based on distributed database
CN112148713B (en) * 2020-09-29 2024-04-16 中国银行股份有限公司 Method and device for data migration between heterogeneous databases

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103617076A (en) * 2013-10-31 2014-03-05 中兴通讯股份有限公司 Method and system for dispatching virtualized resources and server
US20150248404A1 (en) * 2014-02-28 2015-09-03 Red Hat, Inc. Database schema migration
JP2016045839A (en) * 2014-08-26 2016-04-04 株式会社日立製作所 Communication system, management computer, and session information transfer method
CN106339386B (en) * 2015-07-08 2019-12-24 阿里巴巴集团控股有限公司 Database flexible scheduling method and device
CN106339388A (en) * 2015-07-08 2017-01-18 阿里巴巴集团控股有限公司 Flexible scheduling method and device for database
CN106331160A (en) * 2016-09-28 2017-01-11 乐视控股(北京)有限公司 Data migration method and system
CN107357896A (en) * 2017-07-13 2017-11-17 北京小度信息科技有限公司 Expansion method, device, system and the data base cluster system of data-base cluster

Also Published As

Publication number Publication date
CN110737717A (en) 2020-01-31

Similar Documents

Publication Publication Date Title
CN110737717B (en) Database migration method and device
CN112346829B (en) Method and equipment for task scheduling
CN101218557B (en) Systems and methods for memory migration
CN107783734B (en) Resource allocation method, device and terminal based on super-fusion storage system
CN109669776B (en) Detection task processing method, device and system
US10356150B1 (en) Automated repartitioning of streaming data
CN110609743A (en) Method, electronic device and computer program product for configuring resources
CN111464583B (en) Computing resource allocation method, device, server and storage medium
CN106339386B (en) Database flexible scheduling method and device
CN103077197A (en) Data storing method and device
CN111061752A (en) Data processing method and device and electronic equipment
US10248618B1 (en) Scheduling snapshots
CN113177050A (en) Data balancing method, device, query system and storage medium
CN106020717B (en) Data processing method and electronic equipment
CN109388644B (en) Data updating method and device
CN110928941B (en) Data fragment extraction method and device
CN116594734A (en) Container migration method and device, storage medium and electronic equipment
CN112269530A (en) Data storage management method and related device
CN115994029A (en) Container resource scheduling method and device
US20190087156A1 (en) Sorting a table in analytical databases
CN108733484B (en) Method and device for managing application program
CN109828718B (en) Disk storage load balancing method and device
CN109582938B (en) Report generation method and device
CN111104065A (en) File storage method, device and equipment
CN106557469B (en) Method and device for processing data in data warehouse

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant