读取 Informix-SE 审计跟踪日志表

发布于 2024-09-07 15:11:14 字数 875 浏览 2 评论 0原文

INFORMIX-SQL 7.32 (SE):

我为我的事务表创建了一个审计跟踪“a_trx”,以了解谁/何时在该表中添加或更新了行,并提供了行内容的快照。根据文档,审计表是使用与被审计表相同的模式创建的,加上预先固定的以下审计信息标题列:

table a_trx

a_type        char(2)    {record type: aa = added, dd =deleted,
                          rr = before update image, ww = after update image.}
a_time        integer    {internal time value.}
a_process_id  smallint   {Process ID that changed record.}
a_usr_id      smallint   {User ID that changed record.}
a_rowid       integer    {Original rowid.}
[...]                    {Same columns as table being audited.}

因此,我继续为 a_trx 生成默认执行屏幕,但无法找到我的 a_trx表选择。我中止并 ls'd .dbs 目录,但没有看到 a_trx.dat 或 a_trx.idx,但找到了 a_trx,根据说法,它似乎是 .dat 格式 我的磁盘编辑器实用程序。是否有任何其他方法来访问此 .dat 克隆,或者我是否必须通过将其重命名为 a_trx.dat 来欺骗引擎,为其创建 .idx 伴侣,调整 SYSTABLES、SYSCOLUMNS 等才能访问此审计表像任何其他表一样?...a_time 的内部时间值是多少,自 1899 年 12 月 31 日以来的秒数?

INFORMIX-SQL 7.32 (SE):

I've created an audit trail "a_trx" for my transaction table to know who/when has added or updated rows in this table, with a snapshot of the rows contents. According to documentation, an audit table is created with the same schema of the table being audited, plus the following audit info header columns pre-fixed:

table a_trx

a_type        char(2)    {record type: aa = added, dd =deleted,
                          rr = before update image, ww = after update image.}
a_time        integer    {internal time value.}
a_process_id  smallint   {Process ID that changed record.}
a_usr_id      smallint   {User ID that changed record.}
a_rowid       integer    {Original rowid.}
[...]                    {Same columns as table being audited.}

So then I proceeded to generate a default perform screen for a_trx, but could not locate a_trx for my table selection. I aborted and ls'd the .dbs directory and did not see a_trx.dat or a_trx.idx, but found a_trx, which appears to be in .dat format, according to
my disk editor utility. Is there any other method for accessing this .dat clone or do I have to trick the engine by renaming it to a_trx.dat, create an .idx companion for it, tweak SYSTABLES, SYSCOLUMNS, etc. to be able to access this audit table like any other table?.. and what is the internal time value of a_time, number of seconds since 12/31/1899?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吝吻 2024-09-14 15:11:14

审计日志不是 C-ISAM 文件;它们是普通的日志文件。 IIRC,它们以“.aud”作为后缀创建。如果您要选择后缀,那么您将使用“.dat”后缀创建它,确保该名称不会与任何表名称冲突。

您应该能够像访问表一样访问它们,但是您必须创建一个表(数据文件)和索引文件以匹配增强模式,然后安排“.aud”文件来引用与“.dat”文件相同的位置 - 可能通过链接或可能是符号链接。您可以在 SE 中的 CREATE TABLE 语句中指定表的存储位置。

该时间是 Unix 时间戳 - 自 1970-01-01T00:00:00Z 以来的秒数。

The audit logs are not C-ISAM files; they are plain log files. IIRC, they are created with '.aud' as a suffix. If you get to choose the suffix, then you would create it with a '.dat' suffix, making sure the name does not conflict with any table name.

You should be able to access them as if they were a table, but you would have to create a table (data file) and the index file to match the augmented schema, and then arrange for the '.aud' file to refer to the same location as the '.dat' file - presumably via a link or possibly a symbolic link. You can specify where the table is stored in the CREATE TABLE statement in SE.

The time is a Unix time stamp - the number of seconds since 1970-01-01T00:00:00Z.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文