Wednesday, April 16, 2008

Oracle 11g Advanced Compression – Is it Really Advanced for $10,000 per processor?

Note: This test was performed on a single CPU with 4 concurrent session. The same should be run on production with application
specific test case.

Please click on image below if the image is blur. Results and Analysis are based on following:



Only Tables were compressed in test case using 11g compression feature (compress for all operations)



Transactions Per Second Vs CPU Graph



Results:

1. Comparing Number of Rows with Size of Table before and after compression

a. CUSTOMERS : Inserted 381 records less after compression and table size went
up by 64 bytes

b. LOGON : Without compression 2167 more customers were able to login which
tells compression effects the scalability of system.

c. ORDERS & ORDER_ITEMS : Saved 1984 + 2112 = 4096 KB after compression but
at the same time it processed 1788 orders (6233 items ) less compared to that
of before compression. Overall savings looks good but in my test case avg row
length of orders table was 53 bytes and that of order_items was 30 bytes.
Why it may now work in production? Oracle 11g Advanced compression algorithm:
Oracle’s compression algorithm is based upon eliminating duplicate values in
each block. Avg Row length in production environment will be much higher compared to one in my test case.

Compression feature works best if row length in production is low enough and
repetitive data is loaded sequentially which is still possible in DSS but not OLTP. Unique inline LOB's (avg row length 3-4k) will hardly compress anything.


2. Tablespace Free Space

Overall space utilization went up with compression by 768 KB.


3. Performance

-With compression Total Transaction went down by 85945 - 83625 = 2320 in 45 mins.
-With compression number of logons went down by 2167. For companies counting revenues by transaction/hr this could mean loss of xxxx dollars in N hours.
-With compression Avg T/S went down.
-With compression Avg Wait/IO CPU went up.
-With compression Avg Response time (timings in milliseconds) went up.
-With compression Oracle uncompresses data in RAM which is very fast. This will

require additional RAM on servers where memory foot print shows uptrend.

Synopsis:

Oracle 11g compression feature is licensed separately at $10,000 per processor. Before recommending this feature to your client/company make sure you know your databases very well and how much % of compression you will gain after paying

$10,000 per processor.

"Oracle’s compression algorithm is based upon eliminating duplicate values in
EACH BLOCK." - $10,000 per processor?


In OLTP environment DBA's don't have control on how data will be inserted. In OLTP block size will be relatively small compared to that of DSS. So it will be difficult to guesstimate % of compression achived and $$ saved with overhead of performance.

If you are using RAM SAN (SSD) it might be worth using 11g compression feature. It will also be useful in a warehouse environment where data is loaded sorted by key columns to have more and more repetitive data in same block to achieve maximum compression.

Advanced compression can also be used to compress datapump dump files, compress archives for physical standby database, avoid duplication of LOB's etc.

Last but not least consider cost of SAN Vs 11g compression.




Friday, March 14, 2008

Internode/Intranode Parallelism in RAC

Case 1: Running Query in Serial Mode from Instance 1 - Unbounded

Parallel_max_servers = 5
Parallel_min_servers = 0

select sum(bytes),sum(blocks),sum(blocks/1024), sum(block_id/12) from xyz;

SUM(BYTES) SUM(BLOCKS) SUM(BLOCKS/1024) SUM(BLOCK_ID/12)
---------- ----------- ---------------- ----------------
1.4239E+12 173813760 169740 1.3930E+10

Elapsed: 00:01:00.86

Instance 1




Instance 2



Case 2: Running Query in Parallel mode (Degree 6) from Instance 1 - unbounded

Parallel_max_servers = 5
Parallel_min_servers = 0

select /*+ full(xyz) parallel(xyz,6) */ sum(bytes),sum(blocks),

sum(blocks/1024), sum(block_id/12) from xyz;

SUM(BYTES) SUM(BLOCKS) SUM(BLOCKS/1024) SUM(BLOCK_ID/12)
---------- ----------- ---------------- ----------------
1.4239E+12 173813760 169740 1.3930E+10

Elapsed: 00:01:02.82

oracle 20394 1 4 16:23 ? 00:00:02 ora_p000_sweety1
oracle 20400 1 4 16:23 ? 00:00:03 ora_p001_sweety1
oracle 20402 1 4 16:23 ? 00:00:02 ora_p002_sweety1

oracle 17248 1 3 16:23 ? 00:00:02 ora_p000_sweety2
oracle 17252 1 2 16:23 ? 00:00:02 ora_p001_sweety2
oracle 17259 1 3 16:23 ? 00:00:02 ora_p002_sweety2

Instance 1



Instance 2



Case 3: Running Query in Parallel (Degree 6) mode from Instance 1 - bounded

To restrict parallel processing to specific node, instance groups can be used.

SQL> select inst_id,name,value from gv$parameter where

name like '%instance%grou%';

INST_ID NAME VALUE
---------- ------------------------------ ------------------------------
1 instance_groups s1
1 parallel_instance_group
2 instance_groups s2
2 parallel_instance_group


SQL> select inst_id,name,value from gv$parameter where name

like '%instance%grou%';

INST_ID NAME VALUE
---------- ------------------------------ ------------------------------
1 instance_groups s1
1 parallel_instance_group
2 instance_groups s2
2 parallel_instance_group

SQL> alter session set parallel_instance_group='s1';

Session altered.

SQL> select /*+ full(xyz) parallel(xyz,8) */ sum(bytes),sum(blocks),

sum(blocks/1024), sum(block_id/12) from xyz;

SUM(BYTES) SUM(BLOCKS) SUM(BLOCKS/1024) SUM(BLOCK_ID/12)
---------- ----------- ---------------- ----------------
1.4239E+12 173813760 169740 1.3930E+10


oracle 32285 1 6 17:36 ? 00:00:02 ora_p000_sweety1
oracle 32293 1 6 17:36 ? 00:00:02 ora_p001_sweety1
oracle 32301 1 6 17:36 ? 00:00:02 ora_p002_sweety1
oracle 32304 1 6 17:36 ? 00:00:02 ora_p003_sweety1
oracle 32340 1 6 17:36 ? 00:00:02 ora_p004_sweety1

No parallel processes spawned on instance 2.

All the parallel workers run only on instance1 node.

Why only 5 servers and not 6? Remember parallel_max_servers
is set to 5.

Observation:


Running couple of sessions in parallel unbounded mode can slow down interconnect.
Similar test should be performed on production system before going for cross instance parallelism.

Test was performed using single session on:
2 Node Oracle 11g RAC
Enterprise Linux 5
NFS

Thursday, January 31, 2008

Formatting Oracle SYS audit files

Below is the script to format oracle SYS audit files and load report into database
using SQLLDR. It can be scheduled in cron every night to process OS audit files.

http://docs.google.com/Doc?id=dd5wm8kb_0n79dpkc6