如何编写DB2 DDL& DML审核日志作为系统应用程序日志? [英] How to write DB2 DDL & DML audit logs as System Application Logs?

查看:169
本文介绍了如何编写DB2 DDL& DML审核日志作为系统应用程序日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows机器中使用DB2 LUW。我想获取DDL&的日志数据库中使用的DML查询。

I am using DB2 LUW in a windows machine. I want to get the logs for DDL & DML queries used in the database.

默认日志(例如S000001.LOG)包含空且格式不可读。因此,我启用了审核并将存档的审核日志提取到.del文件中。

The default logs(for example S000001.LOG) contains 'null' and not in a readable format. So I enabled auditing and extracted the archived audit logs into .del files.

但是审计日志提取会创建如下的.del:

But the audit log extraction creates .del like this:

2019-09-05-01.19.44.443001,执行,声明,13,0, TEST2,管理员,管理员 , ADMINISTRATOR, * LOCAL.DB2.190904193137, db2bp.exe,,, ADMINISTRATOR, SQLC2O29,203,,,,10、1, 0,0, WRITE_DML, auditlobs.0.42 /, CS, auditlobs.42.808 /,1,0 ,,,,, 2019-09-05-01.19.44.178765 ,, DB2 , DESKTOP-R9O62O0

在记事本++中打开文件时,空白空间类似于NULNULNUL

插入db2admin.testtable值(223)GEN_CMPL(DD( ¸0¸8¸@¸H¸P

此文件包含以下字符STX NUL EOX US ...等

就我而言,我应该得到以任何可读格式(如db2diag.log文件)记录日志,或者我必须以标准格式将日志转发到syslog服务器。

In my case either I should get the logs in any readable format(Like db2diag.log file) or I have to forward the logs to a syslog server in a standard format.

什么是最佳方法

是否有可能将审核日志写为系统应用程序事件,例如MSSQL DDL / DML审核?这样我就可以轻松转发这些日志。

Is there any possibility to write the audit logs as System Application Events Like MSSQL DDL/DML Auditing? so that I could easily forward those logs.

auditlobs.file和execute.del-> https: //imgur.com/a/9LydhYK

auditlobs.file and execute.del -> https://imgur.com/a/9LydhYK

在此先感谢..!

推荐答案

这些CSV文件可能是导入已加载到Db2表中以进行进一步的分析/处理。

您可以使用具有能力的任何其他工具处理CSV文件并将其内容记录到任何系统。

These CSV files may be imported or loaded into Db2 tables for further analysis / processing.
You may use any other tools with an ability to process CSV files and log their contents to whatever system.

这篇关于如何编写DB2 DDL& DML审核日志作为系统应用程序日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆