SlideShare uma empresa Scribd logo
1 de 9
Baixar para ler offline
18 Tips&techniques 
Franck Pachot, Senior Consultant, Trivadis S.A 
Can we actually achieve 
NOLOGGING? 
Do you know much redo is generated by your DML? 
Why do we still have lot of redo logging even when tables are NOLOGGING? 
Why do Global Temporary Tables still generate redo although no recovery 
is needed? 
I remember a long time ago, at the beginning of 
datawarehousing, when a customer asked me how to 
disable redo logging. I started to explain why it is 
mandatory: instance recovery, media recovery, etc. 
But they were reloading the whole datawarehouse 
each night from flat files. They didn't care about 
instance or media recovery as long as they still have 
those files. 
Redo logging is essential, providing ACID database pro-perties 
across failure, but you can't disable it (in any suppor-ted 
way) when you don't need it. 
But hopefully at that time Oracle 8 was coming with /*+ 
APPEND */ inserts, direct-path API, NOLOGGING tables, and 
with Global Temporary Tables. But even today, there is still 
some misunderstanding about those features, and we cur-rently 
have no way to totally bypass redo generation for a 
table, even for temporary modifications that do not need any 
recovery. 
I will show here which amount of redo we can expect in 
several cases, and how we will have to wait for 12c in order to 
find a way to generate no redo at all for DML. 
First, I create a simple table that will store 100 bytes 
rows. 
create table TEST_TABLE (a varchar2(24), b varchar2(24), c varchar2(24), d varchar2(24)); 
SOUG Newsletter 3/2013 
I’ll measure the following statistics (from v$mystat) across 
several data modification: 
■ redo entries aka redo records are the atomic unit of redo, 
including redo change vectors and undo change vectors 
■ redo size: the total amount of redo generated in bytes, 
including both redo and undo vectors 
■ undo vector size will help to estimate the undo part of 
the redo size 
■ db block changes because redo generation is usually 
involved in block changes 
The script used for that is available at: 
http://download.pachot.net/redosize.sql 
SMS Alternative Quellen 
Nebst den klassischen Portalen Google, Vimeo und YouTube gibt es eine Menge 
an Alternativen mit durchaus hochwertigem Material. Interessant, um sich über 
ein Thema ein diversifiziertes Bild machen zu können oder schlicht, um mal 
etwas anderes zu sehen/hören. 
Wie wäre es mit www.brighttalk.com, www.slideshare.net oder www.ted.org? 
Gerade Letzteres hilft beim Entwinden des Hirns mit anregenden Vorträgen, je 
nach Tagesform unterhaltend, zum Nachdenken oder Bedenken. Hinter dem 
hier gezeigten QR Code ist ein Video über einen Künstler aus der Kategorie 
«expert level: asian». Gute Unterhaltung!
Tips&ceehinqstu 19 
SOUG Newsletter 3/2013 
Insert 
So let's start to do a simple insert of 10000 rows that have 
an average size of 100 bytes (4 columns taking 25 bytes 
each): 
SQL> insert into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual 
connect by level <= 10000); 
10000 rows created. 
SQL> commit; 
Commit complete; 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
1,577 1,248,732 45,412 1,137 
I have inserted about 1MB of rows into empty blocks. So 
the undo vector size (that is used to get the previous image of 
the block) is minimal and the redo vector size (used to redo 
that insert) is roughly the size of our inserted rows: 1MB. 
I gather the statistics in order to check the size of the 
table. 
SQL> exec dbms_stats.gather_table_stats(user,'TEST_TABLE',estimate_percent=>100); 
PL/SQL procedure successfully completed. 
SQL> select table_name,blocks,num_rows,avg_row_len from user_tables where table_ 
name='TEST_TABLE'; 
TABLE_NAME BLOCKS NUM_ROWS AVG_ROW_LEN 
------------------------------------------- ---------- ----------- ----------- 
TEST_TABLE 244 10000 100 
That confirms that we have 10000 rows having 100 bytes 
each – total size of rows is 1MB. 
Delete 
Note that I've no index on my table yet. We will create 
them later, but for the moment I'm checking the redo related 
with the table block change only. I'll now delete all those 
rows. 
SQL> delete from TEST_TABLE; 
10000 rows deleted. 
SQL> commit; 
Commit complete; 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
20,726 3,658,740 2,039,300 10,442 
This is a lot more expensive than the insert because here 
we need to be able to rollback all those deleted rows. 
The delete is done row by row: For each of the 10000 rows 
we have a data block change and an undo block change, and 
both of those changes are logged in the redo. That includes 
not only the rows, but also the rowid and all block overhead 
(Interested Transaction List for example). 
Remember: the ‘redo size’ includes the ‘undo change 
vector size’. Both redo and undo information must be logged. 
The reason is that during instance recovery (when 
changes done in memory have been lost before being written 
to disk), the redo logs will be used to rollforward (redo) the 
committed transactions, and to rollback (undo) the uncom-mitted 
transactions. 
This (the Write-Ahead Logging) is common to most data-bases 
that provides ACID and is required for all modifications 
that are done in memory before they are written to disk.
20 Tips&techniques 
This is why a redo record has actually two change vectors: 
one to redo and one to undo. 
In Oracle, because the undo information is also stored in 
undo segments (in order to achieve consistent reads without 
locking), then that undo change vector in the redo stream is 
actually a redo change vector for the undo block writes. But 
even if the format is a bit different, the size is roughly the 
same. This is why I show the 'undo change vector' statistic in 
order to get the undo part of the redo size. 
So, deleting a large amount of rows is a very expensive 
operation. Lot of data block changes, lot of undo, and then lot 
of redo. 
Direct-path 
Now I'll insert my rows again, but with a direct-path in-sert, 
using the APPEND hint. 
SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select 
rpad(rownum,24,'x') x from dual connect by level <= 10000); 
10000 rows created. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
120 1,231,288 1,528 245 
I have a lot less block changes than with the conventional 
insert, and I have less redo records. But still the same redo 
size. The undo is still very low for inserts but we have again 
our 1MB rows in the redo logs. 
The direct-path inserts, as done with the APPEND hint, 
writes the table rows directly to the datafiles, bypassing the 
buffer cache, above the high water mark of the segment. 
Then we are not in the Write-Ahead Logging case and we 
don't need any redo vector. No problem if memory is lost 
because the changes were written directly to datafiles. There 
is just a minimal undo information in case we want to rollback 
our transaction: the insert happened above the high water 
mark so in order to rollback, we just have to lower back that 
high water mark (and that’s why Oracle prevents doing other 
modifications on the same table in the same transaction after 
a direct-path insert). 
But at that point you probably wonder why we see the 
same redo size as with conventional inserts. 
We don't need it for instance recovery, and if I were in 
NOARCHIVELOG mode, the redo size would have been mini-mal. 
But here, as in most of the databases, I'm in ARCHIVE-LOG 
mode, and I want to be able to do media recovery as 
well (in case I loose datafiles) – this is the ARCHIVELOG 
mode reason, and for that reason I need that redo informa-tion. 
SOUG Newsletter 3/2013
Tips&ceehinqstu 21 
SOUG Newsletter 3/2013 
NOLOGGING 
Direct-path inserts can lower redo generation only when 
we are in NOARCHIVELOG mode, or when the table is d­efined 
as NOLOGGING: 
SQL> alter table TEST_TABLE nologging; 
Table altered. 
SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select 
rpad(rownum,24,'x') x from dual connect by level <= 10000); 
10000 rows created. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
47 4,888 972 33 
The redo size is now minimal. But remember I have no 
indexes yet. 
In order to cover all cases, we must know that redo may 
be needed for another reason than media recovery. When we 
have a standby database, we need to propagate all changes 
and we often set FORCE LOGGING in order to generate redo 
even on a NOLOGGING table. 
To summarize, in order to generate less redo with direct-path 
inserts, we need to be in NOARCHIVELOG mode, or to 
have the table as NOLOGGING on a database that has 
FORCE LOGGING switched off. Then because we don't have 
media recovery, we can lose data (and not only the inserted 
one – all changes that occur later on those blocks as well) 
until the next backup. 
A quick not here to say that APPEND is a hint but NOLOG-GING 
is a table attribute – not a hint. I see sometimes some 
queries that had APPEND NOLOGGING as a hint. In that case 
NOLOGGING is ignored. It is not a valid hint (you can check 
v$sql_hint). 
And it can be worse: if you put it in the other order (such 
as NOLOGGING APPEND) then the APPEND hint is ignored 
as well because Oracle stops parsing hints when it encoun-ters 
a reserved word, and NOLOGGING is not a hint, but it is 
a reserved word… 
Truncate 
SQL> truncate table TEST_TABLE ; 
Table truncated. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
267 28,692 6,036 184 
Truncate table is the least expensive operation: it just do 
a High Water Mark move – minimal undo and redo. This is 
why a Materialized View refresh is a lot faster when it does 
not need to be atomic – using truncate instead of delete.
22 Tips&techniques 
Indexes 
The update statement has a previous value and a new 
value, so the undo and redo vector size depends on those 
updated columns. It adds the redo size of the insert and the 
undo size of the delete. 
But we will see it later because having a table without any 
index is not very realistic. 
SQL> alter table TEST_TABLE logging; 
Table altered. 
SQL> create index TEST_I1 on TEST_TABLE(a); 
Index created. 
SQL> create index TEST_I2 on TEST_TABLE(b); 
Index created. 
SQL> create index TEST_I3 on TEST_TABLE(c); 
Index created. 
SQL> create index TEST_I4 on TEST_TABLE(d); 
Index created. 
I came back to the same table and added 4 indexes: one on 
each column. So the total index size is about 1MB plus over-head 
(each index has its branch structure, a 6 bytes rowid for 
each entries…). 
And I'm doing the same operations as before: 
SQL> insert into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual 
connect by level <= 10000); 
10000 rows created. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
12,477 10,960,996 4,587,252 7,015 
SQL> delete from TEST_TABLE; 
10000 rows deleted. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
102,013 13,525,388 6,205,376 51,176 
SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select 
rpad(rownum,24,'x') x from dual connect by level <= 10000); 
10000 rows created. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
5,549 7,478,096 2 946,064 3,220 
Let's compare briefly the additional redo size: 
■ The conventional insert has a lot of undo vector (insert-ing 
index entries is usually done on existing leaves, and 
because the index was empty, we experience block 
splits). We have here 4MB of undo and total size of redo 
(including those undo) is 8x the amount we had without 
those 4 indexes. And you can do the same with bitmap 
indexes to see how it can be worse... 
■ The delete is has the same issue: index maintenance 
generating a lot of redo as well. 
■ The direct-path insert here makes a difference even in 
LOGGING mode. This is because the index maintenance 
is now made in bulk at the end, once the table is loaded, 
instead of row-by-row. 
SOUG Newsletter 3/2013
Tips&ceehinqstu 23 
SOUG Newsletter 3/2013 
Updates 
And now let's have a look at updates, our most redo 
consuming operation: 
SQL> update TEST_TABLE set a=upper(a),b=upper(b),c=upper(c),d=upper(d); 
10000 rows updated. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
182,939 26,253,392 10,509,956 91,229 
Because we have indexes on all columns, the redo gener-ated 
by the update is about the sum of redo we had for delete 
and insert. 
When updating an indexed column, there is one delete from 
the old index entry and one insert of the new index entry at its 
new place. Updating indexed columns is very expensive. 
Note that all the columns changed: they were lowercase and 
are now uppercase. 
But let's do the same update again: 
SQL> update TEST_TABLE set a=upper(a),b=upper(b),c=upper(c),d=upper(d); 
10000 rows updated. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
20,242 4,584,072 1,839,236 10,007 
This is much better. We have updated the columns to the 
same value. And less redo is generated. 
That seems useless of course, but some ORM are doing that 
kind of thing for consistency reason. 
Oracle still updates (and gener ate undo and redo) for the 
table changes. But it has bypassed all index maintenance as 
an optimization. SMS Oracle und Dell? 
Oracle und Dell arbeiten enger zusam-men. 
Nein, im Moment verkauft Oracle 
noch keine Dell Server. Dell Server und 
Oracle Produkte werden lediglich enger 
angepasst. So werden bald Oracle Li-nux, 
Oracle VM, Oracle Enterprise Ma-nager, 
Oracle DB und Weiteres besser 
an die Dell Spezialitäten und umgekehrt 
angepasst. Dies soll Ausrollen, Imple-mentation 
und Wartung vereinfachen. 
Wir sind gespannt, wie sich diese 
Partnerschaft auf die jeweiligen Pro-dukte 
auswirkt. DB Appliances von 
Dell? DELLADATA? Was gibt es wohl im 
SMS des Newsletters 2014/3 über die 
x64 Server zu berichten?
24 Tips&techniques 
Nologging 
SQL> truncate table TEST_TABLE; 
Table truncated. 
SQL> alter table TEST_TABLE nologging; 
Table altered. 
SQL> alter index TEST_I1 nologging; 
Index altered. 
SQL> alter index TEST_I2 nologging; 
Index altered. 
SQL> alter index TEST_I3 nologging; 
Index altered. 
SQL> alter index TEST_I4 nologging; 
Index altered. 
I’ll reproduce here the only test that makes a difference in 
NOLOGGING. Other statements have the same amount of 
redo. 
SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select 
rpad(rownum,24,'x') x from dual connect by level <= 10000); 
10000 rows created. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
5,492 6,279,156 2,944,460 3,051 
The redo for the data blocks is bypassed (the 1MB of 
inserted rows) but we still have a lot of redo for undo blocks and 
for index maintenance. Note that only the table NOLOG­G­ING 
attribute makes the difference here, index NOLOGGING has 
no consequence here. 
Row-by-row inserts 
Now, before we check how to generate less redo I will 
show a case where we generate even more redo: 
SQL> begin 
2 for r in (select rpad(rownum,24,'x') x from dual connect by level <= 10000) 
3 loop 
4 insert into TEST_TABLE values(r.x,r.x,r.x,r.x); 
5 end loop; 
6 commit; 
7 end; 
8 / 
PL/SQL procedure successfully completed. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
110,182 21,433,468 7,936,472 55,781 
Here we did row by row inserts. That generates more redo 
and undo than bulk inserts. 
And it can be even worse if we commit for each row because 
each commit generates a redo entry as well: 
SQL> begin 
2 for r in (select rpad(rownum,24,'x') x from dual connect by level <= 10000) 
3 loop 
4 insert into TEST_TABLE values(r.x,r.x,r.x,r.x); 
5 commit; 
6 end loop; 
7 end; 
8 / 
PL/SQL procedure successfully completed. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
130,184 26,731,644 9,232,800 66,262 
So the first thing to do if you generate too much redo 
when inserting a lot of data is to do it in bulk rather than row 
by row, and not to commit too often. It’s something that we 
know, but the facts are here: 4x more undo and redo. 
SOUG Newsletter 3/2013
Tips&ceehinqstu 25 
SOUG Newsletter 3/2013 
Rollback 
We have always committed. But what happens when we 
rollback? Oracle is not optimized at all for rollbacks: 
SQL> rollback; 
Rollback complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
180,009 16,041,988 0 90,009 
Yes, rollback generates redo because it changes the data 
blocks. Of course there is no undo generated: we have the 
same number of redo record as the operation that we rolled 
back, but they have only the redo vector. 
Global Temporary tables 
Because we know that redo is there for recovery reason, we 
can expect to lower the redo size when we use Global Tempo-rary 
Tables. They are not persistent across sessions, so they 
don’t need to be protected for instance recovery, nor media 
recovery, and don’t need to be shipped to standby databases. 
SQL> create global temporary table TEST_TABLE ( a varchar2(24), b varchar2(24) , c var-char2( 
24) , d varchar2(24) ) on commit preserve rows; 
Table created. 
SQL> create index TEST_I1 on TEST_TABLE(a); 
Index created. 
SQL> create index TEST_I2 on TEST_TABLE(b); 
Index created. 
SQL> create index TEST_I3 on TEST_TABLE(c); 
Index created. 
SQL> create index TEST_I4 on TEST_TABLE(d); 
Index created. 
SQL> insert into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual 
connect by level <= 10000); 
10000 rows created. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
13,934 5,066,176 4,597,048 4,296 
SQL> truncate table TEST_TABLE ; 
Table truncated. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- ---------------- 
3 844 80 3 
SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select 
rpad(rownum,24,'x') x from dual connect by level <= 10000); 
10000 rows created. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- --------------- 
5,626 3,171,820 2,969,784 1,654 
SQL> update TEST_TABLE set a=upper(a),b=upper(b),c=upper(c),d=upper(d); 
10000 rows updated. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- --------------- 
191,225 20,585,508 13,300,976 92,760 
SQL> delete from TEST_TABLE; 
10000 rows deleted. 
SQL> commit; 
Commit complete. 
db block changes redo size undo change vector size redo entries 
---------------- ---------------- ----------------------- --------------- 
103,401 10,226,180 6,276,376 50,691
26 Tips&techniques 
The undo size is the same as with the persistent table, 
because we must be able to rollback our changes on Global 
Temporary Tables as we do with other tables. But the redo 
size is smaller: it contains only the undo change vector. 
This is better, but unfortunately working on temporary 
tables still generates a big amount redo logs because of the 
undo. 
And there is no reason for that because we don’t need 
them for recovery. 
It’s an implementation drawback. Oracle generates the 
undo stream for the whole transaction (that may touch per-manent 
tables as well), and that undo goes to the persistent 
undo tablespace that is protected by redo. We need undo 
only to rollback our change: we don’t need it for consistent 
reads (other sessions do not see our data in the Global Tem-porary 
Table) and we don’t need them for recovery. 
12c 
All the redo generation we have seen here has not been 
improved from 8i to 11g. But at Oracle Open-World 2012 Tom 
Kyte has announced a new feature: Temporary Undo, where 
the undo related to Global Temporary Tables will be genera-ted 
in the temporary tablespace. The consequence is that no 
redo at all will be generated for any DML on GTT. 
However, even if it looks like a long waited enhancement, 
Oracle has introduced it for another reason. An Active Data 
Guard database has all its datafiles opened in read-only, and 
that includes the UNDO tablespace, but has read-write ac-cess 
to the tempfiles. That Temporary Undo feature will allow 
us to do DML on Global Temporary Tables when connected 
to an Active Dataguard standby database. 
However, if we can use that feature on a primary data-base, 
we will be able to do totally unlogged DML by doing all 
data manipulation on a GTT and then, if needed, make them 
persistent by a CREATE TABLE … NOLOGGING AS SELECT 
* FROM GTT. 
SOUG Newsletter 3/2013 
Summary 
Redo logging provides the Oracle strength you pay for: 
you don’t lose your modification in case of a failure. But 
unfortunately you can’t disable it when you don’t need. 
NOLOGG­ING 
attribute is not like the PostgreSQL UNLOGG­ED 
tables at all. 
NOLOGGING is very good for DDL (create table, build 
indexes) similar to the old Oracle 7 UNRECOVERABLE ope-rations. 
But it still generates a lot of redo for DML: large amount 
for updates, big amount as well for deletes (especially when 
having many indexes) and row-by-row inserts. Bulk inserts, 
especially direct-path ones, are more optimal and the latter is 
the only one that can benefit (a bit) from NOLOGGING. 
Only truncate is redo free. Global Temporary Tables will 
halve the redo size but still log the undo change vectors, at 
least until 12c where the Temporary Undo feature may be 
considered. 
The ways to optimize DML on large tables is to do things 
in bulk when possible (direct-path inserts, create table as 
select and truncate), to use Global Temporary Tables for 
changes that do not have to be persisted. 
And in all cases you must always be sure that the log wri-ter 
is not a bottleneck (no ‘log file sync’ wait events, redo logs 
on fast disks, and consider ‘commit write batch nowait’ for 
intermediate commits). ■ 
Contact 
Trivadis SA 
Franck Pachot 
E-Mail: 
franck.pachot@trivadis.com 
A nzeige 
Drive your life. 
Holen Sie sich das Oracle-Original. 
für Profis 
5% Rabatt beim einzigen Schweizer 
Oracle Approved Education Center! 
Digicomp Academy AG, Telefon 0844 844 822, www.digicomp.ch 
Zürich, Bern, Basel, St. Gallen, Luzern, Genève, Lausanne, Bellinzona

Mais conteúdo relacionado

Mais procurados

Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
BertrandDrouvot
 
twp-integrating-hadoop-data-with-or-130063
twp-integrating-hadoop-data-with-or-130063twp-integrating-hadoop-data-with-or-130063
twp-integrating-hadoop-data-with-or-130063
Madhusudan Anand
 
Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)
Chris Adkin
 
Building scalable application with sql server
Building scalable application with sql serverBuilding scalable application with sql server
Building scalable application with sql server
Chris Adkin
 
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and VisualizationWhitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
Kristofferson A
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008
paulguerin
 

Mais procurados (20)

Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013
 
Oracle: Binding versus caging
Oracle: Binding versus cagingOracle: Binding versus caging
Oracle: Binding versus caging
 
12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions
 
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
 
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
 
MySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMySQL innoDB split and merge pages
MySQL innoDB split and merge pages
 
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
 
An introduction to column store indexes and batch mode
An introduction to column store indexes and batch modeAn introduction to column store indexes and batch mode
An introduction to column store indexes and batch mode
 
twp-integrating-hadoop-data-with-or-130063
twp-integrating-hadoop-data-with-or-130063twp-integrating-hadoop-data-with-or-130063
twp-integrating-hadoop-data-with-or-130063
 
How to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollHow to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'roll
 
Hypertable Distilled by edydkim.github.com
Hypertable Distilled by edydkim.github.comHypertable Distilled by edydkim.github.com
Hypertable Distilled by edydkim.github.com
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major Features
 
Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)
 
Building scalable application with sql server
Building scalable application with sql serverBuilding scalable application with sql server
Building scalable application with sql server
 
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and VisualizationWhitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008
 
Sql sever engine batch mode and cpu architectures
Sql sever engine batch mode and cpu architecturesSql sever engine batch mode and cpu architectures
Sql sever engine batch mode and cpu architectures
 
Optimizer Hints
Optimizer HintsOptimizer Hints
Optimizer Hints
 
PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6
 
Scaling sql server 2014 parallel insert
Scaling sql server 2014 parallel insertScaling sql server 2014 parallel insert
Scaling sql server 2014 parallel insert
 

Destaque

รายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติมรายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติม
Theruangsit
 
รายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติมรายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติม
Theruangsit
 
รับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงาน
รับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงานรับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงาน
รับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงาน
somdetpittayakom school
 
Social Media at "Traditional" News Orgs
Social Media at "Traditional" News OrgsSocial Media at "Traditional" News Orgs
Social Media at "Traditional" News Orgs
Ryan Osborn
 
《氪周刊:互联网创业必读》(第58期).pdf
《氪周刊:互联网创业必读》(第58期).pdf《氪周刊:互联网创业必读》(第58期).pdf
《氪周刊:互联网创业必读》(第58期).pdf
Chada Chiu
 
รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.
รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.
รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.
somdetpittayakom school
 
《氪周刊:互联网创业必读》(第70期)
《氪周刊:互联网创业必读》(第70期)《氪周刊:互联网创业必读》(第70期)
《氪周刊:互联网创业必读》(第70期)
Chada Chiu
 
คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5
คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5
คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5
somdetpittayakom school
 
Sarah's Intro Presentation
Sarah's Intro PresentationSarah's Intro Presentation
Sarah's Intro Presentation
sarahashleyoso
 
Use of media
Use of mediaUse of media
Use of media
Diana
 
《氪周刊:互联网创业必读》(第62期).pdf
《氪周刊:互联网创业必读》(第62期).pdf《氪周刊:互联网创业必读》(第62期).pdf
《氪周刊:互联网创业必读》(第62期).pdf
Chada Chiu
 
Prez2010 Eng Kgy
Prez2010 Eng KgyPrez2010 Eng Kgy
Prez2010 Eng Kgy
asd
 
ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...
ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...
ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...
somdetpittayakom school
 

Destaque (20)

Media behavior: Towards the Transformation Society
Media behavior: Towards the Transformation SocietyMedia behavior: Towards the Transformation Society
Media behavior: Towards the Transformation Society
 
รายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติมรายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติม
 
รายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติมรายชื่อเด็กเพิ่มเติม
รายชื่อเด็กเพิ่มเติม
 
รับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงาน
รับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงานรับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงาน
รับสมัครครูผู้สอน คณิต สังคม พลศึกษา เจ้าหน้าที่สำนักงานและคนงาน
 
Social Media at "Traditional" News Orgs
Social Media at "Traditional" News OrgsSocial Media at "Traditional" News Orgs
Social Media at "Traditional" News Orgs
 
Bb
BbBb
Bb
 
Navigating the semantic web for publishers
Navigating the semantic web for publishersNavigating the semantic web for publishers
Navigating the semantic web for publishers
 
《氪周刊:互联网创业必读》(第58期).pdf
《氪周刊:互联网创业必读》(第58期).pdf《氪周刊:互联网创业必读》(第58期).pdf
《氪周刊:互联网创业必读》(第58期).pdf
 
รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.
รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.
รางวัลระดับเหรียญทอง ศิลปะ เข้าร่วมงานนิทรรศน์ศิลป์ ศิลปินน้อย สพฐ.
 
ประกาศผลสอบคัดเลือกเข้าเรียน ม.4 SMART Class ปีการศึกษา 2557
ประกาศผลสอบคัดเลือกเข้าเรียน ม.4 SMART Class ปีการศึกษา 2557ประกาศผลสอบคัดเลือกเข้าเรียน ม.4 SMART Class ปีการศึกษา 2557
ประกาศผลสอบคัดเลือกเข้าเรียน ม.4 SMART Class ปีการศึกษา 2557
 
《氪周刊:互联网创业必读》(第70期)
《氪周刊:互联网创业必读》(第70期)《氪周刊:互联网创业必读》(第70期)
《氪周刊:互联网创业必读》(第70期)
 
คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5
คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5
คำอธิบายรายวิชาและจุดประสงค์การเรียนรู้ ม.5
 
Sarah's Intro Presentation
Sarah's Intro PresentationSarah's Intro Presentation
Sarah's Intro Presentation
 
Use of media
Use of mediaUse of media
Use of media
 
《氪周刊:互联网创业必读》(第62期).pdf
《氪周刊:互联网创业必读》(第62期).pdf《氪周刊:互联网创业必读》(第62期).pdf
《氪周刊:互联网创业必读》(第62期).pdf
 
Pengantar prom kes diii kep
Pengantar prom kes diii kepPengantar prom kes diii kep
Pengantar prom kes diii kep
 
How To Write An Essay
How To Write An EssayHow To Write An Essay
How To Write An Essay
 
Prez2010 Eng Kgy
Prez2010 Eng KgyPrez2010 Eng Kgy
Prez2010 Eng Kgy
 
Accedo 2 v4 english
Accedo 2 v4 englishAccedo 2 v4 english
Accedo 2 v4 english
 
ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...
ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...
ประกาศโรงเรียนสมเด็จพิทยาคมรับสมัครลูกจ้างชั่วคราว ตำแหน่ง ครูผู้สอน เจ้าหน้า...
 

Semelhante a Oracle NOLOGGING

Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features"
Anar Godjaev
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008
paulguerin
 

Semelhante a Oracle NOLOGGING (20)

OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features"
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
 
MySQL 5.5
MySQL 5.5MySQL 5.5
MySQL 5.5
 
从 Oracle 合并到 my sql npr 实例分析
从 Oracle 合并到 my sql   npr 实例分析从 Oracle 合并到 my sql   npr 实例分析
从 Oracle 合并到 my sql npr 实例分析
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008
 
Oracle dba interview question
Oracle dba interview questionOracle dba interview question
Oracle dba interview question
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / Sharding
 
Debunking myths about_redo_ppt
Debunking myths about_redo_pptDebunking myths about_redo_ppt
Debunking myths about_redo_ppt
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
 
Db2 performance tuning for dummies
Db2 performance tuning for dummiesDb2 performance tuning for dummies
Db2 performance tuning for dummies
 
Database
DatabaseDatabase
Database
 
Performance improvements in PostgreSQL 9.5 and beyond
Performance improvements in PostgreSQL 9.5 and beyondPerformance improvements in PostgreSQL 9.5 and beyond
Performance improvements in PostgreSQL 9.5 and beyond
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 

Mais de Franck Pachot

Mais de Franck Pachot (8)

Meetup - YugabyteDB - Introduction and key features
Meetup - YugabyteDB - Introduction and key featuresMeetup - YugabyteDB - Introduction and key features
Meetup - YugabyteDB - Introduction and key features
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor format
 
19 features you will miss if you leave Oracle Database
19 features you will miss if you leave Oracle Database19 features you will miss if you leave Oracle Database
19 features you will miss if you leave Oracle Database
 
Oracle Database on Docker
Oracle Database on DockerOracle Database on Docker
Oracle Database on Docker
 
Les bases BI sont-elles différentes?
Les bases BI sont-elles différentes?Les bases BI sont-elles différentes?
Les bases BI sont-elles différentes?
 
Exadata X3 in action: Measuring Smart Scan efficiency with AWR
Exadata X3 in action:  Measuring Smart Scan efficiency with AWRExadata X3 in action:  Measuring Smart Scan efficiency with AWR
Exadata X3 in action: Measuring Smart Scan efficiency with AWR
 
Oracle table lock modes
Oracle table lock modesOracle table lock modes
Oracle table lock modes
 
Reading AWR or Statspack Report - Straight to the Goal
Reading AWR or Statspack Report - Straight to the GoalReading AWR or Statspack Report - Straight to the Goal
Reading AWR or Statspack Report - Straight to the Goal
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Oracle NOLOGGING

  • 1. 18 Tips&techniques Franck Pachot, Senior Consultant, Trivadis S.A Can we actually achieve NOLOGGING? Do you know much redo is generated by your DML? Why do we still have lot of redo logging even when tables are NOLOGGING? Why do Global Temporary Tables still generate redo although no recovery is needed? I remember a long time ago, at the beginning of datawarehousing, when a customer asked me how to disable redo logging. I started to explain why it is mandatory: instance recovery, media recovery, etc. But they were reloading the whole datawarehouse each night from flat files. They didn't care about instance or media recovery as long as they still have those files. Redo logging is essential, providing ACID database pro-perties across failure, but you can't disable it (in any suppor-ted way) when you don't need it. But hopefully at that time Oracle 8 was coming with /*+ APPEND */ inserts, direct-path API, NOLOGGING tables, and with Global Temporary Tables. But even today, there is still some misunderstanding about those features, and we cur-rently have no way to totally bypass redo generation for a table, even for temporary modifications that do not need any recovery. I will show here which amount of redo we can expect in several cases, and how we will have to wait for 12c in order to find a way to generate no redo at all for DML. First, I create a simple table that will store 100 bytes rows. create table TEST_TABLE (a varchar2(24), b varchar2(24), c varchar2(24), d varchar2(24)); SOUG Newsletter 3/2013 I’ll measure the following statistics (from v$mystat) across several data modification: ■ redo entries aka redo records are the atomic unit of redo, including redo change vectors and undo change vectors ■ redo size: the total amount of redo generated in bytes, including both redo and undo vectors ■ undo vector size will help to estimate the undo part of the redo size ■ db block changes because redo generation is usually involved in block changes The script used for that is available at: http://download.pachot.net/redosize.sql SMS Alternative Quellen Nebst den klassischen Portalen Google, Vimeo und YouTube gibt es eine Menge an Alternativen mit durchaus hochwertigem Material. Interessant, um sich über ein Thema ein diversifiziertes Bild machen zu können oder schlicht, um mal etwas anderes zu sehen/hören. Wie wäre es mit www.brighttalk.com, www.slideshare.net oder www.ted.org? Gerade Letzteres hilft beim Entwinden des Hirns mit anregenden Vorträgen, je nach Tagesform unterhaltend, zum Nachdenken oder Bedenken. Hinter dem hier gezeigten QR Code ist ein Video über einen Künstler aus der Kategorie «expert level: asian». Gute Unterhaltung!
  • 2. Tips&ceehinqstu 19 SOUG Newsletter 3/2013 Insert So let's start to do a simple insert of 10000 rows that have an average size of 100 bytes (4 columns taking 25 bytes each): SQL> insert into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. SQL> commit; Commit complete; db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 1,577 1,248,732 45,412 1,137 I have inserted about 1MB of rows into empty blocks. So the undo vector size (that is used to get the previous image of the block) is minimal and the redo vector size (used to redo that insert) is roughly the size of our inserted rows: 1MB. I gather the statistics in order to check the size of the table. SQL> exec dbms_stats.gather_table_stats(user,'TEST_TABLE',estimate_percent=>100); PL/SQL procedure successfully completed. SQL> select table_name,blocks,num_rows,avg_row_len from user_tables where table_ name='TEST_TABLE'; TABLE_NAME BLOCKS NUM_ROWS AVG_ROW_LEN ------------------------------------------- ---------- ----------- ----------- TEST_TABLE 244 10000 100 That confirms that we have 10000 rows having 100 bytes each – total size of rows is 1MB. Delete Note that I've no index on my table yet. We will create them later, but for the moment I'm checking the redo related with the table block change only. I'll now delete all those rows. SQL> delete from TEST_TABLE; 10000 rows deleted. SQL> commit; Commit complete; db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 20,726 3,658,740 2,039,300 10,442 This is a lot more expensive than the insert because here we need to be able to rollback all those deleted rows. The delete is done row by row: For each of the 10000 rows we have a data block change and an undo block change, and both of those changes are logged in the redo. That includes not only the rows, but also the rowid and all block overhead (Interested Transaction List for example). Remember: the ‘redo size’ includes the ‘undo change vector size’. Both redo and undo information must be logged. The reason is that during instance recovery (when changes done in memory have been lost before being written to disk), the redo logs will be used to rollforward (redo) the committed transactions, and to rollback (undo) the uncom-mitted transactions. This (the Write-Ahead Logging) is common to most data-bases that provides ACID and is required for all modifications that are done in memory before they are written to disk.
  • 3. 20 Tips&techniques This is why a redo record has actually two change vectors: one to redo and one to undo. In Oracle, because the undo information is also stored in undo segments (in order to achieve consistent reads without locking), then that undo change vector in the redo stream is actually a redo change vector for the undo block writes. But even if the format is a bit different, the size is roughly the same. This is why I show the 'undo change vector' statistic in order to get the undo part of the redo size. So, deleting a large amount of rows is a very expensive operation. Lot of data block changes, lot of undo, and then lot of redo. Direct-path Now I'll insert my rows again, but with a direct-path in-sert, using the APPEND hint. SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 120 1,231,288 1,528 245 I have a lot less block changes than with the conventional insert, and I have less redo records. But still the same redo size. The undo is still very low for inserts but we have again our 1MB rows in the redo logs. The direct-path inserts, as done with the APPEND hint, writes the table rows directly to the datafiles, bypassing the buffer cache, above the high water mark of the segment. Then we are not in the Write-Ahead Logging case and we don't need any redo vector. No problem if memory is lost because the changes were written directly to datafiles. There is just a minimal undo information in case we want to rollback our transaction: the insert happened above the high water mark so in order to rollback, we just have to lower back that high water mark (and that’s why Oracle prevents doing other modifications on the same table in the same transaction after a direct-path insert). But at that point you probably wonder why we see the same redo size as with conventional inserts. We don't need it for instance recovery, and if I were in NOARCHIVELOG mode, the redo size would have been mini-mal. But here, as in most of the databases, I'm in ARCHIVE-LOG mode, and I want to be able to do media recovery as well (in case I loose datafiles) – this is the ARCHIVELOG mode reason, and for that reason I need that redo informa-tion. SOUG Newsletter 3/2013
  • 4. Tips&ceehinqstu 21 SOUG Newsletter 3/2013 NOLOGGING Direct-path inserts can lower redo generation only when we are in NOARCHIVELOG mode, or when the table is d­efined as NOLOGGING: SQL> alter table TEST_TABLE nologging; Table altered. SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 47 4,888 972 33 The redo size is now minimal. But remember I have no indexes yet. In order to cover all cases, we must know that redo may be needed for another reason than media recovery. When we have a standby database, we need to propagate all changes and we often set FORCE LOGGING in order to generate redo even on a NOLOGGING table. To summarize, in order to generate less redo with direct-path inserts, we need to be in NOARCHIVELOG mode, or to have the table as NOLOGGING on a database that has FORCE LOGGING switched off. Then because we don't have media recovery, we can lose data (and not only the inserted one – all changes that occur later on those blocks as well) until the next backup. A quick not here to say that APPEND is a hint but NOLOG-GING is a table attribute – not a hint. I see sometimes some queries that had APPEND NOLOGGING as a hint. In that case NOLOGGING is ignored. It is not a valid hint (you can check v$sql_hint). And it can be worse: if you put it in the other order (such as NOLOGGING APPEND) then the APPEND hint is ignored as well because Oracle stops parsing hints when it encoun-ters a reserved word, and NOLOGGING is not a hint, but it is a reserved word… Truncate SQL> truncate table TEST_TABLE ; Table truncated. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 267 28,692 6,036 184 Truncate table is the least expensive operation: it just do a High Water Mark move – minimal undo and redo. This is why a Materialized View refresh is a lot faster when it does not need to be atomic – using truncate instead of delete.
  • 5. 22 Tips&techniques Indexes The update statement has a previous value and a new value, so the undo and redo vector size depends on those updated columns. It adds the redo size of the insert and the undo size of the delete. But we will see it later because having a table without any index is not very realistic. SQL> alter table TEST_TABLE logging; Table altered. SQL> create index TEST_I1 on TEST_TABLE(a); Index created. SQL> create index TEST_I2 on TEST_TABLE(b); Index created. SQL> create index TEST_I3 on TEST_TABLE(c); Index created. SQL> create index TEST_I4 on TEST_TABLE(d); Index created. I came back to the same table and added 4 indexes: one on each column. So the total index size is about 1MB plus over-head (each index has its branch structure, a 6 bytes rowid for each entries…). And I'm doing the same operations as before: SQL> insert into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 12,477 10,960,996 4,587,252 7,015 SQL> delete from TEST_TABLE; 10000 rows deleted. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 102,013 13,525,388 6,205,376 51,176 SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 5,549 7,478,096 2 946,064 3,220 Let's compare briefly the additional redo size: ■ The conventional insert has a lot of undo vector (insert-ing index entries is usually done on existing leaves, and because the index was empty, we experience block splits). We have here 4MB of undo and total size of redo (including those undo) is 8x the amount we had without those 4 indexes. And you can do the same with bitmap indexes to see how it can be worse... ■ The delete is has the same issue: index maintenance generating a lot of redo as well. ■ The direct-path insert here makes a difference even in LOGGING mode. This is because the index maintenance is now made in bulk at the end, once the table is loaded, instead of row-by-row. SOUG Newsletter 3/2013
  • 6. Tips&ceehinqstu 23 SOUG Newsletter 3/2013 Updates And now let's have a look at updates, our most redo consuming operation: SQL> update TEST_TABLE set a=upper(a),b=upper(b),c=upper(c),d=upper(d); 10000 rows updated. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 182,939 26,253,392 10,509,956 91,229 Because we have indexes on all columns, the redo gener-ated by the update is about the sum of redo we had for delete and insert. When updating an indexed column, there is one delete from the old index entry and one insert of the new index entry at its new place. Updating indexed columns is very expensive. Note that all the columns changed: they were lowercase and are now uppercase. But let's do the same update again: SQL> update TEST_TABLE set a=upper(a),b=upper(b),c=upper(c),d=upper(d); 10000 rows updated. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 20,242 4,584,072 1,839,236 10,007 This is much better. We have updated the columns to the same value. And less redo is generated. That seems useless of course, but some ORM are doing that kind of thing for consistency reason. Oracle still updates (and gener ate undo and redo) for the table changes. But it has bypassed all index maintenance as an optimization. SMS Oracle und Dell? Oracle und Dell arbeiten enger zusam-men. Nein, im Moment verkauft Oracle noch keine Dell Server. Dell Server und Oracle Produkte werden lediglich enger angepasst. So werden bald Oracle Li-nux, Oracle VM, Oracle Enterprise Ma-nager, Oracle DB und Weiteres besser an die Dell Spezialitäten und umgekehrt angepasst. Dies soll Ausrollen, Imple-mentation und Wartung vereinfachen. Wir sind gespannt, wie sich diese Partnerschaft auf die jeweiligen Pro-dukte auswirkt. DB Appliances von Dell? DELLADATA? Was gibt es wohl im SMS des Newsletters 2014/3 über die x64 Server zu berichten?
  • 7. 24 Tips&techniques Nologging SQL> truncate table TEST_TABLE; Table truncated. SQL> alter table TEST_TABLE nologging; Table altered. SQL> alter index TEST_I1 nologging; Index altered. SQL> alter index TEST_I2 nologging; Index altered. SQL> alter index TEST_I3 nologging; Index altered. SQL> alter index TEST_I4 nologging; Index altered. I’ll reproduce here the only test that makes a difference in NOLOGGING. Other statements have the same amount of redo. SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 5,492 6,279,156 2,944,460 3,051 The redo for the data blocks is bypassed (the 1MB of inserted rows) but we still have a lot of redo for undo blocks and for index maintenance. Note that only the table NOLOG­G­ING attribute makes the difference here, index NOLOGGING has no consequence here. Row-by-row inserts Now, before we check how to generate less redo I will show a case where we generate even more redo: SQL> begin 2 for r in (select rpad(rownum,24,'x') x from dual connect by level <= 10000) 3 loop 4 insert into TEST_TABLE values(r.x,r.x,r.x,r.x); 5 end loop; 6 commit; 7 end; 8 / PL/SQL procedure successfully completed. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 110,182 21,433,468 7,936,472 55,781 Here we did row by row inserts. That generates more redo and undo than bulk inserts. And it can be even worse if we commit for each row because each commit generates a redo entry as well: SQL> begin 2 for r in (select rpad(rownum,24,'x') x from dual connect by level <= 10000) 3 loop 4 insert into TEST_TABLE values(r.x,r.x,r.x,r.x); 5 commit; 6 end loop; 7 end; 8 / PL/SQL procedure successfully completed. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 130,184 26,731,644 9,232,800 66,262 So the first thing to do if you generate too much redo when inserting a lot of data is to do it in bulk rather than row by row, and not to commit too often. It’s something that we know, but the facts are here: 4x more undo and redo. SOUG Newsletter 3/2013
  • 8. Tips&ceehinqstu 25 SOUG Newsletter 3/2013 Rollback We have always committed. But what happens when we rollback? Oracle is not optimized at all for rollbacks: SQL> rollback; Rollback complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 180,009 16,041,988 0 90,009 Yes, rollback generates redo because it changes the data blocks. Of course there is no undo generated: we have the same number of redo record as the operation that we rolled back, but they have only the redo vector. Global Temporary tables Because we know that redo is there for recovery reason, we can expect to lower the redo size when we use Global Tempo-rary Tables. They are not persistent across sessions, so they don’t need to be protected for instance recovery, nor media recovery, and don’t need to be shipped to standby databases. SQL> create global temporary table TEST_TABLE ( a varchar2(24), b varchar2(24) , c var-char2( 24) , d varchar2(24) ) on commit preserve rows; Table created. SQL> create index TEST_I1 on TEST_TABLE(a); Index created. SQL> create index TEST_I2 on TEST_TABLE(b); Index created. SQL> create index TEST_I3 on TEST_TABLE(c); Index created. SQL> create index TEST_I4 on TEST_TABLE(d); Index created. SQL> insert into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 13,934 5,066,176 4,597,048 4,296 SQL> truncate table TEST_TABLE ; Table truncated. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- ---------------- 3 844 80 3 SQL> insert /*+ append */ into TEST_TABLE select x,x,x,x from (select rpad(rownum,24,'x') x from dual connect by level <= 10000); 10000 rows created. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- --------------- 5,626 3,171,820 2,969,784 1,654 SQL> update TEST_TABLE set a=upper(a),b=upper(b),c=upper(c),d=upper(d); 10000 rows updated. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- --------------- 191,225 20,585,508 13,300,976 92,760 SQL> delete from TEST_TABLE; 10000 rows deleted. SQL> commit; Commit complete. db block changes redo size undo change vector size redo entries ---------------- ---------------- ----------------------- --------------- 103,401 10,226,180 6,276,376 50,691
  • 9. 26 Tips&techniques The undo size is the same as with the persistent table, because we must be able to rollback our changes on Global Temporary Tables as we do with other tables. But the redo size is smaller: it contains only the undo change vector. This is better, but unfortunately working on temporary tables still generates a big amount redo logs because of the undo. And there is no reason for that because we don’t need them for recovery. It’s an implementation drawback. Oracle generates the undo stream for the whole transaction (that may touch per-manent tables as well), and that undo goes to the persistent undo tablespace that is protected by redo. We need undo only to rollback our change: we don’t need it for consistent reads (other sessions do not see our data in the Global Tem-porary Table) and we don’t need them for recovery. 12c All the redo generation we have seen here has not been improved from 8i to 11g. But at Oracle Open-World 2012 Tom Kyte has announced a new feature: Temporary Undo, where the undo related to Global Temporary Tables will be genera-ted in the temporary tablespace. The consequence is that no redo at all will be generated for any DML on GTT. However, even if it looks like a long waited enhancement, Oracle has introduced it for another reason. An Active Data Guard database has all its datafiles opened in read-only, and that includes the UNDO tablespace, but has read-write ac-cess to the tempfiles. That Temporary Undo feature will allow us to do DML on Global Temporary Tables when connected to an Active Dataguard standby database. However, if we can use that feature on a primary data-base, we will be able to do totally unlogged DML by doing all data manipulation on a GTT and then, if needed, make them persistent by a CREATE TABLE … NOLOGGING AS SELECT * FROM GTT. SOUG Newsletter 3/2013 Summary Redo logging provides the Oracle strength you pay for: you don’t lose your modification in case of a failure. But unfortunately you can’t disable it when you don’t need. NOLOGG­ING attribute is not like the PostgreSQL UNLOGG­ED tables at all. NOLOGGING is very good for DDL (create table, build indexes) similar to the old Oracle 7 UNRECOVERABLE ope-rations. But it still generates a lot of redo for DML: large amount for updates, big amount as well for deletes (especially when having many indexes) and row-by-row inserts. Bulk inserts, especially direct-path ones, are more optimal and the latter is the only one that can benefit (a bit) from NOLOGGING. Only truncate is redo free. Global Temporary Tables will halve the redo size but still log the undo change vectors, at least until 12c where the Temporary Undo feature may be considered. The ways to optimize DML on large tables is to do things in bulk when possible (direct-path inserts, create table as select and truncate), to use Global Temporary Tables for changes that do not have to be persisted. And in all cases you must always be sure that the log wri-ter is not a bottleneck (no ‘log file sync’ wait events, redo logs on fast disks, and consider ‘commit write batch nowait’ for intermediate commits). ■ Contact Trivadis SA Franck Pachot E-Mail: franck.pachot@trivadis.com A nzeige Drive your life. Holen Sie sich das Oracle-Original. für Profis 5% Rabatt beim einzigen Schweizer Oracle Approved Education Center! Digicomp Academy AG, Telefon 0844 844 822, www.digicomp.ch Zürich, Bern, Basel, St. Gallen, Luzern, Genève, Lausanne, Bellinzona