Determining criticality of a SQL statement
First Claim
1. A method, in a data processing system comprising a processor and a memory coupled to the processor, for determining criticality of a Structured Query Language (SQL) statement, comprising:
- extracting, by an extracting apparatus in a criticality determining device executed by the processor, a plurality of elements in the SQL statement;
calculating, by a calculating apparatus in the criticality determining device executed by the processor, a score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements, wherein calculating the score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements includes;
determining, by the calculating apparatus in the criticality determining device executed by the processor, the score of the SQL statement as a first value in response to that the correlation relation does not exist between any two of the plurality of elements, the first value being a maximum one of the respective base scores of the plurality of elements; and
determining, by the calculating apparatus in the criticality determining device executed by the processor, the score of the SQL statement as a second value in response to that the correlation relation exists between at least two of the plurality of elements, the second value being greater than the maximum one of the respective base scores of the plurality of elements; and
determining, by a determining apparatus in the criticality determining device executed by the processor, the criticality of the SQL statement based on the score of the SQL statement.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention discloses a mechanism for determining criticality of a SQL statement. A plurality of elements in the SQL statement is extracted. A score of the SQL statement is calculated based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements. The criticality of the SQL statement is determined based on the score of the SQL statement. In this way, a database administrator only needs to define a small number of rules according his own needs. In the meantime, the mechanism automatically analyzes a received simple or complex SQL statement according to the small number of rules defined by the user to determine its criticality, without missing any critical SQL statement, and thereby protect security of data in the database.
16 Citations
18 Claims
-
1. A method, in a data processing system comprising a processor and a memory coupled to the processor, for determining criticality of a Structured Query Language (SQL) statement, comprising:
-
extracting, by an extracting apparatus in a criticality determining device executed by the processor, a plurality of elements in the SQL statement; calculating, by a calculating apparatus in the criticality determining device executed by the processor, a score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements, wherein calculating the score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements includes; determining, by the calculating apparatus in the criticality determining device executed by the processor, the score of the SQL statement as a first value in response to that the correlation relation does not exist between any two of the plurality of elements, the first value being a maximum one of the respective base scores of the plurality of elements; and determining, by the calculating apparatus in the criticality determining device executed by the processor, the score of the SQL statement as a second value in response to that the correlation relation exists between at least two of the plurality of elements, the second value being greater than the maximum one of the respective base scores of the plurality of elements; and determining, by a determining apparatus in the criticality determining device executed by the processor, the criticality of the SQL statement based on the score of the SQL statement. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A device for determining criticality of a Structured Query Language (SQL) statement, comprising:
-
a processor; and a memory coupled to the processor, wherein the memory comprises instructions which, when executed by the processor, cause the processor to; extract a plurality of elements in the SQL statement; calculate a score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements, wherein the instructions to calculate the score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements further causes the processor to; determine the score of the SQL statement as a first value in response to that the correlation relation does not exist between any two of the plurality of elements, the first value being a maximum one of the respective base scores of the plurality of elements; and determine the score of the SQL statement as a second value in response to that the correlation relation exists between at least two of the plurality of elements, the second value being greater than the maximum one of the respective base scores of the plurality of elements; and determine the criticality of the SQL statement based on the score of the SQL statement. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. A computer program product comprising a non-transitory computer readable storage medium having a computer readable program stored therein, wherein the computer readable program, when executed on a computing device, causes the computing device to:
-
extract a plurality of elements in a Structured Query Language (SQL) statement; calculate a score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements, wherein the computer readable program to calculate the score of the SQL statement based on a correlation relation among respective elements in the plurality of elements and base scores of the respective elements further causes the computing device to; determine the score of the SQL statement as a first value in response to that the correlation relation does not exist between any two of the plurality of elements, the first value being a maximum one of the respective base scores of the plurality of elements; and determine the score of the SQL statement as a second value in response to that the correlation relation exists between at least two of the plurality of elements, the second value being greater than the maximum one of the respective base scores of the plurality of elements; and determine the criticality of the SQL statement based on the score of the SQL statement. - View Dependent Claims (18)
-
Specification