Talk about how to do SQL audit for Oracle database: 1. How do you do a pre-grammar check?
首先要熟悉繁杂的oracle语法规范,并能提前报错(这不是问题)
2. DDL statement column check, index check these are direct execution will be found, do you want to export the structure of the table, operation check it again
(plausible) then prepare an Oracle database that stores other library table structures
How do 3.DML statements check for data conflicts?
可以使用不提交事物的方式检查,但如果碰到大量数据的操作呢?会造成锁的
4. How do I record a rollback statement?
能否解析日志呢,日志先写入redo,logminer 会降低oracle性能 可不去回滚DDL 语句,和insert ,delete 语句, 主要预防update 语句,那么提前把update前 语句的数据select 备份起来,而不直接生成回滚update.
5. What does this workflow look like?
a. 目标库的元数据备份到审核库b. 外部传参给 审核程序,参数包括(ip,port,username,password,sql, backip,backport, backuser,backpass)c. 审核程序先在审核库预执行,看看是否有语法错误,对于DDL 语句就直接更新了,对于insert 语句就直接执行了,d. 对于delete语句检查句法,因此,delete 之前要先备份 导入到审核库,无法检查数据是否存在,e. 对于update语句,先要导入到备份库,只能检查语法,因为对于多表依赖的update 无法导出多表。
After the inspection, the representative passed, on the operation of the online library
Talk about how to do SQL audit for Oracle