zoukankan      html  css  js  c++  java
  • Oracle 11g 记录DML错误数据

    [From] https://oracle-base.com/articles/10g/dml-error-logging-10gr2

    需要记录下大量DML操作中出错的具体record,看到有两种方案,一种是使用批量DML操作bulk collect并带上save exceptions子句,然后做处理。稍微繁琐,不想使用。于是用另一种方案,就是在DML语句后面跟上LOG ERRORS。

    LOG ERRORS [INTO [schema.]table] [('simple_expression')] [REJECT LIMIT integer|UNLIMITED]
    
    
    
    The optional INTO clause allows you to specify the name of the error logging table. If you omit this clause, the the first 25 characters of the base table name are used along with the "ERR$_" prefix.
    
    The simple_expression is used to specify a tag that makes the errors easier to identify. This might be a string or any function whose result is converted to a string.
    
    The REJECT LIMIT is used to specify the maximum number of errors before the statement fails. The default value is 0 and the maximum values is the keyword UNLIMITED. For parallel DML operations, the reject limit is applied to each parallel server.
    

    其中,这个错误记录表需要先创建,可以使用包 exec DBMS_ERRLOG.CREATE_ERROR_LOG('target_table'); 来创建。第一个参数就是需要被记录DML操作的目标表。如果不附加参数,则默认会创建表名为ERR&_target_table的表。之后就可以使用LOG ERRORS了,使用默认表名时,log errors 后面可以不需要into。

  • 相关阅读:
    判断有无网络
    Listview的OnScrollListener的滑动监听实现分页加载
    第三方 XListview 上拉加载、下拉刷新、分页加载和Gson解析
    Gson解析数据
    百度地图实现普通地图、定位、周边搜索功能
    Viewpager实现网络图片的轮播
    英语wacche腕表
    caement Archaic spelling of cement
    水泥caement单词
    英语caement水泥
  • 原文地址:https://www.cnblogs.com/pekkle/p/7149172.html
Copyright © 2011-2022 走看看