I have an Oracle Database and I want to monitor a particular table/column in the DB . If the column value crosses threshold value I want to call my java application code to perform some operation LIKE EXAMPLE SCALE UP OR SHUTDOWN. How can I achieve this? Any pointers or help needed.
问问题
143 次
4 回答
1
Set Serverout On
Declare
comm Varchar2(2000);
Begin
comm := OSCommand_Run('/home/jguy/runJavaApp.sh')--for calling commands
DBMS_OUTPUT.Put_Line(comm);
End;
于 2013-10-07T12:25:03.940 回答
1
您可以使用将在某些条件下执行特定函数/存储过程的触发器(在本例中为更新触发器)。
于 2013-10-07T12:25:29.623 回答
1
I suggest you to use triggers, they are designed to do stuff like this and I really wouldn't mess up it with Java in this case.
于 2013-10-07T12:22:17.843 回答
1
有多种方法可以做到这一点:
在表上触发,它将检查每个 DML 语句的列值以及值是否超过阈值。
由于触发器可能对表有一些性能影响,您可以创建一个调用存储过程的调度程序作业,该存储过程将定期(每分钟或您喜欢的任何内容)调用,然后检查列值并在超过阈值时调用 java 应用程序。
我更喜欢触发器,但检查对表的性能影响。
于 2013-10-07T15:24:53.843 回答