1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to find out the No.of rows in a tables got affected in a day?!

Discussion in 'SQL PL/SQL' started by Vicky, Jun 18, 2014.

  1. Vicky

    Vicky Forum Advisor

    Messages:
    261
    Likes Received:
    11
    Trophy Points:
    260
    Location:
    Chennai
    How to find out the No.of rows got inserted/deleted/updated/affected in a day?!

    Could you help me with the query to find the above thing/!
     
  2. rajenb

    rajenb Forum Expert

    Messages:
    361
    Likes Received:
    114
    Trophy Points:
    655
    Location:
    Mauritius
    Hi Vicky,

    This is not something you can get outright from the database if your environment hasn't been configured or programmed to keep track of such events.

    There are several ways to do it - the most popular ones being:
    - Enabling Audit Trail
    - Using Database triggers
    - Application specific means, like doing "soft deletes" (flagging a record as deleted instead of physically deleting it) + triggers

    You can Google around and find the details of all 3 methods.
     
  3. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
  4. Rajesh Sinha

    Rajesh Sinha Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Location:
    HYderabad
    Is it OLAP system. In OLAP System it is recommended to create 2 columns system_last_updated_date and system_last_updated_by_userid and those columns you can update by before insert /update triggers. That is way to identify incremental data in datawarehouse.