The invention discloses a dynamic modification and original definition
backtracking method and
system for a
database view. The method comprises the following steps: receiving a CREATE OR REPLACE VIEW command containing field addition and deletion and sequence or type change, and analyzing to generate a target column attribute
list; an old column attribute
list is obtained, after comparison, a deleted column is marked as a deleted column, a newly added column is added, and sequence / type column attributes are adjusted; and updating the total column number
metadata of the view, traversing the dependency table to set the dependency object to be invalid, and triggering the first access to automatically recompile. Meanwhile, a complete original text containing an
annotation format is captured through an analysis state
machine, an original text-normalized text dual storage mechanism (two columns of a
system metadata table are stored respectively) is adopted, the original text is returned when a user requests, and the normalized text is adopted when internal recompiling is carried out. According to the method, flexible lossless modification of the view, stable attribute, dependence on automatic management and accurate
backtracking of original definition are realized, the operation and maintenance cost is reduced, and the
system reliability is improved.