difference in number of records in the table of audit

Hi all

We strive to remove lines of verification based on timestamp(sysdate-30) table(sys.aud$). The command I used below.

SQL > set lines 200

COL OWNER FORMAT A15

Select TABLE_NAME, nom_tablespace, OWNER, num_rows, STATUS, DEGREE, TABLE_LOCK, LAST_ANALYZED, PARTITIONED, USER_STATS from dba_tables where TABLE_NAME = '& TABLE_NAME';

SQL > SQL > type table_name value: AUD$

OWNER, TABLE_NAME, NUM_ROWS STATUS DEGREE TABLE_LO LAST_ANALY BY USING NOM_TABLESPACE

--------------- ------------------------------ ------------------------------ ---------- -------- ---------- -------- ---------- --- ---

SYS AUD$ 934991 SYSTEM VALID ACTIVE 1 08/07/2012 No. No.

SQL > delete / * + parallel (aud$ 8) * / of sys.aud$ where NTIMESTAMP # < sysdate-30; (I don't know why I put NTIMESTAMP #, although I see # aud TIMESTAMP column $ table, the above query, I got from sr dba)

3140994 deleted rows. (reason why so many records have been deleted I see 934991 lines from dba_tables view)


After that I saw the difference in number of records.


SQL > select / * + parallel (aud$ 8) * / count (*) from sys.aud$ where TIMESTAMP # < sysdate-30;

COUNT (*)

----------

0

SQL > select / * + parallel (aud$ 8) * / count (*) from sys.aud$ where NTIMESTAMP # < sysdate-30; -> Why there are differences in the number of records if I put NTIMESTAMP #in query)


COUNT (*)

----------

50

Thank you

Bhavani.

SQL > SELECT count (*) from sys.aud$ where ntimestamp #.<>

COUNT (*)
----------
0

Try this one.  Good luck.

Tags: Database

Similar Questions

  • How can I recover only odd or even number of records in the table?

    Hello

    How can I recover only odd or even number of records in the table?

    Thank you

    Hi IndiMinds,

    Alternatively, you can use in queries. :

    Odd:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 1;

    Still:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 0;

    Thank you

  • Total number of records in the table read

    Here is the procedure to read total no of record in the table specified by the user during execution. But it still gives the same answer for all the table. Can someone help me?

    create or replace procedure p3 (varchar2, not on the number tab)
    as
    Start
    Select count (*) from no tab;
    end;

    You need dynamic SQL statements.

    Or:
    http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html
    To get the name of the Table and no lines
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:1725645184471282:P11_QUESTION_ID:1660875645686

    Or simply use the data dictionary, collect statistics of the table, then:
    Select table_name, num_rows from user_tables;

  • by comparing the number of records in the table child

    I have 3 tables below:

    Table 1 - Parent Table
    Table table2 child - who has the number of records for each record in Table1 (row_id in Table1 corresponds to par_row_id in Table2)
    Child table table 3 - has that number of records for each record in Table1 (row_id in Table1 corresponds to par_row_id in table 3)

    I would like to run an Oracle SQL query to identify all the separate row_id on Table1, for which the number of child records in Table2 does not match the number of child records in Table3

    I ask for help to identify the best way to identify these records in the parent table. If possible an example too, please.

    Thank you

    Published by: cseshan on February 3, 2013 01:35

    All by adding the simplest example (with the sample data that you were supposed to provide) below

    create table table1(row_id number primary key);
    
    create table table2(par_row_id number references table1);
    
    create table table3(par_row_id number references table1);
    
    insert into table1 values(1);
    insert into table2 values(1);
    insert into table3 values(1);
    
    insert into table1 values(2);
    insert into table2 values(2);
    insert into table2 values(2);
    
    insert into table1 values(3);
    insert into table3 values(3);
    insert into table3 values(3);
    
    insert into table1 values(4);
    insert into table2 values(4);
    insert into table2 values(4);
    insert into table2 values(4);
    insert into table3 values(4);
    insert into table3 values(4);
    
    commit;
    
    with child1_cnt as
    (
      select par_row_id,count(*) cnt
      from table2
      group by par_row_id
    ),
    child2_cnt as
    (
      select par_row_id,count(*) cnt
      from table3
      group by par_row_id
    ),
    all_counts as
    (
      select p.row_id,nvl(c1.cnt,0) c1_cnt,nvl(c2.cnt,0) c2_cnt
      from table1 p
       left outer join child1_cnt c1
         on ( p.row_id = c1.par_row_id )
       left outer join child2_cnt c2
         on ( p.row_id = c2.par_row_id )
    )
    select row_id,c1_cnt,c2_cnt
    from all_counts
    where c1_cnt != c2_cnt;
    
    ROW_ID C1_CNT C2_CNT
    ------ ------ ------
         2      2      0
         4      3      2
         3      0      2 
    
  • difference in number of records

    Hi all

    I'm trying to get a number of records in this table and I get 2 different output, select count (*) shows 68560 and after update stats NUM_ROWS watch 68323, can someone help me figureout why the difference.

    SQL > select count (*) in the dcepcd;

    COUNT (*)
    ----------
    68560

    SQL > select num_rows in dba_tables where table_name = 'DCEPCD ';

    NUM_ROWS
    ----------
    68323

    Thank you / JJ

    864653 wrote:
    Hi all

    I'm trying to get a number of records in this table and I get 2 different output, select count (*) shows 68560 and after update stats NUM_ROWS watch 68323, can someone help me figureout why the difference.

    SQL > select count (*) in the dcepcd;

    COUNT (*)
    ----------
    68560

    SQL > select num_rows dba_tables where table_name = 'DCEPCD ';

    NUM_ROWS
    ----------
    68323

    Thank you / JJ

    When you gather stats, Oracle is probably just sampling the data. This means that Oracle would be approximately the number of lines, not give you the actual number of lines. Please read the documentation on DBMS_STATS:
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25788/d_stats.htm

    Here is a relevant excerpt:
    Table 141-39 GATHER_DATABASE_STATS procedure parameters
    estimate_percent
    Percentage of rows estimate (NULL means calculates): the valid range is [0.000001,100]. Use the constant DBMS_STATS. AUTO_SAMPLE_SIZE to Oracle to determine the size of the sample appropriate for good statistics. It is the default value. The default value can be changed using the SET_DATABASE_PREFS procedure SET_GLOBAL_PREFS procedure, procedure SET_SCHEMA_PREFS and SET_TABLE_PREFS procedure.

    Summary: You should get the actual number of lines if gather you stats with estimate_percent => NULL. Be aware that Oracle does not by default for performance reasons.

  • Removal of the records in the tables

    Oracle 11g - Windows Server 2008

    After you delete a large number of records in a table, I think I should reorg or do something for it to be fine.

    The table name is def_lancs.
    I deleted records over 1 million of this table. It now has 2 million records.
    What commands can I use to put this table in order?

    Eduardo

    788042 wrote:
    Hello

    In the SQL databases after you delete a large number of rows in a table, we have a very large space with no information.
    Lines are deleted, but the space using these lines is always there.
    We must therefore use retractable in order to remove this empty space.
    After that, the present table less space and performance improves.

    I don't know how it works in Oracle.
    But as you tell me to relax and have a cup of coffee, I think that the Oracle databases do this automatically.
    Is this true?

    Eduardo

    No, they don't to shrink automatically and free up space, but usually no need to. Oracle manages to somehow fundamentally and profoundly different than SQLServer. Best practices in may very well be the worst practices in the other. In oracle, allocation and deallocation extensions are quite expensive activity. If I delete a bunch of lines that normally I guess at some point the space the lines take it will take once again, so I'm not going to Oracle through the effort to free the space just for having to recover again. At least not outside has demonstrated clearly need to do.

  • Number of records in the repeat region

    I have a page with a repeat region, which displays the records in Table1. Table1 is related to the Table2 (one to several, MS Access). I want to do is show the number of records in Table2 that are associated with a given row from Table1 shown in the repeat region.

    Think of how many responses listed next to each message in this forum, because that's basically what I do. As it is now, I get the correct number of records for the first line of Table1 shown in the repeat region, but this number is indicated in each line. In other words, if the first record displayed from Table1 has 3 matching records in table 2, 3 number in each row in the repeat region.

    I appreciate all the help that I'm a complete novice.

    Maybe it is not very effective, but I bet you it will do what you want:


    SELECT *.
    FROM table1
    ORDER BY name DESC


    SELECT *.
    FROM table2
    Where tid = #table1.id #.


    #table1.name #.
    #table1.client #.
    #table1.products #.
    $# numberformat (table1.income, '999,999.99') #.
    #table1.frequency #.
    #table2. RecordCount #.

  • How do I get the number of characters in the table

    Hi all

    I'm writing a query.

    Requirement is like this.

    You will need to obtain the total number of a character in a table.

    Here is an example of data.

    There are table T1 that has Column1, Column2, and Column3.

    Column1Column2Column3
    #*
    *&$
    (**
    *%!

    This is I want to get the total number of characters "*" in the table, regardless of the number of columns in this table.

    By the sample data above, I should get the count as '5'.

    I want to translate is not necessary:

    WITH got_columns_123 AS

    (

    SELECT column1 | Column2 | Column3 AS columns_123

    FROM t1

    )

    SELECT NVL (SUM ((columns_123) - NVL LENGTH (LENGTH (REPLACE (columns_123, ' *')), 0)), 0)

    OF got_columns_123;

  • Not able to read the values in group by, when no records in the table

    Hi all, I have this query

    Select p.header_id,

    Type "some_constant."

    sum (nvl (p.total_amount, 0)) sum_of

    from table_name p

    P.header_id group

    When there is record in the table, it works fine, but I want to if there is no any folder that it returns as below,

    header_id type sum_of

    some_constant 0 0

    How to...?

    Help, please.

    Kind regards

    SELECT * FROM (select p.header_id,

    Type "some_constant."

    sum (nvl (p.total_amount, 0)) sum_of

    from table_name p

    P.header_id group

    UNION ALL

    SELECT 0,

    BOX WHEN (SELECT COUNT (*) FROM table_name) = 0 THEN type of 'some_constant',

    ANOTHER NULL

    END type as,

    0

    THE DOUBLE)

    WHERE type IS NOT NULL;

    Post edited by: 000000

  • Number of records in the top of the report page

    Hello
    IAM trying to display the total number of records in the upper part (I have not posted in the footer) of my report classic/IR using the below javascript but somehow, is not working. I appreciate any suggestion on this subject,
    < Input id = "numrowsGet" type = "hidden" value = "" #TOTAL_ROWS # "/ >"
    < script type = "text/javascript" >
    If (document.getElementById("numrowsGet").value is "0")
    assign value to {0;
    }
    on the other
    {
    document.getElementById("P11_RECORD_COUNTS").value = document.getElementById ("numrowsGet") .value;
    }
    < /script >

    .. .THX

    Once the page is rendered, then you see the numrowsGet article and its value in the view source?

    Why not try this adding in the header of the region as

    Row Count: #TOTAL_ROWS#
    

    http://docs.Oracle.com/CD/E23903_01/doc/doc.41/e21674/ui_region.htm#HTMDB25572

  • How to check the index, on the number of columns in the table is created

    How to check on the number of columns in the table the index has been created. ??

    OR

    How check index, on the number of columns in the table that it is been created?

    890306 wrote:
    How to check on the number of columns in the table the index has been created. ??

    >

    OR

    How check index, on the number of columns in the table that it is been created?

    query USER_IND_COLUMNS

    SQL> desc user_ind_columns
     Name                            Null?    Type
     ----------------------------------------- -------- ----------------------------
     INDEX_NAME                             VARCHAR2(30)
     TABLE_NAME                             VARCHAR2(30)
     COLUMN_NAME                             VARCHAR2(4000)
     COLUMN_POSITION                        NUMBER
     COLUMN_LENGTH                             NUMBER
     CHAR_LENGTH                             NUMBER
     DESCEND                             VARCHAR2(4)
    

    Handle: 890306
    Status level: Beginner
    Join date: October 8, 2011
    Messages total: 13
    Total Questions: 5 (5 open)

    Why all the question still pending?

    Published by: sb92075 on December 3, 2011 17:21

  • How to find inserted last record in the table.

    Version: Oracle 10g

    I have a table called 'Manufacturing' and 3 columns as mfno, itemname, quantity.
    How to find inserted last record in the table 'manufacturing '.

    As I got to know that the Rowid is not a result perfect result. Please provide your inputs.

    user13416294 wrote:
    Version: Oracle 10g

    This is not a version. It's a product name. A version is 10.1.0.2 or 10.2.0.4, etc.

    I have a table called 'Manufacturing' and 3 columns as mfno, itemname, quantity.
    How to find inserted last record in the table 'manufacturing '.

    Not possible as your data model do not answer for him. As simple as that.

    If there is a need to determine an order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or several attributes are necessary to represent this information. Your data model in this case is therefore unable to meet your requirements.

    If the requirements are valid, set the data model. In other words - your question has nothing to do with Oracle and nothing to do with the other pseudo columns in Oracle, the rowscn or the rowid. It is a question of pure data modeling. Nothing more.

  • Create record in the Table of results gives error

    Hi all

    Update page there is a table of results with the Add button to create a new line.

    Everything by creating a new record on the table of results gives an error

    The attributes defined for AccessId in the view object xxlcupdvariablesvo1 failed

    I checked the EO and VO attributes, everything seems to be good.
    Updatable also has the value "Always".


    Still don't know why this error is coming.

    Please help resolve this error.


    Thank you
    SK

    SK

    Don't forget that your AO made correctly and you do your from VO of the two OS after this AO. If possible, allow Jdev to create your AO. Try to create is not in manuallly

    Hope it solves your problem

    Thank you
    AJ

  • Add new records to the table of the ADF

    Hello

    I use Jdev 11.1.1.3.0.
    I have a Page of the ADF with detail Table of form - master, I want to add new records to the table reflecting in DB. Is it possible to do? pointers or demo?


    Thank you
    MB

    What are the components are used in your table? When you created the table originally, you specified as a table read-only? If your table contains components of af: outputText, then you will need either manually change components entry way, or remove the table and re-drop-the-in the form of table (not read-only)

    John

  • Form check synchronize on Popup to the selected record from the table

    I'm trying to recreate what I did on the portals of the OAS in Weblogic/ADF. I have JDeveloper 11.1.1.2.0. What I do seems to be a little different than the tutorials: I need something like the tutorial master-detail, but instead the details appearing on the same page, it should appear in a popup. I managed to build the part table/popup. But when the popup appears, it displays the wrong record. Here are the steps I used to create this page:

    After you create the ADF Fusion Middleware project:

    1 create templates for the tables I need.
    2. create the JSF Page.
    3 drop panelCollection on the page.
    4. remove my data to see in panelCollection control and choose the Table read-only ADF. Select the sorting and selection options.
    5 change table properties: selected = DisplayRow, EditingMode = clickToEdit
    6 drag the Popup on the page.
    7. remove my data from view in popup control and choose the form of the ADF. Select the send option.
    8 drop showPopupBehavior on the page. Name of the popup. The value triggerType to the 'selection '. (triggerType "click" works, too)
    9 deploy.

    The table is displayed. I click on a line. The pop-up window appears. The form of popup displays the first record in the table. I click on any line.

    I just bought the merger Oracle 11g Developer Guide, but were not able to answer this question yet.

    Any ideas?

    Thank you.

    See this video for how it works for me:
    http://www.ScreenToaster.com/watch/stWUtcRkVLQ1BcSV1aX15Q

Maybe you are looking for

  • Satellite M40 - multimedia keys do not work.

    Hello The media bar on the left side of my keyboard stopped working from one moment to the other. Only the Web browser and work of CD/DVD keys, but keys Play/Pause, Stop, forward and Rewind do not work on Windows Media Player, as they did. Is there a

  • Satellite P200 - after the BIOS update I can't start the machine

    After the BIOS update I can't boot the laptop because the system doesn't recognize the relecommunicarions password. Before updating the password is 0000.After when I try to set the password incorrect password start apeeras

  • Satellite L640 needs 32 bit 64 bit no win 7

    Made mistake on the new installation, win7 64 bit installed on my new satellite L640 need 32 bit version but how to re install it, please, anyone

  • Do not charge the external battery ThinkPad T440

    Hello community, I use a T440 with WIN8.1 machine pro, but for some reason any external battery stopped charging. This laptop is only 3 months old Lenove send me a brand new, but the result was the same, the charging symbol appears on my screen when

  • Doubt about the matrix or table

    I need to write some values that I read from the serial port. But I need to increment the column automatically each new number. What happens is that each new issue, the last of them turns to zero and I lost the number. How can I store the last number