# Re: How to use dbms_shared_pool.purge for heap 6 only?

Date: Wed, 25 Nov 2009 07:12:25 +1100

Message-ID: <d282b3ab0911241212k1f3fb102mc9b61e3117ab7510_at_mail.gmail.com>

I guess the heaps are represented in a bitmask. This enables multiple mutually exclusive values to be represented in a single byte/word/whatever.

The '<<' means left shift. So 1 << 0 means binary 1 left shifted by 0 positions ( = 0x01) and 1 << 6 means 1 left shifted by 6 positions ( = 0x40). The '|' means they are logically OR'd. So 0x01 OR 0x40 = 0x41.

In other words, in binary

1 << 0 => 00000001 left shifted by 0 positions = 00000001
1 << 6 => 00000001 left shifted by 6 positions = 01000000

Now we OR the two values

00000001

OR 01000000

01000001

Or, in hex 0x41.

Hope this helps.

Steve

On Wed, Nov 25, 2009 at 6:59 AM, Allen, Brandon
<Brandon.Allen_at_oneneck.com> wrote:

*> Does anyone know how to purge just the plan (heap 6) out of the shared pool*

*> with dbms_shared_pool.purge?*

*>*

*>*

*>*

*> The documentation gives the following explanation for the heaps parameter,*

*> but I can’t figure out what it means:*

*>*

*>*

*>*

*> http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_shared_pool.htm#CHDCBEBB*

*>*

*>*

*>*

*> “Heaps to be purged. For example, if heap 0 and heap 6 are to be purged:*

*>*

*> 1<<0 | 1<<6 => hex 0x41 => decimal 65, so specify heaps =>65.Default is 1,*

*> that is, heap 0 which means the whole object would be purged”*

*>*

*>*

*>*

*> I understand that 0x41=65, but I don’t get this part: “1<<0 | 1<<6 => hex*

*> 0x41” – Can anyone translate that to English?*

*>*

*>*

*>*

*> I already checked MOS too and couldn’t find any better explanation there.*

*>*

*>*

*>*

*> Thanks,*

*>*

*> Brandon*

-- http://www.freelists.org/webpage/oracle-lReceived on Tue Nov 24 2009 - 14:12:25 CST