跟踪重要表上的DML [英] tracking DML on important tables

查看:52
本文介绍了跟踪重要表上的DML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想跟踪重要的

表格中发生的DML更改。

我可以创建跟踪这些的触发器,但我怎样才能获得IP地址

和执行的SQl语句。


有没有办法可以捕获DML更改的内容通过哪个
ip地址以及为此运行的SQL是什么以及受该DML影响的行数是多少。


我将要求所有这些信息:IP地址,没有受影响的行,

SQL(如果可能的话)。


非常感谢


Rahul

Hi,

I want to track the DML changes that are occurring on important
tables.
I can create a trigger to track these but how can i get the Ip address
and SQl statement executed.

Is there a way that i can capture what DML changes were made by which
ip address and what were the SQL run for that and how many rows were
affected by that DML.

I will require all these information: ip address, no of affected rows,
SQL(if possible).

Thanks a lot

Rahul

推荐答案

Rahul B写道:
Rahul B wrote:




我想跟踪重要的

表格中发生的DML变化。

我可以创建跟踪这些的触发器,但我怎样才能获得IP地址

和执行的SQl语句。


有没有办法我可以确定DML所做的改变是什么?b
ip地址以及为此运行的SQL是什么以及受DML影响的行数是多少?


我将需要所有这些信息:ip地址,没有受影响的行,

SQL(如果可能的话)。
Hi,

I want to track the DML changes that are occurring on important
tables.
I can create a trigger to track these but how can i get the Ip address
and SQl statement executed.

Is there a way that i can capture what DML changes were made by which
ip address and what were the SQL run for that and how many rows were
affected by that DML.

I will require all these information: ip address, no of affected rows,
SQL(if possible).



应用程序ID包含IP地址AFAIK。没有受影响的行是

触发器中NEW / OLD TABLE的COUNT。

据我所知,没有直接的方法来检索SQL

导致触发器执行的声明。


有3个派对产品嗅探DRDA流程以进行审核

目的。 DB2 Viper 2有一个策略驱动的审计工具。


我很惊讶你想知道SQL语句。通常更改

自己被记录....


干杯

Serge

-

Serge Rielau

DB2解决方案开发

IBM多伦多实验室

The application ID contains the IP address AFAIK. No of affected rows is
the COUNT of the NEW/OLD TABLE in the trigger.
To the best of my knowledge there is no direct means to retrieve the SQL
statement that caused a trigger to execute.

There are 3. party products that sniff the DRDA flow for auditing
purposes. And DB2 Viper 2 has a policy driven auditing facility.

I''m surprised you want to know the SQL Statement. Typically the changes
themselves are logged....

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab


8月28日,4:08 pm,Serge Rielau< srie ... @ ca.ibm.comwrote:
On Aug 28, 4:08 pm, Serge Rielau <srie...@ca.ibm.comwrote:

Rahul B写道:
Rahul B wrote:


Hi,


我想跟踪重要的

表上发生的DML更改。

我可以创建一个触发器来跟踪这些但是我如何获得IP地址

和SQl语句执行。
I want to track the DML changes that are occurring on important
tables.
I can create a trigger to track these but how can i get the Ip address
and SQl statement executed.


有没有办法可以捕获哪些DML更改由哪个
ip地址和什么是SQL为此奔跑,受DML影响的行数是多少?
Is there a way that i can capture what DML changes were made by which
ip address and what were the SQL run for that and how many rows were
affected by that DML.


我将需要所有这些信息:ip地址,没有受影响的行,

SQL(如果可能的话)。
I will require all these information: ip address, no of affected rows,
SQL(if possible).



应用程序ID包含IP地址AFAIK。没有受影响的行是

触发器中NEW / OLD TABLE的COUNT。

据我所知,没有直接的方法来检索SQL

导致触发器执行的声明。


有3个派对产品嗅探DRDA流程以进行审核

目的。 DB2 Viper 2有一个策略驱动的审计工具。


我很惊讶你想知道SQL语句。通常更改

自己被记录....


干杯

Serge

-

Serge Rielau

DB2解决方案开发

IBM多伦多实验室


The application ID contains the IP address AFAIK. No of affected rows is
the COUNT of the NEW/OLD TABLE in the trigger.
To the best of my knowledge there is no direct means to retrieve the SQL
statement that caused a trigger to execute.

There are 3. party products that sniff the DRDA flow for auditing
purposes. And DB2 Viper 2 has a policy driven auditing facility.

I''m surprised you want to know the SQL Statement. Typically the changes
themselves are logged....

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab



Serge,

我无法得到你的意思,chenges本身是

记录的

请原谅我的无知,究竟是哪里存储的SQL语句。


Rahul

Serge,
I couldn''t get what exactly you mean by "chenges themselves are
logged".
Pardon my ignorance, Where exactly are the SQL statements stored.

Rahul


8月28日下午4:08,Serge Rielau< srie ... @ ca.ibm.comwrote:
On Aug 28, 4:08 pm, Serge Rielau <srie...@ca.ibm.comwrote:

Rahul B写道:
Rahul B wrote:


Hi,


我想跟踪重要的

表格中发生的DML变化。

I可以创建一个触发器来跟踪这些但是如何获得IP地址

和SQl语句执行。
I want to track the DML changes that are occurring on important
tables.
I can create a trigger to track these but how can i get the Ip address
and SQl statement executed.


有没有办法可以捕获哪些DML更改由哪个
ip地址和什么是SQL为此奔跑,受DML影响的行数是多少?
Is there a way that i can capture what DML changes were made by which
ip address and what were the SQL run for that and how many rows were
affected by that DML.


我将需要所有这些信息:ip地址,没有受影响的行,

SQL(如果可能的话)。
I will require all these information: ip address, no of affected rows,
SQL(if possible).



应用程序ID包含IP地址AFAIK。没有受影响的行是

触发器中NEW / OLD TABLE的COUNT。

据我所知,没有直接的方法来检索SQL

导致触发器执行的声明。


有3个派对产品嗅探DRDA流程以进行审核

目的。 DB2 Viper 2有一个策略驱动的审计工具。


我很惊讶你想知道SQL语句。通常更改

自己被记录....


干杯

Serge

-

Serge Rielau

DB2解决方案开发

IBM多伦多实验室


The application ID contains the IP address AFAIK. No of affected rows is
the COUNT of the NEW/OLD TABLE in the trigger.
To the best of my knowledge there is no direct means to retrieve the SQL
statement that caused a trigger to execute.

There are 3. party products that sniff the DRDA flow for auditing
purposes. And DB2 Viper 2 has a policy driven auditing facility.

I''m surprised you want to know the SQL Statement. Typically the changes
themselves are logged....

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab



Serge,


如果我写了一个触发器,在触发器中如何获取应用程序ID

这使得表中的DML更改导致触发器

调用。

在Oracle中,有一个函数sys_context()返回ip

地址。

我是想知道DB2中是否有相同的东西。


无论如何,在触发器中,我如何获得应用程序ID

制作DML表中的变化导致触发器调用?


Rahul

Serge,

If i write a trigger, in the trigger how do i get the application id
which is making DML changes in the table leading to the trigger
invocation.
In Oracle, there is a function sys_context() which returns the ip
address.
I was wondering if there''s the same in DB2.

In any case, in the trigger, how do i get the application id which is
making DML changes in the table leading to the trigger invocation?

Rahul


这篇关于跟踪重要表上的DML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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