Strange issue on deleting some rows on SYS.AUD$ table

I just found out this strange thing happened on my 10gR2 database. I created a user called AUDIT_LOG and GRANT DELETE, REFERENCES, SELECT ON SYS.AUD$ TO AUDIT_LOG when I logged on as SYS dba.
(1) Then I logged on as AUDIT_LOG user, tested the following statements:
SELECT count(*) from sys.aud$ where ntimestamp# < TRUNC (SYSDATE-14);
COUNT(*)
2
DELETE from sys.aud$ where ntimestamp# < TRUNC(SYSDATE-14);
0 rows deleted
(2) When I logged on as SYS account, SYS deleted them all,
DELETE from sys.aud$ where ntimestamp# < TRUNC(SYSDATE-14);
2 rows deleted
I don't understand why the AUDIT_LOG user can't delete that two rows?
Thanks for your help!
lixidon

Apologies for misreading the first time. I am wondering if the rows in question were related to audit actions on sys.aud$ itself as those rows should not be deleted by the AUDIT_LOG user (even if the user has been granted delete).
Here's an excerpt from the Security Guide under the "Protecting the Standard Audit Trail" section:
Audit records generated as a result of object audit options set for the SYS.AUD$ table can only be deleted from the audit trail by someone connected with administrator privileges, which itself has protection against unauthorized use.
Here's a quick example illustrating this:
SQL> connect / as sysdba
Connected.
SQL> grant delete, references, select on sys.aud$ to scott;
Grant succeeded.
SQL> connect scott/tiger
Connected.
SQL> select count(*) from sys.aud$ where sessionid = 30002;
  COUNT(*)
         2
1 row selected.
SQL> delete from sys.aud$ where sessionid = 30002;
2 rows deleted.
SQL> commit;
-- now try to delete the sys.aud$ rows related to the above delete
-- this will not succeed as user scott even though delete has been granted
-- the session that performed the delete is 422426
SQL> select count(*) from sys.aud$ where obj$name = 'AUD$' and action# = 7 and sessionid = 422426;
  COUNT(*)
         2
1 row selected.
SQL> delete from sys.aud$ where obj$name = 'AUD$' and action# = 7 and sessionid = 422426;
0 rows deleted.
SQL>Regards,
Mark

Similar Messages

  • Issue while deleting a row from a table

    Dear friends,
    i am getting an issue while deleting a row from a table, pls check screen shots , the first screen shot is my table contents
    when i delete 2 row , the second row is deleting properly like below screen shot
    but i want like below screen shot , Col1 contents should be like pic 1 . could any one pls let me know how to solve this issue.
    Thanks
    Vijaya

    Hi vijaya,
    please try this code, it will help you.
    DATA : it_rows  TYPE wdr_context_element_set,
              wa_rows LIKE LINE OF it_rows.
       DATA lo_nd_table TYPE REF TO if_wd_context_node.
        DATA lt_table TYPE wd_this->elements_table.
       DATA lo_el_table TYPE REF TO if_wd_context_element.
       DATA ls_vbap TYPE wd_this->element_table.
    DATA: ld_index TYPE i.
    data value TYPE sy-index.
    * navigate from <CONTEXT> to <table> via lead selection
       lo_nd_table= wd_context->get_child_node( name = wd_this->wdctx_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
    * get element via lead selection
    * alternative access  via index
    * lo_el_table = lo_nd_table->get_element( index = 1 ).
    * @TODO handle not set lead selection
       IF lo_el_table IS INITIAL.
       ENDIF.
    * navigate from <CONTEXT> to <table> via lead selection
       lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
       lo_nd_table->get_static_attributes_table( IMPORTING table = lt_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
    ** @TODO compute values
    ** e.g. call a model function
    * navigate from <CONTEXT> to <table> via lead selection
       lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
    * @TODO handle non existant child
    * IF lo_nd_table IS INITIAL.
    * ENDIF.
    ** @TODO compute values
    ** e.g. call a model function
    it_rows  =  lo_nd_table>get_selected_elements( ).
       CALL METHOD lo_nd_table->GET_LEAD_SELECTION_INDEX
       RECEIVING
         INDEX  = value .
      LOOP AT it_rows INTO wa_rows.
         CALL METHOD wa_rows->get_static_attributes
           IMPORTING
                  static_attributes = ls_table.
         READ TABLE lt_table INTO ls_table WITH KEY col1 = ls_table-col1.
          ld_index = value.
              ENDLOOP.
       CLEAR : ls_table-col2,
             ls_table-col2.
       MODIFY lt_table INDEX ld_index FROM ls_table.
      lo_nd_table->bind_table( new_items = lt_table set_initial_elements = abap_true ).

  • Deleting multiple rows from SUD dialog table

    Hi,
    I have some SUD dialog tables that I would like to delete some rows from.  I can select and delete all or one row (using a SUD button that finds out which one row was selected or if all, and then deleting them with the table.rows.remove command), but I seem to have troubles if I want to select multiple rows (either in a range, ex: rows 3-10, or non-sequential, ex: 1, 4, 6 and 23).  I just started working on this but thought maybe someone has already done this and can save me the trouble!
    Thanks!
    Julia Moeller

    Hi Julia,
    Just a quick guess-- try looping backwards and deleting the last rows first:
    FOR i = 10 TO 3 Step -1
      table.rows.remove i
    NEXT
    Haven't tested it, so no guarantees,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How to delete some of records from wf_notifications table any API Name?

    Hi All,
    I want to delete some of records from wf_notifications table , can any one tell API' name and Back end delete process.
    Thanks,
    Ramu
    Edited by: Ramu on Mar 20, 2013 5:42 AM

    Hi ,
    I hv done below script, now it's working fine.
    DECLARE
    CURSOR csr_transaction_id IS
    SELECT   hat.transaction_id,
             hat.item_type,
             hat.item_key,
             ppx.employee_number,
             hat.section_display_name
      FROM   hr_api_transactions hat, per_people_x ppx
    WHERE   hat.process_name = 'HR_PERSONAL_INFO_JSP_PRC'
             AND hat.selected_person_id = ppx.person_id
             AND ppx.employee_number IN
                      ('100024773',
                       '100024820',
                       '100024859',
                       '100024879',
                       '100024902',
                       '100024937',
                       '100025137',
                       '100026470',
                       '610014755',
                       '610017039')
    order by  ppx.employee_number;
    BEGIN
      dbms_output.put_line('***Deleted all Transactions  and Notifications of below Employee Personals Tranactions ***');
       FOR my_cur_v IN csr_transaction_id
       LOOP
       /*Delete all Transaction_id's in hr_api_transactions,hr_api_transaction_steps,hr_api_transaction_values and hr_api_transaction_steps_bk tables */
        hr_transaction_swi.delete_transaction
                              p_transaction_id =>my_cur_v.transaction_id,
                              p_validate => hr_api.g_false_num
        wf_engine.abortprocess  (
                                  itemtype => my_cur_v.item_type,
                                 itemkey => my_cur_v.item_key
         /* Deleted all Notification_id's and item_key's in wf_item_activity_statuses,wf_items,wf_item_attribute_values,wf_notifications     Table */                     
         wf_purge.items (
                          itemtype => my_cur_v.item_type,
                         itemkey => my_cur_v.item_key
        dbms_output.put_line('Emp No --'||my_cur_v.employee_number||'Transaction_id :'||my_cur_v.transaction_id||'Emp Personal Info :'||my_cur_v.section_display_name||
                              'Item Type :'||my_cur_v.item_type|| 'Item Key :'||my_cur_v.item_key); 
       END LOOP;
       commit;
    EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line('hr_transaction_swi.delete_transaction api goest to exception block'    ||sqlcode|| '  '||sqlerrm);
    END;  
    /thanks,
    Ramu

  • Randomly selecting some rows from the database table

    Hi can some one help me in selecting some rows from a database table which has around 90,000 rows.
    Thanks.

    One thing you might try is the "sample" clause if you have 8i which is supposed to return a random percentage of the table. Say for example, you have a sequence number on your table as the pkey. Then you might try:
    select * from <table_name> where pkey in(select pkey from <table_name> sample(10));
    This should give you a random 10 percent of the rows in the table but I tried this once and the results seemed unpredictable. For example it returned a different number of rows each time even though the number of rows in the table didn't change.
    Hope this works for you.

  • Sys.aud$ Table not accesible over PL/SQL ?

    I try to do the follow.
    When you start the auditing with specific command like AUDIT
    SESSION; it will produce many many rows in the sys.aud$ table.
    This is the reason while we need to maintain the data witch exist
    then in thsi table.
    I did try it to do this with a separate user like AUDITER.
    I gave them from the sys user the follow permissions:
    GRANT select, delete, update , insert to AUDITER;
    If i try now to select from SYS.AUD$ it works if i do it with a
    separet select statement like :
    SELECT * FROM SYS.AUD$.
    If i make a PROCEDURE like folow :
    PROCEDURE proceed_audit as
    CURSOR audtab is select * from sys.aud$
    BEGIN
    END;
    Oracle generate the message :
    PLS-00201: identifier 'SYS.AUD$' must be declared
    I don't anderstand this message, becose this object exists and in
    "SQL" i can use it.
    Can anyone help me ?
    Thanks
    P.S. it's the Oracle version 8.1.7i

    Are you sure the user that is executing the PL/SQL block has
    direct grants to the tables you are referencing? I.E. NOT
    through a role? PL/SQL requires the user to have direct grants
    to the object it references. Granting DBA to the user won't have
    any affect on the execution of the PL/SQL

  • Is there a way to include the sys.aud$ table in a full database dp export?

    I am doing an export using the following parfile information:
    userid=/
    directory=datapump_nightly_export
    dumpfile=test_expdp.dmp
    logfile=test_expdp.log
    full=y
    content=all
    However when I run this I do not see the sys.aud$ in the log file. I know I can do a seperate export to specifically get the sys.aud$ table but is there any way to include it in with my full export?
    Thanks in advance for any suggestion.

    here's more background infomation... I have some audits setup on my database for one of my users. Every quarter I have an automated job that runs that creates a usage/statics report for this person using data in aud$. at the end of the job I export the aud$ table and truncate it. However last quarter I found that there was a mistake in my report and my export did not run properly thus my audit data was gone. i also have full datapump exports that run daily but found that aud$ was not there. so that is why I thought I'd like to include sys.aud$ in the full datapump exports.
    i understand why other sys tables would be left out of a full export but aud$ data cannot be reproduced so to me it makes sense to include it in a full export.
    don't worry, we run our true backups using rman which is eventually how I got the aud$ data back by creating a copy of my database up until the time of the truncate. however this was quite time consuming.

  • Sys.aud$ table

    Hi,
    I need to get the auditing information for the last seven days fron the auditing table for users other than apps.I tried the below query.Please correct me if it is wrong.The query takes
    a long time to execute and no output dispayed.Please inform me whether the below query is correct and inform me if i need to do any modifications.
    select userid,userhost,terminal,action#,obj$name, NTIMESTAMP# from sys.aud$ where action#=3 and timestamp# >=(sysdate-7) and userid not in ('APPS') order by ntimestamp# desc;
    Regards
    Aram

    You are SELECTing and ORDERing using column NTIMESTAMP#, but WHERE clause is using TIMESTAMP# (different column), most likely leading to a poor execution plan. Is the statement you posted syntactically correct ?
    MOS Doc 1025314.6 - Descriptions of Action Code and Privileges Used in Fields in SYS.AUD$ Table
    HTH
    Srini

  • What is sessionid field in SYS.AUD$ table

    Hi,
    Can anyone say,what is sessionid field in sys.aud$ table..It seems different than the sessions

    Look at the session value in sys.aud$ table.
    QL> select sessionid from sys.aud$ where rownum<10;
    SESSIONID
    459521060
    459521607
    459521661
    459521901
    459521954
    459522004
    459522052
    459522262
    459522424
    It seems that,its not asession id.Mostly sessionid length ll be in3-4.

  • Deleting some rows

    I want to delete half of the columns of a table...or perhaps a 1/4 of it. Is there any way to do this in oracle 8i?

    You can also have Oracle pick rows randomly, i.e.
    SELECT *
      FROM <<someTable>> SAMPLE( 10 )will return approximately 10% of the table rows. You could then delete the rows that are returned by the above query.
    This approach will likely be more costly than Indirakumar's answer, but will be more likely to maintain the current data distribution.
    Justin

  • How to delete the row from the ADF table using popup box

    Hi,
    I have one requirement like need to delete a record from the table, but that time need to show one popup window for confirmation of the deletion. I am using Delete buttom from the vo operations. I am able to delete the row with out popup but when i used the popup that time deletion is not happening.
    Can any one help me in this.
    Regards,

    Issue was resolved.

  • Deleting a row from a UIData table

    I am trying to select a row from a jsf table then call a backing bean method to delete it using this backing bean method.
    void deleterow(){
    dataitem =(item) dataTable.getrowdata();
    List newlist = new ArrayList();
    table = model.getwrappeddata();
    for (int i=0; i<table.size(); i++){
        product = (product)table.get(i);
       if (!product.name.equals(dataitem.name)){
          newlist.add(product);
    model.setwrappeddata(newlist);
    }all the getter/setter methods are set and it does seem to work.However the results are very inconsistent,sometimes rows are deleted and then magically reappear on the the table latter! Anyone knows of a fail proof method of achieving this?
    Ta.

    A decent IDE ships with a code debugger which allows you tracking variables and running code step by step. If you don't use an IDE or you're unable to use it, then just add some sysouts which prints the desired variables at strategic locations and/or moments.

  • How to Update some column values in some rows in an advanced table

    Hi Gurus,
    Can any body help on this issue.
    I am having a results table which is showing all the queried parties data queried in a seeded page in OCO module.
    Lets assume the table contains 10 rows with the below columns
    Party Name, Registry ID, Address Country, Match Percentage, Certification Level, Certification Reason, Internal Indicator, Status .
    Certification Level, Certification Reason and Internal Indicator are the dropdowns.
    The user want to update some of these fields values for some rows randomly.
    After doing this if he click on Save button, Only thosed changed rows need to get update using a Custom Procedure.
    But here all the rows irrespective of the change getting updated.
    So  how to capture the modified rows.
    Appreciate any inputs..
    Thanks
    Palepu
    Edited by: Palepu on 9 Aug, 2012 4:25 PM

    Not sure if you got the answer. You need to capture the row which got changed using the below and get the column value using the getAttribute method. This works for single selection row, if it is multi selection then you will have to loop through all selected rows and find the VO attribute value.
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Row currentRow = am.findRowByRef(rowReference);
    String param1= (String)currentRow.getAttribute("VOAttribute");
    Let me know if there are any issues.
    Thanks
    Shree

  • Issue in deleting PSA request in the backend table.

    All
    We have been facing this strange issue with PSA - Ideally, when we delete a  request in the PSA, the contents of the respective back end table also get deleted. However, in case of one of the PSAs, if we delete the contents of the PSA, the same is not reflected in the backend table. As of today, the PSA is empty but the back end table has around 1 mn records. Looks like it has appended all the requests that we have loaded so far and not deleted the earlier entries.
    Any help on this issue will be appreciated. Thanks.
    Regards
    Niranjana

    In continuation it all depends on the SP you are ,i presume you are above SP>10 so below should not be an issue for you.
    When you try to delete requests from the PSA that were loaded into the PSA using an old 3.X DataSource and the DataSource has been convertes into a new NW2004S DataSource in the meantime, you cannot delete the requests properly.
    The administration information is deleted, but the data remains in the PSA table
    Note 983618 - P10:PSA: Deleting requests after converting old DS to new DS
    Hope it Helps
    Chetan
    @CP..

  • Deleting a row from the item table

    Hi All,
    I have a requirement where I need to put a button to delete the selected row from the item table and for this I have written the following code:
    DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
        DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
        DATA ls_t_bseg TYPE wd_this->element_t_bseg.
        data: it_tab type table of wd_this->element_t_bseg.
      lo_nd_t_bseg = wd_context->path_get_node( path = `Z.T_BSEG` ).
      lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
      lo_el_t_bseg->get_static_attributes(
        IMPORTING
          static_attributes = ls_t_bseg ).
        lo_nd_t_bseg = wd_context->path_get_node( path = `Z.T_BSEG` ).
        lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
        IF lo_el_t_bseg IS not INITIAL.
          lo_nd_t_bseg->remove_element( lo_el_t_bseg ).
        ENDIF.
    Now the problem is although it's deleteing the selected line correctly but because of this I am losing one line on the screen for the user to enter... my form has a fixed number of lines and in my case it's 10... so everytime I am using deleting a line item I am losing one line to enter..... can you please tell me how can I avoid this?
    Edited by: rajatg on Aug 4, 2011 3:12 PM

    lets say...
    i have 1,2,3 documents
    i have cleared , document 2....
    1. when the user selects this record.... you can read the context_element....using the context element you can get the values and clear those values and set the blank values...
    when the user click on save ...you can have only those two records in the table.
    2. conitnue with your logic .... remove_element. once it is done ,,, create_element at the deleted index...
    3. when clicked on delete ...remove_element ( current code).... bind the table to the node... and you will have ur values

Maybe you are looking for

  • How do I connect my existing wifi network to a new Airport network?

    Right now I have two wifi networks. The one that connects to the Internet and one that's for AirPlay and has no Internet connection. How do I connect the two? The desired outcome would be to have one network that connected to the Internet and also co

  • Error in opening idm screen

    HI I have this problem while trying to login to the IDM screen , java.lang.IllegalStateException: Error attempting to decrypt: Cannot find any provider supporting DESede/ECB/NoPadding I have no clue what this is can any one please help me with this .

  • Different result from same SQL statement

    The following SQL statement brings back records using query analyzer on the SQL server. However when I run it in a cold fusion page it comes back with no results. Any idea why???????? SELECT COUNT(h.userID) AS hits, u.OCD FROM dbo.tbl_hits h INNER JO

  • Duty Rate determination Issue

    Hi Experts, We are in the process of implementing Customs Management for US, Canada and Mexico. I am having an issue when a duty rate is determined for canadian imports. Even though I use the same/similar country group settings for US, CA and MX, whe

  • Why Won't The tutorial Videos run???

    I am at the lesson settings and the videos wont run