Oracle Why the same query doesnt show the same trigger name in different schema?

2012-11-30  Source: Original Site  Category:Oracle  Views:0 

Advertisement

We have created emp table - both in SCOTT and as well as in TRAINEE3 schema. The structure of emp table in both schema is same. Now, we have created same trigger(CHNG_DEPT12) with same name in both the schema on emp table. Now, when we are viewing all_triggers in TRAINEE3 schema - then it is showing all the triggers from both SCOTT and TRAINEE3 schema. But, when we are executing the same query from SCOTT schema it is showing only the triggers belongs to SCOTT schema. And the query is like that -

--Under SCOTT schema SQL> select owner,trigger_name,table_owner 2 from all_triggers 3 where table_name = 'EMP'; OWNER TRIGGER_NAME TABLE_OWNER ------------------------------ ------------------------------ ------------------------------ TRAINEE3 CHNG_DEPT11 SCOTT SCOTT TEST_EMP SCOTT SCOTT PRINT_SALARY_CHANGES SCOTT SCOTT CHNG_DEPT SCOTT SCOTT CHNG_DEPT12 SCOTT SQL> sho user; USER is "SCOTT" --TRAINEE3 schema SQL> SQL> sho user; USER is "TRAINEE3" SQL> SQL> SQL> select owner,trigger_name,table_owner 2 from all_triggers 3 where table_name = 'EMP'; OWNER TRIGGER_NAME TABLE_OWNER ------------------------------ ------------------------------ ------------------------------ TRAINEE3 CHNG_DEPT11 SCOTT SCOTT TEST_EMP SCOTT SCOTT PRINT_SALARY_CHANGES SCOTT SCOTT CHNG_DEPT SCOTT TRAINEE3 CHNG_DEPT12 TRAINEE3 SCOTT CHNG_DEPT12 SCOTT TRAINEE3 CHNG_DEPT TRAINEE3 7 rows selected.

Now, Why the same query doesnt show the same trigger name in different schema?

Related articles