Welcome Guest ( Log In | Register )


 
 
 
 
 
 

 
 
Oracle 

Performance Tuning Reference poster
 
Oracle training in Linux 

commands
 
Oracle training Weblogic Book
 
Easy Oracle Jumpstart
 
Oracle training & performance tuning books
 
Burleson Consulting Remote DB Administration
 
 
 
Reply to this topicStart new topic
> Compressed table - drop unused column
kregan77
post Feb 9 2012, 05:36 PM
Post #1


Member
**

Group: Members
Posts: 29
Joined: 7-May 10
Member No.: 43,061



Does anyone know exactly what happens if you mark a column unused in a compressed table and then alter table drop unused columns? We had a customer do this and Oracle threw a -3113 (end of communication) error. They did a system restore before contacting us and blew away any evidence in alert logs/trace files. They did this on a 400GB compressed table.

My question is, when you drop an unused column off a compressed table, does it uncompress? Where does this uncompression occur? In the instances default tablespace? In the tablespace configured for the table?

Basically, we are wondering whether the error was due to poor error-handling of the system running out of space during decompression and trying to see if we can reproduce it.

This was on an 11.1.0.7 system.

Thanks for any info you can provide on how dropping unused columns on a compressed table actually works.
Go to the top of the page
 
+Quote Post
burleson
post Feb 9 2012, 07:17 PM
Post #2


Advanced Member
***

Group: Members
Posts: 11,490
Joined: 26-January 04
Member No.: 13



Hi Kregan,

>> when you drop an unused column off a compressed table, does it uncompress?

Good question!

Logic says, why bother?

Oracle is designed for high speed, it only "marks columns" in the dictionary.

************************************
>> Where does this uncompression occur?

In the data buffer. But bne aware, Oracle has several types of compression:

http://www.dba-oracle.com/oracle11g/sf_Ora...or_the_DBA.html

The docs say that all uncompress is done at page rretrieval time . . .

*************************************

>> exactly what happens if you mark a column unused in a compressed table and then alter table drop unused columns?

The column is "logically" removed from the data dictionary.

It still exists, until the table is reorged . . .

****************************************
>>

See MOSC Note:17613.1 "ORA-03113":

http://dba-oracle.com/m_ora_03113_end_of_f...ons_channel.htm


Your ORA-03113 likely will disappear as soon as the table is reorg'ed to physically remove the column (using dbms_redefinition).


--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post
kregan77
post Feb 10 2012, 09:58 AM
Post #3


Member
**

Group: Members
Posts: 29
Joined: 7-May 10
Member No.: 43,061



Thanks for your prompt reply Mr. Burleson.

Regarding your article on compression, I was a bit confused about what you said regarding decompression because early on in the article you state:

QUOTE
Please note that there is common misconception that 11g table compression decompresses data while reading and holds it in the uncompressed form in the cache. That is not quite correct since one of the salient features of the database compression is that we do not have to uncompress the data before reading it and the data stays in the compressed form even in the cache.


But then later you talk about decompression when blocks are read - so I'm a bit confused as to which is the case. I'm sure I'm missing something here.

Even if decompression does occur when blocks are read - how does this play into a "DROP UNUSED COLUMN" operation? What's still not clear to me is if decompression must occur when an unused column is dropped off of a table - I don't know if a physical read must occur when removing column data.

You say that decompression occurs within the "Data buffer" - I'm assuming this is the buffer cache in the SGA? This seems to imply that maybe what happened is when they dropped the unused column from a 400G compressed table, it exceeded the limits of their buffer cache and this scenario was not properly handled by the server process which keeled over resulting in the -3113.

Sure is frustrating they did a system restore without grabbing the alert logs/trace files first!! smile.gif

Thanks again for your help!


QUOTE (burleson @ Feb 9 2012, 08:17 PM) *
Hi Kregan,

>> when you drop an unused column off a compressed table, does it uncompress?

Good question!

Logic says, why bother?

Oracle is designed for high speed, it only "marks columns" in the dictionary.

************************************
>> Where does this uncompression occur?

In the data buffer. But bne aware, Oracle has several types of compression:

http://www.dba-oracle.com/oracle11g/sf_Ora...or_the_DBA.html

The docs say that all uncompress is done at page rretrieval time . . .

*************************************

>> exactly what happens if you mark a column unused in a compressed table and then alter table drop unused columns?

The column is "logically" removed from the data dictionary.

It still exists, until the table is reorged . . .

****************************************
>>

See MOSC Note:17613.1 "ORA-03113":

http://dba-oracle.com/m_ora_03113_end_of_f...ons_channel.htm


Your ORA-03113 likely will disappear as soon as the table is reorg'ed to physically remove the column (using dbms_redefinition).

Go to the top of the page
 
+Quote Post
burleson
post Feb 10 2012, 11:19 AM
Post #4


Advanced Member
***

Group: Members
Posts: 11,490
Joined: 26-January 04
Member No.: 13



Hi

>> I don't know if a physical read must occur when removing column data.

Logic dictates that Oracle must visit the block to do the row . . .

I'll bet this wuld not have happened if the DBA had flushed the data buffer after making this change!



*******************************************
Oracle has implemented one form or another of compression for years!

Back since Oracle8, I think . . .

They are all different, as the article notes, and you don't seem sure which you have . . . :

QUOTE
Simple index compression in Oracle 8i

<LI>
Table-level compression in Oracle9ir2 (create table mytab COMPRESS)

<LI>
LOB compression (utl_compress) in Oracle 10g

<LI>
Row-level compression in Oracle 11g, even for materialized views (create table mytab COMPRESS FOR ALL OPERATIONS; )

<LI>


<LI>

<LI>
******************************************
>> Sure is frustrating they did a system restore

Why is "they" Maybe I should be taljking directly to the DBA!


If they open nan SR on MOSC I would reproduce it on test, take a BBED dump of the condition and see if you hit a bug:




Good Luck!

Let me know if you can reproduce it.


My bet is that you hit a bug . . . .



--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post
kregan77
post Feb 10 2012, 11:35 AM
Post #5


Member
**

Group: Members
Posts: 29
Joined: 7-May 10
Member No.: 43,061



"They" is our customer - they are using our product which includes a "job" whose purpose is to drop unused columns off of tables. So, they did not directly issue the statement, they were just using our product to remove fields they have inactivated from a record type table. The application is a data warehouse type of application and the purpose of the unused approach is to allow them to schedule the actual storage removal to a time when they are not loading into the table (via direct path). So, unfortunately, the error occurred and they wiped out the evidence before contacting us.

I was attempting to reproduce the problem by creating a small tablespace and a compressed table and loading into the table until I was getting tablespace full errors, then I would mark a column unused and drop it. This was partly due to Oracle support mentioning something that sounded like the decompression occurred in the "default tablespace" which could have meant the table's defined tablespace or the instance default tablespace. I then also created a small temporary tablespace and retried the test - in both cases I didn't have a problem.

Now, I may try to see if I can shrink the buffer cache or the SGA and try again and see if I can reproduce it.

Thanks again for your help!
Go to the top of the page
 
+Quote Post
burleson
post Feb 10 2012, 12:51 PM
Post #6


Advanced Member
***

Group: Members
Posts: 11,490
Joined: 26-January 04
Member No.: 13



Hi Kregan,

>> they are using our product which includes a "job" whose purpose is to drop unused columns off of tables.

Aha! Change your job to flush the buffer pool afterwards.

http://www.dba-oracle.com/t_flush_buffer_cache.htm

And force them to try it in test and qa before doing it in prod!

****************************************************
>> So, unfortunately, the error occurred and they wiped out the evidence before contacting us.

Well, you can charge them to reproduce it!

Get a full backup from before, and replicate the whole shebang in your environment.

But like I said, this smells like a bug to me!

Have you checked the bugs database? http://support/oracle.com

>> Thanks again for your help!

Hopefully this is helping!

My company (Burleson Consulting) does the database-side for dozens of vendor products, ensuring best practices, &c . . .

If you want to rent an expert for a few hours, just call me at 800-766-1884 . . .

Let us know how this ends!


--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post
kregan77
post Feb 10 2012, 01:10 PM
Post #7


Member
**

Group: Members
Posts: 29
Joined: 7-May 10
Member No.: 43,061



I think the issue with reproducing it on their end is that it is a 400GB compressed table and therefore poses some challenges in replicating wink.gif

The buffer pool should be flushed after what? Do you mean flush it prior to the drop unused column statement to ensure we are maximizing it for this task?

We will have a hard time convincing them to try anything that might result in the crash since it caused them quite a bit of trouble since the table was left in a corrupted state after the failure. This is why they had to do a full system restore. These tables are being constantly loaded into and any delay can cause a lot of problems for them.

This is why we are trying to figure out how to reproduce it on our end.

QUOTE (burleson @ Feb 10 2012, 01:51 PM) *
Hi Kregan,

>> they are using our product which includes a "job" whose purpose is to drop unused columns off of tables.

Aha! Change your job to flush the buffer pool afterwards.

http://www.dba-oracle.com/t_flush_buffer_cache.htm

And force them to try it in test and qa before doing it in prod!

****************************************************
>> So, unfortunately, the error occurred and they wiped out the evidence before contacting us.

Well, you can charge them to reproduce it!

Get a full backup from before, and replicate the whole shebang in your environment.

But like I said, this smells like a bug to me!

Have you checked the bugs database? http://support/oracle.com

>> Thanks again for your help!

Hopefully this is helping!

My company (Burleson Consulting) does the database-side for dozens of vendor products, ensuring best practices, &c . . .

If you want to rent an expert for a few hours, just call me at 800-766-1884 . . .

Let us know how this ends!
Go to the top of the page
 
+Quote Post
burleson
post Feb 10 2012, 03:14 PM
Post #8


Advanced Member
***

Group: Members
Posts: 11,490
Joined: 26-January 04
Member No.: 13



Hi Kregan,

First, I would not have allowed a drop column during work time, even though Oracle allows it! I ALWAYS reorg and then bounce my systens after dropping a column . . . .

I'm just guesssing about flushung the buffer, but I could be wrong . . .

If I were you I would find a related bug on Oracle bugs database, and blame it on that . . .

http://www.bing.com/search?q=ora-03113+%22...mp;sp=-1&sk=


--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th September 2014 - 06:46 AM