Sunday, June 30, 1996

db_prof.sql: report database triggers

Author: Robert Lawson
Environment: Oracle database, HPUX
Description: Report database triggers from JIT ERP system.
Code Listing:

/*
program: db_prof.sql
purpose: profile of database
date : 06-30-96 (a blue moon today)
author : robert lawson
changes:

*/
set wrap off
set linesize 300
set pagesize 50000
set longc 10000
set echo on
set termout on
-- set pause on

/*
-- Triggers
- all_triggers: TRIGGER_BODY, TRIGGER_TYPE, TRIGGERING_EVENT, WHEN_CLAUSE
- all_trigger_cols:
*/
SELECT
-- substr(ao.owner,1,12) owner,
substr(ao.object_name,1,30) trigger_name,
ao.created,
ao.status,
substr(ag.table_name,1,20) table_name
FROM all_triggers ag, all_objects ao
WHERE
ao.object_type = 'TRIGGER' and
ao.owner <> 'SYS' and
ag.trigger_name = ao.object_name
ORDER BY 1;

/*
- Procedures, not in packages (odd balls)

*/
SELECT
substr(ao.owner,1,12) owner,
substr(ao.object_name,1,30) name,
ao.created,
ao.status
FROM all_objects ao
WHERE
ao.object_type = 'PROCEDURE'
-- ao.owner <> 'SYS'
ORDER BY 1, 2;

No comments: