--  FILE:   trace_logon.sql
--
--  AUTHOR: Andy Rivenes, arivenes@appsdba.com, www.appsdba.com
--          Copyright (C) 2003-2004 AppsDBA Consulting
--
--  DATE:   05/07/2003
--
--  DESCRIPTION:
--          Enable event 10046 tracing at logon by creating a
--          logon trigger.
--
--
--  REQUIREMENTS:
--          Requires the ALTER SESSION and CREATE TRIGGER privileges.
--
--  MODIFICATIONS:
--
--
-- 
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
-- 
--
SET LINESIZE 132;
SET PAGESIZE 60;
SET TRIMSPOOL off;
--
CREATE OR REPLACE TRIGGER LoginTrigger AFTER LOGON ON SCHEMA
BEGIN
   execute immediate 'alter session set timed_statistics=true';
   execute immediate 'alter session set max_dump_file_size=unlimited';
   execute immediate 'alter session set events ''10046 trace name context forever, level 8'' ';
END; 
/

