Home » RDBMS Server » Security » can not populate audit log table
can not populate audit log table [message #46737] Mon, 28 June 2004 01:33 Go to next message
arijit
Messages: 4
Registered: June 2004
Junior Member
I want to write a procedure that will populate a audit table having the following table structure.

CREATE TABLE AUDIT_LOG

(

START_TIME DATE,

END_TIME DATE,

DETAILS VARCHAR2(150 BYTE),

NO_OF_RECORDS NUMBER,

USER_NAME VARCHAR2(20 BYTE),

STATUS CHAR(10 BYTE),

SESSION_ID NUMBER

)

the input parameter are supplying the following data

START_TIME,DETAILS,NO_OF_RECORDS,STATUS

but the USER_NAME,SESSION_ID will be taken from current schema  and END_TIME will be taken from current system time.

the spec of the procedure is like

CREATE OR REPLACE PACKAGE Error_PKG

AS

PROCEDURE WRITE_TO_AUDIT_LOG (

Start_Time_in IN TIMESTAMP,

Details_in IN VARCHAR2,

records_returned_in IN NUMBER,

Status_in IN VARCHAR2,

returned_code_out OUT NUMBER

);

END COMMON_PKG;

please some one help me to write the procedure
Re: can not populate audit log table [message #46787 is a reply to message #46737] Thu, 01 July 2004 04:34 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
hi arijit,
you can get the values as the following.

SELECT user,sysdate FROM dual;

SELECT sid FROM v$session WHERE audsid = userenv('SESSOINID');

you can insert these values along with the parameters.

by
vamsi
Previous Topic: which role do I need this to get over the problem?
Next Topic: automatic password expiration ?
Goto Forum:
  


Current Time: Tue Mar 19 00:09:53 CDT 2024