Home » SQL & PL/SQL » SQL & PL/SQL » how to find out that how many times trigger fired today (Oracle 10g relaease 2 on Linux)
how to find out that how many times trigger fired today [message #301934] Fri, 22 February 2008 06:22 Go to next message
MIFI
Messages: 256
Registered: February 2008
Location: U.K.
Senior Member
Could you please me in finding out that how many times triggers have been fired.

Actually we are replicating our table on hourly basis from sql server 2000 to Oracle 10g.(Performing Transactional replication)

After replication, trigger on table will be activated which will insert the row in other table.

We want to check that replication is working fine or not in oracle side as sql server is pushing records to us and i am not authorize to access that sql server
Re: how to find out that how many times trigger fired today [message #301937 is a reply to message #301934] Fri, 22 February 2008 07:02 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Count the number of rows you inserted.
Or modify the trigger in order to make it insert a row containing the current date in a log table each time it inserts a row inside the other table.

Regards
Michel
Re: how to find out that how many times trigger fired today [message #301940 is a reply to message #301934] Fri, 22 February 2008 07:06 Go to previous messageGo to next message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
Are you talking about an Oracle trigger?
How is that trigger created?
Re: how to find out that how many times trigger fired today [message #301969 is a reply to message #301940] Fri, 22 February 2008 09:22 Go to previous messageGo to next message
MIFI
Messages: 256
Registered: February 2008
Location: U.K.
Senior Member
Triggers on table are created mainly in three event Insert, Update and delete
and It can be before,after the above events.
Trigger can be row level or it can be statement level trigger

Example of one simple trigger is

create or replace trigger <trigger name>
after insert on <tablename>
for each row
declare
declare variable here
begin
statements
end;
Re: how to find out that how many times trigger fired today [message #301970 is a reply to message #301937] Fri, 22 February 2008 09:23 Go to previous messageGo to next message
MIFI
Messages: 256
Registered: February 2008
Location: U.K.
Senior Member
But if create audit table it will occupy resources, do you know any query by which we can find out that data has been inserted through trigger
Re: how to find out that how many times trigger fired today [message #301974 is a reply to message #301970] Fri, 22 February 2008 09:59 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
If you cannot recognize a record as being inserted by the trigger, then there is no way of knowing that without explicitly keeping track somehow.
Previous Topic: Eliminate Duplicate subqueries in MERGE INTO
Next Topic: last 3 charecters
Goto Forum:
  


Current Time: Sat Feb 15 20:29:16 CST 2025