Collect data for machine and module before DB Vault


set serveroutput on
create table collect_table as select distinct username ,program ,module ,machine ,osuser from v$session;

CREATE OR REPLACE procedure SYS.collect_data is
 begin
 insert into collect_table select distinct username ,program ,module ,machine ,osuser from v$session;
 commit;
 end;
 /

create table logon_logs
 ( v_sysdate date,
 v_program VARCHAR2 (128),
 v_module VARCHAR2 (128),
 v_username VARCHAR2 (128),
 v_machine VARCHAR2 (128),
 v_osuser VARCHAR2 (128)
 );
 DECLARE
 X NUMBER;
 BEGIN
 SYS.DBMS_JOB.SUBMIT
 ( job => X
 ,what => 'collect_data;'
 ,next_date => to_date('24.10.2013 17:58:23','dd/mm/yyyy hh24:mi:ss')
 ,interval => 'SYSDATE+15/1440 '
 ,no_parse => FALSE
 );
 SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
 COMMIT;
 END;
 /
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: