Oracle database compatibility rate portrait generation method, equipment and medium

By obtaining metadata in Oracle database, generating SQL syntax trees and comparing them with the preset database feature templates, the compatibility rate portrait is built, and the problem of low accuracy and efficiency when manually detecting database compatibility is solved, and efficient and accurate database compatibility evaluation is achieved.

CN119621705APending Publication Date: 2025-03-14HIGHGO SOFTWARE
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411726744.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the prior art, when manually detecting database compatibility, the accuracy and efficiency are low, and require a lot of labor costs.

Method used

By obtaining metadata in the target Oracle database, generating an SQL syntax tree, and comparing it with the preset database feature template, determining feature compatibility, and building an Oracle database compatibility image to automatically analyze the database architecture and evaluate compatibility.

Benefits of technology

Improve the accuracy and speed of feature compatibility determination, realize automated analysis of database architecture, quickly locate incompatible SQL statements, objectively evaluate compatibility, and reduce labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621705A_ABST
    Figure CN119621705A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an Oracle database compatibility rate portrait generation method and device and a medium, belongs to the technical field of databases, and solves the problem of low accuracy and efficiency of manual database compatibility rate detection. Performing data analysis on the metadata to obtain database object information; constructing a syntax tree to obtain reference characteristics; comparing the reference characteristics with a preset database characteristic template, and determining characteristic compatibility corresponding to the reference characteristics; classifying the database object information to obtain different types of database objects; wherein each database object corresponds to a plurality of reference characteristics; the method comprises the steps of determining a characteristic compatibility condition corresponding to each database object based on characteristic compatibility corresponding to a plurality of reference characteristics in the database objects and a preset characteristic compatibility priority, and constructing an Oracle database compatibility rate portrait according to database object information and the characteristic compatibility condition to determine the compatibility rate of a target Oracle database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a method, device and medium for generating a compatibility profile of an Oracle database. Background Art

[0002] Oracle database is a software system used to store, manage, and retrieve large amounts of data. When performing data compatibility analysis on an Oracle database, after obtaining the database metadata, it is usually necessary to rely on database personnel with extensive database knowledge to combine their Oracle database knowledge with practical experience to conduct an in-depth analysis of key factors such as database architecture and data volume in order to make a preliminary judgment on the compatibility of the database.

[0003] However, relying on expert experience is difficult to ensure the objectivity and accuracy of compatibility judgments, and there is a certain degree of subjectivity and uncertainty. Secondly, faced with a large number of database object definition language sets in the source database, database technicians need to review them one by one and carefully identify which SQL statements are compatible with the target database and which are not. For incompatible SQL statements, it is also necessary to determine whether they are incompatible in terms of syntax, semantics, lexical structure, etc. Therefore, the manual detection of database compatibility is not only low in accuracy and efficiency, but also requires a lot of labor costs. Summary of the invention

[0004] The embodiments of the present application provide a method, device and medium for generating an Oracle database compatibility rate portrait, which are used to solve the following technical problems: the manual detection of database compatibility rate not only has low accuracy and efficiency, but also requires a lot of labor costs.

[0005] The present application embodiment adopts the following technical solutions:

[0006] The embodiment of the present application provides a method for generating an Oracle database compatibility rate portrait, including obtaining metadata in a target Oracle database, performing data analysis on the metadata, and obtaining database object information; generating an SQL syntax tree based on the database object information, performing node information analysis on the SQL syntax tree, and obtaining reference characteristics corresponding to each DDL statement; comparing the reference characteristics with a preset database characteristic template to determine the characteristic compatibility corresponding to the reference characteristics; classifying the database object information based on the database object type to obtain different types of database objects; wherein each database object corresponds to a plurality of reference characteristics; determining the characteristic compatibility corresponding to each database object based on the characteristic compatibilities corresponding to the plurality of reference characteristics in the database object and the preset characteristic compatibility priority; constructing an Oracle database compatibility rate portrait according to the database object information and the characteristic compatibility, so as to determine the compatibility rate of the target Oracle database based on the Oracle database compatibility rate portrait.

[0007] The embodiment of the present application can automatically determine the feature compatibility corresponding to the reference feature by comparing the reference feature with the preset database feature template, which not only improves the accuracy of feature compatibility determination, but also improves the speed of feature compatibility determination. Secondly, the embodiment of the present application constructs a syntax tree for metadata analysis, and based on the feature compatibility corresponding to multiple reference features of the database object and the preset feature compatibility priority, determines the feature compatibility corresponding to each database object, constructs an Oracle database compatibility rate portrait, can automatically analyze the database architecture, quickly locate incompatible SQL statements, objectively evaluate compatibility, and quickly grasp the compatibility of the entire Oracle database.

[0008] In one implementation of the present application, an SQL syntax tree is generated based on database object information, and node information of the SQL syntax tree is parsed to obtain reference characteristics corresponding to each DDL statement, specifically including: parsing the DDL statements in the acquired target Oracle database through a preset SQL parsing tool to generate an SQL syntax tree corresponding to the target Oracle database; parsing the syntax information corresponding to the current DDL statement in the SQL syntax tree; and parsing the keyword information and lexical information contained in the current DDL statement in each node information of the SQL syntax tree; and determining the reference characteristics corresponding to each DDL statement based on the syntax information, keyword information and lexical information.

[0009] In one implementation of the present application, a reference feature is compared with a preset database feature template to determine the feature compatibility corresponding to the reference feature, specifically including: comparing the reference feature with the template feature in the preset database feature template; wherein the preset database feature template includes at least multiple template features, and also includes feature compatibilities corresponding to the multiple template features; the template feature is related to template syntax information, template semantic information and template keyword information; in case of consistency in the comparison, the feature compatibility corresponding to the reference feature is determined based on the preset database feature template; wherein the feature compatibility includes at least one of compatible, incompatible, reviewed and ignored.

[0010] In one implementation of the present application, database object information is classified based on database object types to obtain different types of database objects, specifically including: determining database object information; wherein the database object information includes at least one of the object name, owner, mode, size, and DDL statement; based on the database object type, dividing the database object information into multiple database objects; wherein the database object type includes at least one of the table, view, function, and stored procedure; based on the database object type, dividing the multiple database objects into common database objects and special database objects; performing common attribute recording for common database objects, and performing common attribute recording and special attribute recording for special database objects.

[0011] In one implementation of the present application, based on the feature compatibilities corresponding to multiple reference features in the database object and the preset feature compatibility priority, the feature compatibility status corresponding to each database object is determined, specifically including: determining multiple reference features corresponding to the current database object, and determining the feature compatibilities corresponding to the multiple reference features; comparing the multiple feature compatibilities with the preset feature compatibility priorities to determine the highest priority feature compatibility corresponding to the current database object; based on the highest priority compatibility, determining the feature compatibility status corresponding to the current database object.

[0012] In one implementation of the present application, the compatibility rate of the target Oracle database is determined based on the feature compatibility situation, specifically including: determining the database object compatibility number based on the feature compatibility situation corresponding to each database object; and determining the feature compatibility number based on the feature compatibility corresponding to the reference feature; obtaining the total number of database objects and the total number of reference features corresponding to the target Oracle database; and obtaining the compatibility rate of the target Oracle database based on the database object compatibility number, the feature compatibility number, the total number of database objects and the total number of reference features.

[0013] In one implementation of the present application, the compatibility rate of a target Oracle database is determined based on an Oracle database compatibility rate portrait, specifically including: determining a database object compatibility number based on feature compatibilities corresponding to each database object in the Oracle database compatibility rate portrait; and determining a feature compatibility number based on feature compatibility corresponding to a reference feature in the Oracle database compatibility rate portrait; obtaining the total number of database objects and the total number of reference features corresponding to the target Oracle database; and obtaining the compatibility rate of the target Oracle database based on the database object compatibility number, the feature compatibility number, the total number of database objects and the total number of reference features.

[0014] In one implementation of the present application, an Oracle database compatibility rate portrait is constructed based on database object information and feature compatibility, specifically including: constructing an Oracle database compatibility rate portrait based on various data information obtained during the process of determining the compatibility of the target Oracle database, and visually displaying the Oracle database compatibility rate portrait; wherein the various data information includes at least one of a data distribution diagram, database characteristics, database system / user dependencies, object attributes, and table space usage data.

[0015] The embodiment of the present application provides an Oracle database compatibility rate portrait generation device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: obtain metadata in a target Oracle database, perform data analysis on the metadata, and obtain database object information; generate an SQL syntax tree based on the database object information, perform node information analysis on the SQL syntax tree, and obtain reference characteristics corresponding to each DDL statement; compare the reference characteristics with a preset database characteristic template to determine the characteristic compatibility corresponding to the reference characteristics; classify the database object information based on the database object type to obtain different types of database objects; wherein each database object corresponds to multiple reference characteristics; based on the characteristic compatibilities corresponding to the multiple reference characteristics in the database object, and the preset characteristic compatibility priority, determine the characteristic compatibility corresponding to each database object, and construct an Oracle database compatibility rate portrait based on the database object information and the characteristic compatibility, so as to determine the compatibility rate of the target Oracle database based on the Oracle database compatibility rate portrait.

[0016] A non-volatile computer storage medium provided by an embodiment of the present application stores computer executable instructions, wherein the computer executable instructions are configured to: obtain metadata in a target Oracle database, perform data analysis on the metadata, and obtain database object information; generate an SQL syntax tree based on the database object information, perform node information analysis on the SQL syntax tree, and obtain reference characteristics corresponding to each DDL statement; compare the reference characteristics with a preset database characteristic template to determine the characteristic compatibility corresponding to the reference characteristics; classify the database object information based on the database object type to obtain different types of database objects; wherein each database object corresponds to multiple reference characteristics; based on the characteristic compatibilities corresponding to the multiple reference characteristics in the database object, and the preset characteristic compatibility priority, determine the characteristic compatibility corresponding to each database object, and construct an Oracle database compatibility rate portrait based on the database object information and the characteristic compatibility, so as to determine the compatibility rate of the target Oracle database based on the Oracle database compatibility rate portrait.

[0017] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the embodiments of the present application can automatically determine the feature compatibility corresponding to the reference feature by comparing the reference feature with the preset database feature template, which not only improves the accuracy of feature compatibility determination, but also improves the speed of feature compatibility determination. Secondly, the embodiments of the present application construct a syntax tree for metadata analysis, and based on the feature compatibility corresponding to multiple reference features of the database object and the preset feature compatibility priority, determine the feature compatibility corresponding to each database object, the Oracle database compatibility rate portrait, can automatically analyze the database architecture, quickly locate incompatible SQL statements, objectively evaluate compatibility, and quickly grasp the compatibility of the entire Oracle database. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0019] Figure 1 A flow chart of a method for generating a compatibility profile of an Oracle database provided in an embodiment of the present application;

[0020] Figure 2 A flowchart of determining the compatibility rate of an Oracle database provided in an embodiment of the present application;

[0021] Figure 3A schematic diagram of the structure of an Oracle database compatibility rate portrait generation device provided in an embodiment of the present application.

[0022] Reference numerals:

[0023] 200: Oracle database compatibility profile generation device, 201: processor, 202: memory. DETAILED DESCRIPTION

[0024] The embodiments of the present application provide a method, device and medium for generating a compatibility profile of an Oracle database.

[0025] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0026] The technical solution proposed in the embodiment of the present invention is described in detail below with reference to the accompanying drawings.

[0027] Figure 1 A flow chart of a method for generating a compatibility profile of an Oracle database provided in an embodiment of the present application is as follows: Figure 1 As shown, the Oracle database compatibility rate profile generation method includes the following steps:

[0028] S101. Obtain metadata in a target Oracle database, perform data analysis on the metadata, and obtain database object information.

[0029] In one embodiment of the present application, the Oracle database is first connected to ensure that a stable and secure connection channel is established between the system and the Oracle database to lay a solid foundation for subsequent operations.

[0030] In one embodiment of the present application, various metadata are collected from the target Oracle database, covering the definition and properties of database objects such as table structure, index, constraint, view, stored procedure, trigger, custom type, etc. These metadata are important cornerstones for generating database portraits and are crucial for subsequent analysis.

[0031] Furthermore, the collected target Oracle database metadata is parsed to extract database object information such as object name, owner, mode, size, DDL statements, etc.

[0032] S102: Generate an SQL syntax tree based on database object information, parse node information of the SQL syntax tree, and obtain reference characteristics corresponding to each DDL statement.

[0033] In one embodiment of the present application, a preset SQL parsing tool is used to parse the DDL statements in the acquired target Oracle database to generate a SQL syntax tree corresponding to the target Oracle database. The syntax information corresponding to the current DDL statement is parsed in the SQL syntax tree; and the keyword information and lexical information contained in the current DDL statement are parsed in each node information of the SQL syntax tree. The reference characteristics corresponding to each DDL statement are determined based on the syntax information, keyword information and lexical information.

[0034] Specifically, the collected DDL statements are parsed by an SQL parsing tool to generate an Oracle SQL syntax tree, the syntax used by the current DDL is parsed from the syntax tree, and the keywords and lexical information contained in the current DDL are parsed from the information of each node in the syntax tree.

[0035] Further, the DDL statement in the embodiment of the present application is a SQL statement for defining a database structure or pattern. Parsing tools usually read DDL statements and identify keywords, identifiers (such as table names, column names), data types, etc. Thereafter, a syntax tree is constructed to reflect the structure and grammatical rules of the statement. The result of the parsing process is a SQL syntax tree, in which each node represents a part of the SQL statement. Each node of the column definition list may further include column names, data types, constraints, etc. By analyzing the node type of the syntax tree, it is possible to determine which SQL syntax elements the DDL statement uses. For example, if there is an ALTER TABLE node, then it is known that the syntax for modifying the table structure is used, and keywords are reserved words in SQL statements, such as CREATE, ALTER, TABLE, etc. By traversing the syntax tree, all keywords used can be identified and extracted, and lexical information refers to the vocabulary units in the statement, such as identifiers, literals, operators, etc. These information can be extracted by traversing the syntax tree.

[0036] S103: Compare the reference characteristic with the preset database characteristic template to determine the characteristic compatibility corresponding to the reference characteristic.

[0037] In one embodiment of the present application, a preset database feature template is provided, which is obtained by in-depth analysis of various characteristics of the database and detailed database feature compatibility pre-configuration. The pre-configured template is combined with the official website of Oracle database to collect and summarize a set of database feature templates that can accurately reflect the syntax, semantics, keywords, etc. unique to Oracle database.

[0038] Furthermore, if it is confirmed during the parsing process that the target Oracle database contains the feature, it means that the syntax, semantics, keywords, etc. of the target database and the Oracle database feature are compatible. This Oracle pre-set database feature template is highly reusable and should be continuously optimized and enriched based on the practical experience of successful migration to ensure its accuracy and comprehensiveness.

[0039] In one embodiment of the present application, a reference feature is compared with a template feature in a preset database feature template; wherein the preset database feature template includes at least a plurality of template features, and also includes feature compatibilities corresponding to the plurality of template features; the template feature is related to template syntax information, template semantic information, and template keyword information. In the case of consistency in the comparison, the feature compatibility corresponding to the reference feature is determined based on the preset database feature template. wherein the feature compatibility includes at least one of compatible, incompatible, reviewed, and ignored.

[0040] Specifically, the reference feature determined by the syntax tree is compared with the template feature in the preset database feature template, and a detailed analysis of the syntax, semantics, and keyword information of the feature can be performed to ensure the degree of match between them. If the reference feature is consistent with a certain template feature, that is, they are similar enough in syntax, semantics, and keyword information, then the compatibility of the reference feature is determined based on the feature compatibility label corresponding to the template feature. The feature compatibility in the embodiments of the present application includes at least one of compatible, incompatible, reviewed, and ignored.

[0041] S104: Classify the database object information based on the database object type to obtain different types of database objects.

[0042] In one embodiment of the present application, database object information is determined; wherein the database object information includes at least one of the object name, owner, mode, size, and DDL statement. Based on the database object type, the database object information is divided into multiple database objects; wherein the database object type includes at least one of a table, a view, a function, and a stored procedure. Based on the database object type, multiple database objects are divided into common database objects and special database objects. Common attributes are recorded for common database objects, and common attributes and special attributes are recorded for special database objects.

[0043] Specifically, the detailed classification statistics of Oracle database metadata need to be divided according to the database object type, including but not limited to tables, views, functions, stored procedures, etc. Among them, each database object corresponds to multiple reference characteristics. Each database object should record the following attributes in detail: name, owner, architecture, DDL statement, data size and database characteristics. For specific types of database objects, their unique attributes must also be included. For example, table objects should contain relevant constraints and index information; index and constraint objects need to indicate the table to which they belong and the specific type of index / constraint.

[0044] S105: Based on the feature compatibilities respectively corresponding to a plurality of reference features in the database object and the preset feature compatibility priorities, determine the feature compatibility status respectively corresponding to each database object.

[0045] In one embodiment of the present application, multiple reference characteristics corresponding to the current database object are determined, and the characteristic compatibilities corresponding to the multiple reference characteristics are determined. The multiple characteristic compatibilities are compared with the preset characteristic compatibility priorities to determine the highest priority characteristic compatibility corresponding to the current database object. Based on the highest priority compatibility, the characteristic compatibility corresponding to the current database object is determined.

[0046] Specifically, in the embodiment of the present application, the database object contains a feature compatibility priority of: incompatible>review>ignore>compatible.

[0047] Furthermore, the database features included in the database object are counted, and the database feature compatibility and the preset feature compatibility priority are combined to comprehensively judge the compatibility of the database object. Specifically, multiple reference features corresponding to the current database object are determined, and the feature compatibility corresponding to the multiple reference features can be obtained through the preset database feature template. The feature compatibility of the multiple reference features corresponding to the current database object is compared with the preset feature compatibility priority to determine the highest priority feature compatibility corresponding to the current database object, and the highest priority feature compatibility is used as the feature compatibility corresponding to the current database object.

[0048] For example, a database object contains three compatibility characteristics: incompatible, reviewed, and compatible. Then according to the priority weight, the compatibility of the database object is incompatible.

[0049] S106. Construct an Oracle database compatibility rate profile according to the database object information and feature compatibility, so as to determine the compatibility rate of the target Oracle database based on the Oracle database compatibility rate profile.

[0050] In one embodiment of the present application, based on the various data information obtained during the determination of the compatibility of the target Oracle database, an Oracle database compatibility rate portrait is constructed, and the Oracle database compatibility rate portrait is visualized. The various data information includes at least one of data distribution diagram, database characteristics, database system / user dependency, object attributes, and table space usage data.

[0051] Specifically, the embodiment of the present application uses the parsing results and object statistics to generate a visual overview of the Oracle database portrait. The overview will include the following contents:

[0052] Data distribution diagram: Displays database object information, object status, and table space usage details. Quickly understand database object distribution.

[0053] Database features: including database feature compatibility and object compatibility. Discover differences in syntax, semantics, and keywords, and extract and eliminate potential obstacles.

[0054] Database system / user dependencies: include database-dependent Oracle system objects and dependencies between user objects.

[0055] Object detailed properties: Provides information such as name, type, owner, mode, DDL, etc. for each database object.

[0056] Table space usage details: including database table space distribution and usage, index size, materialized view size, large objects, etc. This can help plan the storage resources that need to be allocated.

[0057] In one embodiment of the present application, based on the feature compatibility status corresponding to each database object in the Oracle database compatibility rate portrait, the database object compatibility number is determined, and based on the feature compatibility corresponding to the reference feature in the Oracle database compatibility rate portrait, the feature compatibility number is determined. The total number of database objects and the total number of reference features corresponding to the target Oracle database are obtained. Based on the database object compatibility number, the feature compatibility number, the total number of database objects and the total number of reference features, the compatibility rate of the target Oracle database is obtained.

[0058] Specifically, in the Oracle database compatibility portrait, the total number of target Oracle database objects is determined, and the total number of reference features corresponding to the current target Oracle database is determined. According to the feature compatibility corresponding to each database object, the objects belonging to the compatible state are determined, and the number of database objects belonging to the compatible state is determined, and the reference feature is compared with the preset database feature template, and the feature compatibility corresponding to the reference feature is determined based on the comparison result, and the feature compatibility number is determined. The compatibility rate of the Oracle database is determined based on the acquired data.

[0059] In one embodiment of the present application, the database object compatibility rate is determined based on the ratio between the database object compatibility number and the total number of database objects. The feature compatibility rate is determined based on the ratio between the feature compatibility number and the total number of reference features. The target Oracle database compatibility rate is obtained based on the database object compatibility rate and the feature compatibility rate.

[0060] Specifically, the database object compatibility rate is calculated as follows:

[0061] Database object compatibility rate = number of compatible database objects / total number of database objects × 100%;

[0062] The feature compatibility rate is calculated as follows:

[0063] Feature compatibility rate = number of compatible features / total number of reference features × 100%;

[0064] According to the database object compatibility rate and feature compatibility rate, the target Oracle database compatibility rate is obtained.

[0065] Figure 2 A flowchart of a process for determining the compatibility rate of an Oracle database provided in an embodiment of the present application is as follows: Figure 2 As shown, the DDL statements in the acquired target Oracle database are parsed by the SQL parsing tool to generate the SQL syntax tree corresponding to the target Oracle database, and the syntax tree is parsed to determine the reference characteristics corresponding to each DDL statement, and the reference characteristics are compared with the template characteristics in the preset database characteristic template to determine the characteristic compatibility corresponding to the reference characteristics. The reference characteristics contained in the database object are determined, and the corresponding characteristic compatibility is determined, and the object compatibility corresponding to the current database object is determined by the characteristic compatibility corresponding to the multiple reference characteristics in each database object.

[0066] Figure 3 A schematic diagram of the structure of an Oracle database compatibility rate profile generation device provided in an embodiment of the present application. Figure 3As shown, an Oracle database compatibility rate portrait generation device 200 includes: at least one processor 201; and a memory 202 that is communicatively connected to the at least one processor 201; wherein the memory 202 stores instructions that can be executed by the at least one processor 201, and the instructions are executed by the at least one processor 201 so that the at least one processor 201 can: obtain metadata in a target Oracle database, perform data analysis on the metadata, and obtain database object information; generate an SQL syntax tree based on the database object information, perform node information analysis on the SQL syntax tree, and obtain reference features corresponding to each DDL statement; compare the reference features with preset database feature templates to determine the feature compatibility corresponding to the reference features; classify the database object information based on the database object type to obtain different types of database objects; wherein each database object corresponds to multiple reference features; based on the feature compatibilities corresponding to the multiple reference features in the database object, and the preset feature compatibility priority, determine the feature compatibility corresponding to each database object; construct an Oracle database compatibility rate portrait based on the database object information and the feature compatibility, so as to determine the compatibility rate of the target Oracle database based on the Oracle database compatibility rate portrait.

[0067] A non-volatile computer storage medium provided in an embodiment of the present application stores computer executable instructions, wherein the computer executable instructions are configured to: obtain metadata in a target Oracle database, perform data analysis on the metadata, and obtain database object information; generate an SQL syntax tree based on the database object information, perform node information analysis on the SQL syntax tree, and obtain reference characteristics corresponding to each DDL statement; compare the reference characteristics with a preset database characteristic template to determine the characteristic compatibility corresponding to the reference characteristics; classify the database object information based on the database object type to obtain different types of database objects; wherein each database object corresponds to multiple reference characteristics; determine the characteristic compatibility status corresponding to each database object based on the characteristic compatibilities corresponding to the multiple reference characteristics in the database object and the preset characteristic compatibility priority; construct an Oracle database compatibility rate portrait based on the database object information and the characteristic compatibility status, so as to determine the compatibility rate of the target Oracle database based on the Oracle database compatibility rate portrait.

[0068] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0069] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various changes and variations. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims

1. A method for generating an Oracle database compatibility profile, characterized in that: The method comprises: Obtain metadata in a target Oracle database, perform data parsing on the metadata, and obtain database object information; Generate an SQL syntax tree based on the database object information, parse the SQL syntax tree for node information, and obtain reference characteristics corresponding to each DDL statement; Comparing the reference characteristic with a preset database characteristic template to determine characteristic compatibility corresponding to the reference characteristic; Based on the database object type, the database object information is classified to obtain different types of database objects; wherein each of the database objects corresponds to a plurality of reference characteristics; Based on the feature compatibilities respectively corresponding to the plurality of reference features in the database object and the preset feature compatibility priorities, determining the feature compatibility status respectively corresponding to each of the database objects; According to the compatibility of the database object information and the characteristics, an Oracle database compatibility rate portrait is constructed to determine the compatibility rate of the target Oracle database based on the Oracle database compatibility rate portrait.

2. The method for generating an Oracle database compatibility rate profile according to claim 1, characterized in that: The generating of the SQL syntax tree based on the database object information, parsing the node information of the SQL syntax tree, and obtaining the reference characteristics corresponding to each DDL statement specifically include: Parse the acquired DDL statements in the target Oracle database by using a preset SQL parsing tool to generate an SQL syntax tree corresponding to the target Oracle database; Parsing the SQL syntax tree to obtain syntax information corresponding to the current DDL statement; and Parsing the keyword information and lexical information contained in the current DDL statement from each node information of the SQL syntax tree; The reference characteristics corresponding to each of the DDL statements are determined based on the syntax information, the keyword information and the lexical information.

3. The method for generating an Oracle database compatibility rate profile according to claim 1, characterized in that: The comparing the reference characteristic with the preset database characteristic template to determine the characteristic compatibility corresponding to the reference characteristic specifically includes: Comparing the reference characteristic with the template characteristic in the preset database characteristic template; wherein the preset database characteristic template includes at least a plurality of template characteristics, and also includes characteristic compatibilities respectively corresponding to a plurality of the template characteristics; the template characteristic is related to template syntax information, template semantic information and template keyword information; In case of consistency in the comparison, determining the feature compatibility corresponding to the reference feature based on the preset database feature template; The feature compatibility includes at least one of compatible, incompatible, reviewed and ignored.

4. The method for generating an Oracle database compatibility rate profile according to claim 1, characterized in that: The database object information is classified based on the database object type to obtain different types of database objects, specifically including: Determine the database object information; wherein the database object information includes at least one of the object name, owner, mode, size and DDL statement; Based on the database object type, the database object information is divided into a plurality of database objects; wherein the database object type includes at least one of a table, a view, a function, and a stored procedure; Based on the database object type, the plurality of database objects are divided into common database objects and special database objects; Ordinary attribute records are performed on the ordinary database objects, and ordinary attribute records and special attribute records are performed on the special database objects.

5. The method for generating an Oracle database compatibility rate profile according to claim 1, characterized in that: The determining of the compatibility of the features respectively corresponding to the plurality of reference features in the database object and the preset feature compatibility priority specifically includes: Determine a plurality of reference characteristics corresponding to the current database object, and determine characteristic compatibilities respectively corresponding to the plurality of reference characteristics; Comparing the plurality of feature compatibilities with the preset feature compatibility priorities, and determining the highest priority feature compatibility corresponding to the current database object; Based on the highest priority compatibility, the feature compatibility corresponding to the current database object is determined.

6. The method for generating an Oracle database compatibility rate profile according to claim 1, characterized in that: Determining the compatibility rate of the target Oracle database based on the Oracle database compatibility rate portrait specifically includes: Determining the database object compatibility number based on the feature compatibility status corresponding to each of the database objects in the Oracle database compatibility rate portrait; and Determining a feature compatibility number based on feature compatibility corresponding to a reference feature in the Oracle database compatibility rate portrait; Obtain the total number of database objects and the total number of reference properties corresponding to the target Oracle database; Based on the database object compatibility number, the feature compatibility number, the total number of database objects and the total number of reference features, the compatibility rate of the target Oracle database is obtained.

7. The method for generating an Oracle database compatibility rate profile according to claim 6, characterized in that: The obtaining the compatibility rate of the target Oracle database based on the database object compatibility number, the feature compatibility number, the total number of database objects and the total number of reference features specifically includes: Determining a database object compatibility rate based on a ratio between the number of compatible database objects and the total number of database objects; Determining a characteristic compatibility rate based on a ratio between the characteristic compatibility number and the total number of reference characteristics; The target Oracle database compatibility rate is obtained according to the database object compatibility rate and the feature compatibility rate.

8. The method for generating an Oracle database compatibility rate profile according to claim 1, characterized in that: The constructing an Oracle database compatibility profile according to the compatibility of the database object information with the feature specifically includes: Based on the various data information obtained in the process of determining the compatibility of the target Oracle database, construct an Oracle database compatibility rate portrait, and visualize the Oracle database compatibility rate portrait; The multiple types of data information include at least one of data distribution diagram, database characteristics, database system / user dependency, object attributes, and table space usage data.

9. An Oracle database compatibility rate profile generation device, characterized in that: The device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute the method according to any one of claims 1 to 8.

10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions can execute the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Comparative evaluation and migration method and system for compatibility of domestic database and medium

    CN120892414A