Select from triggers

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
Post Reply
gsmdf
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Fri, 18 Dec 2009 5:07 pm
Location: Brasília-DF

Personal,

I am doubtful how to perform these 2 selects:

1) Owner trigger audit without any option marked: Before Insert / Delete / Update.

2) Owner trigger deactivated or invalid audit.

grateful.
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

 
select *  
from all_objects  
where owner = 'SYS'  
and status = 'VALID'  
and object_type = 'TRIGGER' 
gsmdf
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Fri, 18 Dec 2009 5:07 pm
Location: Brasília-DF

Select all

 
select * 
from all_objects 
where owner = 'SYS' 
and status = 'VALID' 
and object_type = 'TRIGGER'  
But would this not return valid triggers?
Why is the Owner's 'SYS'?

How would the command be to return the invalid or disabled?

And the triggers with some unchecked option (Before Update, Insert, Delete)?

grateful.
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

face ..
I just gave you the way .. who has to tread and you ...

Select all

owner = 'AUDITORIA' --não sei a qual usuario pertencem as triggers de auditoria 
 
status <> 'VALID' -- era so trocar de igual apra diferente
gsmdf
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Fri, 18 Dec 2009 5:07 pm
Location: Brasília-DF

VLW, I just do not know how to return the triggers disabled ... What status only has Valid and Invalid or rolls a deactivated?
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

 
select * from all_triggers where status <> 'ENABLED' 
is actually disable
gsmdf
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Fri, 18 Dec 2009 5:07 pm
Location: Brasília-DF

I have discovered:

Select all

select from dba_triggers
Ali has enabled or disabled status.

vlw
gsmdf
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Fri, 18 Dec 2009 5:07 pm
Location: Brasília-DF

2) It was right:

Select all

 
select TRIGGER_NAME,STATUS 
from dba_triggers 
where owner = 'TCU' 
and status = 'DISABLED' 
union all 
    select OBJECT_NAME,STATUS  
    from all_objects 
    where owner ='TCU' 
    and status ='INVALID' 
    and object_type = 'TRIGGER' 
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest