Issue Audit Table

Has anyone built an audit table, or something similar, for the Issue Tracking system example database?
If so, would you provide how you went about the process?
If not, then could someone point me in the right direction to figure out how to accomplish this task?
Thanks in advance.

Hi All,
I am waiting for reply. I am not sure why Audit tables are not updating when salary record is created through API as Audit Table is updated when Salary record is created or deleted from the applciation.
Any thoughts on this????

Similar Messages

  • How to maintain previous and record count in audit table in SQL Server 2008 r2?

    Hi Experts ,
     Situation :
    in our database we are having few of stored procedures which will drop and recreates the tables and it is scheduled on weekly basis. when this job will run all the stored procedures will drop all the tables and recreate. Now we need to create one table which
    will maintain history of the records.
    my table structure is listed below
    TableName CurrentReocrdCount CurrentExecutionDate PreviousReordCount PreviousExurtiondate
    TEST         1000                   2014-03-30            NULL        NULL
    Test         1500                   2014-04-10            1000      2014-03-30
    Test         2000                   2014-04-11            1500      2014-04-10 
    How do i achive this . 
    franklinsentil

    You need to create audit tables for these. The table will be populated by COUNT value inside stored procedure. Each time it clears the main table and fills new data and also logs count details to audit tables. You can use COUNT(*)  to get count value
    and GETDATE function to get current execution value.
    So proc will look like
    CREATE PROC procname
    @param....
    AS
    --step to drop existing table
    IF OBJECT_ID('tablename') IS NOT NULL
    DROP TABLE <table name>
    --step to fill new table
    SELECT ...
    INTO TableName
    FROM
    --Audit table fill step
    INSERT AuditTable (TableName,CurrentRecordCount,CurrentExecdate,PrevRecordCount,PrevExecDate)
    SELECT TOP 1 'TableName',(SELECT COUNT(*) FROM tableName),GETDATE(),CurrentRecordCount,CurrentExecDate
    FROM AuditTable
    ORDER BY CurrentExecDate DESC
    UNION ALL
    SELECT 'TableName',(SELECT COUNT(*) FROM tableName),NULL,NULL
    WHERE NOT EXISTS (SELECT 1 FROM AuditTable)
    GO
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Auditing tables..

    Hi Experts,
    Could anyone help me with the following issue.
    we are trying to implement the "audit feature" on a table. what is the best way to do the audit? (keep track of all the changes in the table)
    This is what we are doing..
      Main_table
      id
      first_name
      last_name
       dob
      hire_date
      created_date
      created_by
      updated_date
      updated_by
      audit_table
      ad_action (whether it is insert,update or delete)
      ad_time (time)
      ad_user (whos is the user)
      id
      first_name
      last_name
       dob
      hire_date
      created_date
      created_by
      updated_date
      updated_by
    and i have a trigger on the "main_table" like this
      CREATE OR REPLACE TRIGGER Main_table_AIUD after
    insert or update or delete on Main_table for each row
    begin
       declare
          ljn_action varchar2(3);
       begin
          if inserting then
             ljn_action := 'INS';
          elsif updating then
             ljn_action := 'UPD';
          else
             ljn_action := 'DEL';
          end if;
          if inserting  then
             insert into audit_table
              ad_action,
              ad_time,
              ad_user,
              id
              first_name
             last_name
             dob
             hire_date
             created_date
             created_by
             updated_date
             updated_by
             values
              ljn_action
             ,sysdate
             ,nvl(v('APP_USER') ,USER)
             :new.id,
            :new.first_name,
             :new.last_name,
              :new.dob,
             :new.hire_date,
             :new.created_date,
             :new.created_by,
             :new.updated_date,
              :new.updated_by
          elsif updating then
            insert into audit_table
              ad_action,
              ad_time,
              ad_user,
              id
              first_name
             last_name
             dob
             hire_date
             created_date
             created_by
             updated_date
             updated_by
             values
              ljn_action
             ,sysdate
             ,nvl(v('APP_USER') ,USER)
             :old.id,
            :old.first_name,
             :old.last_name,
              :old.dob,
             :old.hire_date,
             :old.created_date,
             :old.created_by,
             :old.updated_date,
              :new.updated_by
          else
             insert into audit_table
              ad_action,
              ad_time,
              ad_user,
              id
              first_name
             last_name
             dob
             hire_date
             created_date
             created_by
             updated_date
             updated_by
             values
              ljn_action
             ,sysdate
             ,nvl(v('APP_USER') ,USER)
             :old.id,
            :old.first_name,
             :old.last_name,
              :old.dob,
             :old.hire_date,
             :old.created_date,
             :old.created_by,
             :old.updated_date,
              :new.updated_by
          end if;
       end;
    end;
    /For "Insert" and "Delete" as i need to capture all the elements my code would be ok.
    But for "update" how can i capture only the columns that got changed? and put it in the audit table
    so next time if i go to the audit table i can clearly see that these elements got changes.
    Is there any better way to do this?
    Please let me know
    Thanks

    Yeah for tracking OLD and NEW values you have to write a trigger.
    Your trigger code seems fine except a few quirks.
    You audit_table should contain two fields against each column of the main table. e.g. for first_name column in main_table there should be two fields old_firstname and new_firstname in the audit_table.
    And then each section of trigger (inserting, updating, deleting) insert both :OLD and :NEW values to the table. In case of INSERT there will be no :OLD values so just insert NULL and in case of DELETE there will be no :NEW values so insert NULL. But in case of UPDATE its important to track both :NEW and :OLD.
    and if you track both NEW and OLD values in the trigger and put them in the audit_table then you no longer need to identify which columns are changed. You can figure that later on when you query the audit_table, any fields where OLD and NEW values are same was not updated.
    If you still want to check which column was changed in the trigger, refer to Himanshu Kandpal's post above.
    And you probably don't need this code in the trigger:
          if inserting then
             ljn_action := 'INS';
          elsif updating then
             ljn_action := 'UPD';
          else
             ljn_action := 'DEL';
          end if;You can Just use the values 'DEL','INS' and 'UPD' where appropriate instead of the ljn_action variable.

  • How to Query the Audit Tables

    Our Production system is suffering performance issues which we attribute to the large volume of records in the audit tables. We want to implement an archival solution to alleviate this, which would involve transferring older audit records to a separate database. To achieve this, we need to write SQL queries against the <app>DATAAUDIT and <app>TASKAUDIT tables in the HFM database. We are aware that we need to join other tables to see descriptions, e.g. <app>SCENARIODESC. We have also deduced the translation of Activity Codes from "HFMAuditExtractSchemaDefs.xml", which accompanies the HFM Audit Extract Utility.
    Unfortunately, there are some things which we do not know how to translate:
    1) Period (lPeriod) on the <app>DATAAUDIT table, e.g. 67108869 but need to show "Jun" etc.
    2) User (ActivityUserId) on the <app>TASKAUDIT table, e.g. -329543984
    3) Module (strModuleName) on the <app>TASKAUDIT table, e.g. #@RID@#19
    Can anyone advise how we should translate these pieces of data in order to give similar results to those seen on the Data Audit and Task Audit screens in Workspace?

    1.) Period - I'm not sure where this is coming from, but I'm pretty confident it is not sitting in the database which I find odd. I want to find this as well, but haven't had any free time to search around, sorry.
    2.) User - This one I can help you with.
    --Get Task Item Data by Hour for a given day by user
    select datepart(HOUR, cast(endtime-2 as smalldatetime)), count(activitycode) from <APP_NAME>_task_audit where activitycode in (1,4,6,8,9,12,14,15,16,21,23,44) and cast(endtime-2 as smalldatetime) between '2011-12-7 00:00:00' and '2011-12-7 23:59:59' and ActivityUserID in (select lUserID from HSV_ACTIVITY_USERS where sUserName = '<USER_NAME>') group by datepart(HOUR, cast(endtime-2 as smalldatetime))In the sample SQL Query above, I am looking for all of the task audit activity (for the specified tasks) for a specific user by hour. The part of the query you want to focus on is
    and ActivityUserID in (select lUserID from HSV_ACTIVITY_USERS where sUserName = '<USER_NAME>')The ActivityUserID in the task audit table will match up to the lUserID field in the HSV_ACTIVITY_USERS table. sUserName will be the actual text username. Depending on how you are configured, the name may look like johndoe or johndoe@Native Directory or johndoe@AD, etc. If you query that table, you'll figure it out pretty quickly.
    3.) Module ID. I can only partially assist on this one.
    This is not also in the HFM database. I suspected it might be floating in workspace; however, can't really find it there either.
    I can tell you a couple things though....
    #@RID@# Is just a placeholder for Resource ID. The important part is the number behind it. If you do a search on your folders for @RID@, you'll get one hit where it is defined as a constant, but that is it. (I was hoping a file search would reveal a table of the ID's; however, I wasn't that lucky). There is probably a table of values that correspone somewhere, but I haven't found it.
    If you do a distinct select, you'll see there's not too many ...
    select distinct strmodulename from <APP_NAME>_task_audit#@RID@#10
    #@RID@#13
    #@RID@#14
    #@RID@#16
    #@RID@#18
    #@RID@#23
    #@RID@#30
    #@RID@#32
    #@RID@#4294967295
    #@RID@#45
    #@RID@#46
    #@RID@#49
    #@RID@#52
    #@RID@#58
    #@RID@#59
    #@RID@#65
    #@RID@#66
    #@RID@#67
    #@RID@#68
    #@RID@#69
    #@RID@#7
    #@RID@#9
    HyperionReports
    How can you determine these values?
    The quick and dirty way would be to run a Task Audit Extract for a given date range as this will reveal the Module Name.
    Then execute a SQL Query on the Task Audit Table for the same data range. You could then match up the records and deduce the values.
    --Get Task Items by Date Range
    select (select sUserName from HSV_ACTIVITY_USERS where lUserID = ActivityUserID) as UserName, ActivityCode, ServerName, AppName, cast(StartTime-2 as smalldatetime), cast(EndTime-2 as smalldatetime), strDescription, strModuleName from <APP_NAME>_task_audit where cast(endtime-2 as smalldatetime) between '2011-12-7 00:00:00' and '2011-12-7 23:59:59' order by endtime ascOnce you determine the values, I would create a table in your database to hold them so that you could use them in future queries. I would also recommend you do the same with the activitycodes.

  • OIM 9102 Issued Audit Message null pointer

    Hi All,
    I have a 9102 system with an empty upa_ud_formfields table. We tried running the Issue Audit Message job (which was disabled for some reason) and got a NPE.
    I found the same thing here but never answered.
    Re: Audit reports in OIM 9102
    any help would be appreciated.
    Thanx
    Fred

    1. XL.EnableExceptionReports needs to be set to TRUE and XL.UserProfileAuditDataCollection needs to be set to Resource Form.
    2. In the Audit Report Developers Guide, section 5.3.1 Using the UPA Form Data Upgrade Utility, you need to perform the steps to enable the usable of these fields (http://download.oracle.com/docs/cd/E14049_01/doc.9101/e14045/reporting.htm#CEGFCIAD).
    3. Restart Server.
    -Kevin

  • Fetching SSIS error message into Audit table using SP

    Hi Experts,
    I want to fetch SSIS Error Info along with Task Name into Audit table 'Error_Info' column. This is nvarchar(max) datatype, i wrote below Stored Procedure for this (Column names passing dynamically in SP)
    CREATE PROC [dbo].[usp_AuditErrorHandler]
    @AuditTableName nvarchar(MAX)
    ,@Audit_Status nvarchar(100)
    ,@Audit_ErrorDescription sql_variant
    ,@Audit_PkgEnd_dttm nvarchar(100)
    ,@task sql_variant
    ,@errordescription sql_variant 
    ,@Audit_ID nvarchar(10)
    ,@LogID INT
    AS
    BEGIN
    DECLARE @STRQuery NVARCHAR(MAX)
    SET @STRQuery = ' 
    UPDATE '+@AuditTableName+'
    SET '+@Audit_Status+' = ''Failed''
    ,'+@Audit_PkgEnd_dttm+' = GETDATE()
    ,'+@Audit_ErrorDescription+' = ''Task['+ @task +']:'+@errordescription +'''
    WHERE ' +@Audit_ID+ ' = ' + CAST(@LogID AS NVARCHAR)
    The above procedure is working fine in SSMS and inserting complete error info into table, but when i am executing thru SSIS Pkg i am getting error like
    "[Execute SQL Task] Error: Executing the query "exec usp_AuditErrorHandler ?,?,?,?,?,?,?,?" failed with the following error: "Incorrect syntax near '@P1'.". Possible failure reasons: Problems with the query, "ResultSet"
    property not set correctly, parameters not set correctly, or connection not established correctly."
    So, i tot of checking with string lenght and modifed the code by adding left () to @errordescription as below.
    UPDATE '+@AuditTableName+'
    SET '+@Audit_Status+' = ''Failed''
    ,'+@Audit_PkgEnd_dttm+' = GETDATE()
    ,'+@Audit_ErrorDescription+' = ''Task['+ @task +']:'+LEFT(@errordescription ,100)+'''
    WHERE ' +@Audit_ID+ ' = ' + CAST(@LogID AS NVARCHAR)
    Here, it is inserting till 119 chars, if i give more than 119 chars pkg is failing with above error.
    I want to get insert Complete error info into the column.
    Can anybody suggest on this?? 
    Thanks in advance !!!

    Thanks Arthur for the response, i have tried with the Sql_Variant data type also, here  procedure itself not creating and throwing below error.
    "The data types nvarchar(max) and sql_variant are incompatible in the add operator."
    This is the procedure i am using to fetch error info into Audit table.
    ALTER PROC [dbo].[usp_AuditErrorHandler]
    @AuditTableName nvarchar(MAX)
    ,@Audit_Status nvarchar(100)
    ,@Audit_PkgEnd_dttm nvarchar(100)
    ,@Audit_Task_ErrorCode nvarchar(100)
    ,@Audit_ErrorDescription SQL_VARIANT
    ,@errorcode nvarchar(max)
    ,@task SQL_VARIANT
    ,@errordescription SQL_VARIANT 
    ,@Audit_ID nvarchar(10)
    ,@LogID INT
    AS
    BEGIN
    SET NOCOUNT ON;
    DECLARE @STRQuery SQL_VARIANT
    BEGIN TRY
    SET @STRQuery = '    
    UPDATE  '+@AuditTableName+'
    SET     '+@Audit_Status+' = ''Failed''
           ,'+@Audit_PkgEnd_dttm+' = GETDATE()
           ,'+@Audit_Task_ErrorCode+' = '''+@errorcode+'''
           ,'+@Audit_ErrorDescription+' = ''Task['+ @task +']:'+ @errordescription +'''
    (Error is giving in this line)
    WHERE   ' +@Audit_ID+ ' = ' + CAST(@LogID AS NVARCHAR)
    EXEC (@STRQuery)
    END TRY 
    Below is the Audit Table Schema

  • Trigger problem -- can't insert the same data into audit table

    Sir/Madam,
    I'm trying to use insert trigger with a 'long raw' datatype data for my audit purpose. Each time, the data of original table can be inserted correctly. While the trigger for audit table in which it contains almost the same data as original would failed. The error messages are some thing like following:
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    ORA-06512: at "CORPSEC.TI_ARCHIVE_PDF", line 9
    ORA-04088: error during execution of trigger 'CORPSEC.TI_ARCHIVE_PDF'
    If the column with 'long raw' datatype is taken out, then there is no error at all. I'm using Oracle 8i 8.1.6 for Windows NT and suspect there is bug in PL/SQL execution.
    The following are SQL text for the trigger:
    CREATE OR REPLACE TRIGGER "CORPSEC"."TI_ARCHIVE_PDF" AFTER INSERT ON "ARCHIVE_PDF" FOR EACH ROW DECLARE
    LOG_SEQ_NO NUMBER;
    BEGIN
    SELECT AUDIT_SEQ.NEXTVAL INTO LOG_SEQ_NO FROM DUAL
    insert into ad_archive_pdf (DOC_TITLE,PDF_FILENAME,CONTENT,DOC_DESC,AUDIT_REF_NO,AUDIT_DATE,AUDIT_MODE,AUDIT_BY)
    values (:new.DOC_TITLE,:new.PDF_FILENAME,:new.CONTENT,:new.DOC_DESC,LOG_SEQ_NO,sysdate,'I',:new.created_by);
    END;
    Any help on this. Thank in advance.
    Best regards,
    Ruijie

    See here for a discussion of how to incorporate LONG datatypes into triggers:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:635439::NO::F4950_P8_DISPLAYID

  • Query based on main table and audit table

    Hi,
    I had created auditing on some table. Values might not change and if they changed, it should be stored in audit table.
    I want to get the values in the table a on real time basis, like dimentions in datawarehouse.
    Trying to write a query based on table a and aud_a to get point-in-time or values at anytime in the past.
    Something like
    SELECT *
    FROM a (table_name)
    WHERE effective_from >= $DATE_TO_QUERY
    AND effective_to < $DATE_TO_QUERY
    How to get this kind of query .
    Please help. ( Table structure for table a and audit table aud_a and trigger aud_tg_a given below)
    Giving code as follows.
    main table a
    create table a
    ( val1 number,
    val2 number,
    update_by varchar2(30),
    date_updated date);
    creare auidt table aud_a
    create table aud_a
    ( "AUDIT_SEQ" NUMBER,
    "AUDIT_TRAN_ID" NUMBER,
    "AUDIT_PROG_ID" VARCHAR2(30 BYTE),
    "AUDIT_TERMINAL" VARCHAR2(16 BYTE),
    "AUDIT_REASON" VARCHAR2(30 BYTE),
    "AUDIT_ACTION" CHAR(1 BYTE),
    "AUDIT_ACTION_BY" VARCHAR2(20 BYTE),
    "AUDIT_ACTION_DT" DATE,
    val1 number,
    val2 number,
    updated_by varchar2(30),
    date_updated date);
    trigger on  table a to populate aud_a
    CREATE OR REPLACE TRIGGER aud_tg_a AFTER
    INSERT OR
    DELETE OR
    update on a
    for each row
    declare
    v_time_now DATE;
    v_terminal VARCHAR2(16);
    v_tran_id NUMBER;
    v_prog_id VARCHAR2(30);
    V_reason VARCHAR2(30);
    BEGIN
    v_time_now := sysdate;
    v_terminal := userenv('TERMINAL');
    v_tran_id := 1;
    v_prog_id := 'test';
    v_reason := 'AUDIT';
    IF inserting THEN
    INSERT
    INTO a
    audit_seq,
    AUDIT_tran_id,
    AUDIT_prog_id,
    AUDIT_reason,
    AUDIT_terminal,
    AUDIT_action_by,
    AUDIT_action_dt,
    AUDIT_action ,
    val1,
    val2,
    updated_by,
    date_updated
    VALUES
    s_audit_no.nextval,
    v_tran_id,
    v_prog_id,
    v_reason,
    v_terminal,
    USER,
    v_time_now,
    'I' ,
    :new.val1,
    :new.val2,
    :new.updated_by,
    :new.date_updated
    elsif deleting THEN
    INSERT
    INTO a
    audit_seq,
    AUDIT_tran_id,
    AUDIT_prog_id,
    AUDIT_reason,
    AUDIT_terminal,
    AUDIT_action_by,
    AUDIT_action_dt,
    AUDIT_action ,
    us_agy_backed_id,
    industry_subgroup,
    comments,
    updated_by,
    date_updated
    VALUES
    s_audit_no.nextval,
    v_tran_id,
    v_prog_id,
    v_reason,
    v_terminal,
    USER,
    v_time_now,
    'D' ,
    :old.val1,
    :old.val2,
    :old.comments,
    :old.updated_by,
    :old.date_updated
    elsif updating THEN
    INSERT
    INTO a
    audit_seq,
    AUDIT_tran_id,
    AUDIT_prog_id,
    AUDIT_reason,
    AUDIT_terminal,
    AUDIT_action_by,
    AUDIT_action_dt,
    AUDIT_action ,
    us_agy_backed_id,
    industry_subgroup,
    comments,
    updated_by,
    date_updated
    VALUES
    s_audit_no.nextval,
    v_tran_id,
    v_prog_id,
    v_reason,
    v_terminal,
    USER,
    v_time_now,
    'U' ,
    :new.val1,
    :new.val2,
    :new.updated_by,
    :new.date_updated
    END IF;
    END;
    -------------------------

    Hi hoek,
    I am not able to use Oracle's audit functionality becuase I need to trap some changes in particular tables and then rebuild query if required.
    Thanks for your suggestion though.
    Regards,
    Milind

  • How to access to audit tables in Oracle Content DB version 10.2.0.0.1

    Hello,
    Could someone tell me please how to access to Oracle Content DB audit tables as:
    ODMZA_RAWAUDITEVENT
    ODMZA_AUDITEVENTPROPERTY
    ODMZA_AUDITEVENT
    ODMZA_AUDITOPTYPE
    ODMZA_AUDITTARGETCLASS
    ODM_INTERMEDIAAUDIO
    ODM_AUDITINGCONFIGURATION
    ODM_AUDITTYPEENTRY
    ODM_AUDITSPECIFICATION
    ODM_AUDITTYPELIST
    ODM_AUDITTARGETSPEC
    Could you tell me the way to view all these audits logs?
    Which interface should I have?
    Thanks for your help.
    Alex

    Hi
    Yes you can directly apply path set 10.2.0.4
    Note 839187 - Oracle 10.2.0: Applying patch set/patches/patch collection
    Regards
    Uday

  • How to populate SQL Text in auditing table?

    Hi,
    Only modifying the 'AUDIT_TRAIL' .ora parameter is enough to popoulate SQL text?
    Plz reply,if you have any concerns.
    Thanks,

    Hi,
    >>I gone through few documents to enable SQL_TEXT in audit table,it says Changing the . ora parameter to 'DB_EXTENDED' is enough to populate SQL text.
    That's right. The exact SQL statement executed by the user and the bind variables used with the SQL are collected in the audit trail when the initialization parameter AUDIT_TRAIL is set to DB_EXTENDED. The DB or TRUE value will not populate the SQLTEXT and SQLBIND columns of the AUD$ table.
    Cheers
    Legatti

  • Update audit table trigger by a column

    Have a need to update a audit table when a specific column data has been updated\deleted\inserted on table T1 . The column is Grade_complete.
    My first thought was to create an instead of trigger since the form was based on the table (T1) view
    ( CREATE OR REPLACE TRIGGER "AI_T1" AFTER INSERT OR UPDATE OF grade_complete ON T1........) but then I realized with instead of , I can't create a trigger with a update of . Can anyone give me some suggestions on how to resolve this ? There got to be something easy that I am just not getting it now.
    Thanks.
    Wan

    Jure, Roel;
    Thanks for the reply.
    I have no permission to create triggers on the table so instead of being used. when ran the following statement , I am getting "ORA-25004: WHEN clause is not allowed in INSTEAD of triggers. Have tried if statement to no avail. Can anyone help ?
    create or replace trigger ioft_test
    instead of insert or update or delete on T1
    referencing old as old new as new for each row
    when nvl(new.grade_complete, 0) != nvl(old.grade_complete, -1)
    declare
    v_seq number;
    begin
    insert statemetn here
    end;

  • Problem in Issues/message table problem in RMMAIN

    Hello ,
    I have a problem in Issues/messages table in tx RMMAIN
    Problem:When i click on create "Issue" tab in RMMAIN,issue tab is disabled.
    Please let me know what i have to do?
    Regards,
    Neni

    Hi,
    Is this problem with a roadmap assigned with a project or a roadmap not yet assigned with a project?
    If this roadmap is assigned with a project, then:
    1. Go to tcode: SOLAR_PROJECT_ADMIN->select the project to which this roadmap is assigned.
    2. Go to tab->Project Standards->Select the tab "TABS".
    3. Check the visibility of the tab "Issues/Messages". It should be "Visible".
    If still the problem persists, then check whether you have this SAP_RMMAIN_EXE authorization.
    Check also that you have activated BC sets for service desk.
    SOLMAN40_SDESK_BASICFUNC_000
    SOLMAN40_SDESK_TPI_ACT_AST_001
    SOLMAN40_SDESK_ACTIONLOG_001
    SOLMAN40_SDESK_ACT_ADVCLOSE_001
    SOLMAN40_SDESK_TEXTTYPES_001
    Let me know if this not solved your issue.
    Regards,
    Sanjai

  • Is it possible to records another machine ip addree in audit table

    Hai
    I have written system event trigger,it records username, ip address and time in audit table when user logged on database , The database reside on xx machine ( 10.0.0.88 ipaddess ). Is it possible to records another machine ip addree in audit table while accessing database from another machine?
    example we have another database on xxx machine (10.0.0.2 ip address),when accessing database from xxx(10.0.0.2) to xx (10.0.0.88),the xxx node ip address will be stored in audit table?.
    Thanks in advance
    Regards
    mohan
    CREATE OR REPLACE TRIGGER On_Logon
    AFTER LOGON
    ON database
    declare
    db_name VARCHAR2(50);
    addr varchar2(80);
    x varchar2(20);
    begin
    db_name := ora_database_name;
    select utl_inaddr.get_host_address into x from dual;
    if ( ora_sysevent ='LOGON')
    then x:=utl_inaddr.get_host_address;
    insert into log1
    select ora_sysevent,ora_login_user,ora_database_name,utl_inaddr.get_host_address,sysdate
    from dual;
    end if;
    end;
    SQL> select * from log1;
    OPERATION USERNAME DATABASE IP_ADDR TIME
    LOGON MOHAN1 ISOLA6.US.ORACLE.COM 10.0.0.88 11-APR-02
    Based on system events trigger how to find out which user from which machine (ip address) accesing database?
    example:
    CREATE OR REPLACE TRIGGER On_Logon
    AFTER LOGON
    ON database
    declare
    db_name VARCHAR2(50);
    addr varchar2(80);
    x varchar2(20);
    begin
    db_name := ora_database_name;
    select utl_inaddr.get_host_address into x from dual;
    if ( ora_sysevent ='LOGON')
    then x:=utl_inaddr.get_host_address;
    insert into log1
    select ora_sysevent,ora_login_user,ora_database_name,utl_inaddr.get_host_address,sysdate
    from dual;
    end if;
    end;
    SQL> select * from log1;
    OPERATION USERNAME DATABASE IP_ADDR TIME
    LOGON MOHAN1 ISOLA6.US.ORACLE.COM 10.0.0.88 11-APR-02

    Providing you're on 8i+ this will give you the IP address from which th eclient is connected:
    SELECT sys_context('userenv', IP_ADDRESS) FROM dual;
    Bear in mind that many network applications assign IP Addresses dynamically, so depending on how your network is segmented, the same machine can have very different IP addresses from day to day. If this is just an internal system you're auditing then you might find this call more useful:
    SELECT sys_context('userenv', TERMINAL) FROM dual;
    This returns the network's ID for the machine, and this is non-varying (unless network admin change it explicitly - but why would they?). This call is also available in the older, deprecated USERENV function:
    SELECT userenv('TERMINAL') FROM dual;
    rgds, APC

  • I want to know when we issue truncate table statement in oracle .

    i want to know when we issue truncate table statement in oracle .No log will be write in redo log .But we can recover data using flashback or scn.I want to know where is the actually truncate table statement log is stored in oracle database.Please explain me in detail step by step .

    Hi,
    I have truncated table after that i have restored that data.See below the example.I want to know from where it's restored.
    From which log file it's restored.
    create table mytab (n number, x varchar2(90), d date);
    alter table mytab enable row movement;
    Table altered.
    SQL> insert into mytab values (1,'Monsters of Folk',sysdate);
    1 row created.
    SQL> insert into mytab values (2,'The Frames',sysdate-1/24);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select CURRENT_SCN from v$database;
    CURRENT_SCN
    972383
    SQL> select * from mytab;
    N
    X
    D
    1
    Monsters of Folk
    30-DEC-12
    2
    The Frames
    30-DEC-12
    N
    X
    D
    SQL> set lines 10000
    SQL> /
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    SQL> select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
    TO_CHAR(SYSDATE,'
    20121230 09:29:24
    SQL> set timing on
    SQL> truncate table mytab;
    Table truncated.
    Elapsed: 00:00:15.75
    SQL> select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    Elapsed: 00:00:00.28
    SQL> insert into mytab select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    2 rows created.
    Elapsed: 00:00:00.01
    SQL>

  • Audit tables in mappings

    I want to know is there anyway we can capture wb_rt tables in mapping. This are runtime audit tables in owb. Is there any documentation where I can get the description of this tables.
    What I want to do is to get infor from audit tables to get the row count from previous mapping run and compare before loading the final target.
    I am new to owb and I want to know is there any process in owb or process flow to check before loading into target like checking how many rows were loaded into staging and is it equal to no. of rows after transformation.
    Is anyone doing this kind of consistency checks in there ETL process. Any kind of info will be helpful
    Thnaks

    http://download-east.oracle.com/docs/cd/B31080_01/doc/owb.102/b28225/toc.htm
    in the second chapter

Maybe you are looking for

  • How to measure progress of file copy?

    One of the requirements for my AIR application is to copy large files from one location to another on the client computer. I've been using the copyToAsync() method in AIR, but unfortunately this does not trigger progress events. Copying gigabyte file

  • How to know when a topic does not exist

    I have an app that is created with Visual Studio 6, which does not have native support for HTML help (upgrading VS is currently not an option). I have an HTML help that I would like to call from my app. I need to call the html help with a context id

  • Remowe password protection

    How can I remove a password protection in a PDF file I have received?

  • Query on Thread

    Hi , I have a query on Thread in Java. In the class Thread there is a method named start(), which when called , invokes another method run().Then why we do not call the method run() directly ,instead of calling start() ? Regards. Ayan

  • Can/How do you save excel files to the cloud?

    How, if at all, can you save excel files to icloud?