DBAsupport.com Forums - Powered by vBulletin
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: remove duplicates data from a table

  1. #11
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    PHP Code:
    10:23:13 SQLget stat_info
      1  select a
    .nameb.value from v$statname av$mystat b
      2  where a
    .statistic# = b.statistic# and
      
    3*       lower(a.namelike '%redo size%' 
    10:23:28 SQL> /

    NAME                VALUE     
    ------------------------------     
    redo size           5541584     

    1 row selected
    .

    10:23:53 SQLdrop table t1 ;

    Table dropped.

    Now I create a table in LOGGING MODE.

    10:23:59 SQLcreate table t1 as select from dba_objects ;

    Table created.

    10:24:04 SQLget stat_info
      1  select a
    .nameb.value from v$statname av$mystat b
      2  where a
    .statistic# = b.statistic# and
      
    3*       lower(a.namelike '%redo size%' 
    10:24:08 SQL> /

    NAME                VALUE     
    ------------------------------     
    redo size           8280104     

    1 row selected
    .

    Oracle generated (8280104 5541584)= 2,738,520 bytes of redo

    10:24:09 SQLdrop table t1 ;

    Table dropped.

    10:24:15 SQLget stat_info
      1  select a
    .nameb.value from v$statname av$mystat b
      2  where a
    .statistic# = b.statistic# and
      
    3*       lower(a.namelike '%redo size%' 
    10:24:23 SQL> /

    NAME                VALUE     
    ------------------------------     
    redo size           8300836     

    1 row selected
    .

    10:24:24 SQLcreate table t1 nologging as select from dba_objects ;

    Table created.

    10:24:43 SQLget stat_info
      1  select a
    .nameb.value from v$statname av$mystat b
      2  where a
    .statistic# = b.statistic# and
      
    3*       lower(a.namelike '%redo size%' 
    10:24:47 SQL> /

    NAME                VALUE     
    ------------------------------     
    redo size           8341560     

    1 row selected
    .

    In NOLOGGING the redo size is reduced to (8341560 8300836 ) = 40,724 bytes.

    As 
    Slimdave saideven in NOLOGGING modeoracle generates minimum redo
    Tamil
    Last edited by tamilselvan; 02-10-2005 at 12:31 PM.

  2. #12
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    cheers guys for the info.

    Srini

  3. #13
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    This is v.timely - I've been hacking round the doc trying to bring all the implications of NOLOGGING together. Perhaps someone can help me with this:

    NOLOGGING will only avoid writing log entries for "bulk" operations: Direct Load to Table (SQL or SQL*Loader), CTAS, Move Table, Create Index, Rebuild Index, (plus some similar operations for partitions).

    So if an object has the NOLOGGING attribute, but only "normal" DML has executed against it (i.e. none of the above), all the entries exist in the log files to permit recovery.

    Can such an object be restored & recovered?
    Can Oracle know if there are changes for which the log entries are missing (none in this case)?
    What is the status of the object if restored & recovered? (e.g. is an index USABLE?)

  4. #14
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by tamilselvan
    In NOLOGGING the redo size is reduced to (8341560 - 8300836 ) = 40,724 bytes.
    As Slimdave said, even in NOLOGGING mode, oracle generates minimum redo.
    Is that due to logging on the Data Dictionary?

  5. #15
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Yes, Dapi.
    Do you live in US or Europe?

    Tamil

  6. #16
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by tamilselvan
    Yes, Dapi.
    Got it right!
    * warm glow *

    Do you live in US or Europe?
    That's Geneva, Switzerland (CH). I did once visit Geneva, Illinois (IL) so I though I ought to be specific!

    . . . . ahhh ummmmmm is NOLOGGING different in Europe ? . ? . ? . . . help mummmmmyyyyyyyy ! ! ! ! !

  7. #17
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    ... is NOLOGGING different in Europe ...
    Only in the environmental, forestry management sense.

    All index operations are logged, except for a create index in nologging mode (minimal logging there, blah blah).

    For bulk insert operations I believe that the minimal logging is associated mostly with extent management in the data dictionary. So the fact that additional extents were created, or the HWM was moved, gets logged, but the new contents do not.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  8. #18
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Thanks guys.

    Any comment on my questions about restore & recovery?
    PING -

  9. #19
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Originally posted by DaPi
    [B]So if an object has the NOLOGGING attribute, but only "normal" DML has executed against it (i.e. none of the above), all the entries exist in the log files to permit recovery.

    Can such an object be restored & recovered?
    yes, i don't think that there's a problem with that unless the object was actually created with the nologging option. Not sure what happens then ... I would imagine that the creation in nologging mode of a table would make it non-recoverable because even if no rows were initially inserted in it Oracle has no way of telling that.

    http://download-west.oracle.com/docs...gy.htm#1004784

    Can Oracle know if there are changes for which the log entries are missing (none in this case)?
    Except where the object is created as nologging, i believe it knows all. If a bulk insert occured in nologging mode then I believe that the redo log marks the affected blocks with a code to indicate that their contents are indeterminate.
    What is the status of the object if restored & recovered? (e.g. is an index USABLE?)
    I think it's marked as corrupt in some way. The recommendation is to take an incremental or full backup after nologging operations. I have a feeling that RMAN is preferred for this because it can backup just the affected blocks -- I'm no RMAN expert though.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  10. #20
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by slimdave
    The recommendation is to take an incremental or full backup after nologging operations. I have a feeling that RMAN is preferred for this because it can backup just the affected blocks . . .
    In fact this is the only reference to NOLOGGING I found in the 8i RMAN manual - which left me stuggling to see the big picture.

    Slim, Tamal, thanks v.much for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width