石小疯 发表于 2025-1-10 09:38:03

【YashanDB知识库】审计表UNIFIED_AUDIT_TRAIL出现YAS-00220 utf8 sequence

【题目分类】功能利用
【关键字】UNIFIED_AUDIT_TRAIL,YAS-00220
【题目描述】当审计对象的SQL语句包含非标准中文字符时,出现YAS-00220 utf8 sequence is wrong,影响审计记录。
--第一步:打开审计开关

SQL> ALTER SYSTEM SET UNIFIED_AUDITING = true;



Succeed.



--创建审计策略

CREATE AUDIT POLICY up2

ACTIONS DROP TABLE,DELETE ON sales.area,INSERT ON sales.area,UPDATE ON sales.area,ALL ON sales.sales_info;



AUDIT POLICY up2;



--第二步:执行操作被正常记录

SQL> conn sales/sales



Connected to:

YashanDB Server Enterprise Edition Release 23.2.7.100 x86_64 - Linux



SQL> UPDATE area SET DHQ='guangzhou' WHERE area_no='01';



1 row affected.



SQL> commit;



Succeed.



SQL> SELECT dbusername,event_timestamp,sql_text,object_schema

FROM UNIFIED_AUDIT_TRAIL

WHERE dbusername='SALES'; 2 3



DBUSERNAME EVENT_TIMESTAMP SQL_TEXT OBJECT_SCHEMA

---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ----------------------------------------------------------------

SALES 2024-12-11 09:52:27.602837 UPDATE area SET DHQ='guangzhou' WHERE area_no='01' SALES



1 row fetched.



--第三步:其中 '广.' 为非正常中文字段,查看审计表出现报错

SQL> UPDATE area SET DHQ='广.' WHERE area_no='01';



1 row affected.



SQL> commit;



Succeed.



SQL> SELECT dbusername,event_timestamp,sql_text,object_schema

FROM UNIFIED_AUDIT_TRAIL

WHERE dbusername='SALES'; 2 3



DBUSERNAME EVENT_TIMESTAMP SQL_TEXT OBJECT_SCHEMA

---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ----------------------------------------------------------------

SALES 2024-12-11 09:52:27.602837 UPDATE area SET DHQ='guangzhou' WHERE area_no='01' SALES



YAS-00220 utf8 sequence is wrong



--第四步:执行操作无法被正常记录

SQL> UPDATE area SET DHQ='guangzhou' WHERE area_no='01';



1 row affected.



SQL> commit;



Succeed.



SQL> SELECT dbusername,event_timestamp,sql_text,object_schema FROM UNIFIED_AUDIT_TRAIL WHERE dbusername='SALES';



DBUSERNAME EVENT_TIMESTAMP SQL_TEXT OBJECT_SCHEMA

---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ----------------------------------------------------------------

SALES 2024-12-11 09:52:27.602837 UPDATE area SET DHQ='guangzhou' WHERE area_no='01' SALES



YAS-00220 utf8 sequence is wrong【题目缘故原由分析】数据库BUG
【办理/规避方法】制止包含非正常中文字符,重新整理审计表。
BEGIN

DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL (

      DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,

      true);

END;

/【影响范围】23.2.9.xxx前的所有版本
【修复版本】-

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 【YashanDB知识库】审计表UNIFIED_AUDIT_TRAIL出现YAS-00220 utf8 sequence