偶遇Oracle 11g 的DBMS_TABCOMP_TEMP_UNCMP和DBMS_TABCOMP_TEMP_CMP


這兩天有個系統上線,剛好在晚上10點多的時候準備數據庫環境,結果發現當時數據庫很繁忙,日誌的生成量竟然比白天交易時間產生的日誌量還大。最開始還以爲是新上的系統起來以後在執行什麼操作呢,後來一看發現時SYS用戶在執行一些很耗時耗資源的操作,摘錄如下:

超級耗時的作業,可以看到這些SQL都是SYS用戶發起的,而且每個的執行時間都特別長:



再來看看這些SQL是什麼,已經他們的執行計劃,它在創建臨時表:

CREATE TABLE "ZFPT"DBMS_TABCOMP_TEMP_CMP organization heap TABLESPACE "ZFPT_CBLOB" compress FOR ALL operations nologging AS
SELECT * FROM "ZFPT".DBMS_TABCOMP_TEMP_UNCMP mytab

CREATE TABLE "ZFPT" DBMS_TABCOMP_TEMP_UNCMP TABLESPACE "ZFPT_CBLOB" nologging AS
SELECT
        /*+ FULL("ZFPT"."DBTSEND_LIST") */
        *
FROM "ZFPT"."DBTSEND_LIST" partition("P201208") sample block( 65.1) mytab


原來這些作業都是11g裏面自我診斷產生的,在MOS上可以找到一篇文章關於怎麼暫停ASA(Automatic Segment Advisor)的:


 

 

How to Stop Creating Table DBMS_TABCOMP_TEMP_UNCMP [ID 1326118.1]

轉到底部


修改時間:2012-5-16類型:PROBLEM狀態:PUBLISHED優先級:3

註釋 (0)

In this Document

Symptoms

 

Cause

 

Solution

 

References


Applies to:

Oracle Server -Enterprise Edition - Version 11.2.0.1 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.

Symptoms

After upgrading to11g, during running of the Automatic Segment Advisor, the tabledms_tabcomp_temp_uncmp is being created and is taking up lots of space.

Note: You may seeORA-1652 error: Unable to extend temp segment.

Cause

Solution

The followingsolutions are available:

  1. Apply one-off Patch 8896202 for unpublished Bug 8896202, if available.
  2. Apply 11.2.0.2 patchset where fix is included.
  3. Workaround: Disable the Automatic Segment Adviser, as this is what makes the call to the Compression Advisor in 11.2.  These steps can be found in the "Configuring the Automatic Segment Advisor" section of the Oracle Database Administrator's Guide 11g Release 2 (11.2).  Here is the excerpt from the guide:

Configuring theAutomatic Segment Advisor 
The Automatic Segment Advisor is an automated maintenance task. As such, youcan use Enterprise Manager or PL/SQL package procedure calls to modify when(and if) this task runs. You can also control the resources allotted to it bymodifying the appropriate resource plans. 

You can call PL/SQL package procedures to make these changes, but the easierway to is to use Enterprise Manager.

To configure the Automatic Segment Advisor task with Enterprise Manager: 

1. Log in to Enterprise Manager as user SYSTEM. 

2. On the Database Home page, under the Space Summary heading, click thenumeric link next to the label Segment Advisor Recommendations.  TheSegment Advisor Recommendations page appears. 

3. Under the Related Links heading, click the link entitled AutomatedMaintenance Tasks. The Automated Maintenance Tasks page appears. 

4. Click Configure. The Automated Maintenance Tasks Configuration page appears. 

5. To completely disable the Automatic Segment Advisor, under Task Settings,select Disabled next to the Segment Advisor label, and then click Apply.

 


【延伸閱讀】

Slow Logical apply, due to objects: DBMS_TABCOMP_TEMP_UNCMP OR DBMS_TABCOMP_TEMP_CMP [ID 1114000.1]

轉到底部


修改時間:2012-10-12類型:PROBLEM狀態:PUBLISHED優先級:3

註釋 (0)

In this Document

Symptoms

 

Cause

 

Solution

 

References


Applies to:

Oracle Server -Enterprise Edition - Version 11.2.0.1 to 11.2.0.1 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 12-OCT-2012***

Symptoms


Find the log apply is slow, and the objects involved are<schema_name>.DBMS_TABCOMP_TEMP_CMP and/or<shcmea_name>.DBMS_TABCOMP_TEMP_UNCMP

Cause


Two tables (DBMS_TABCOMP_TEMP_UNCMP & DBMS_TABCOMP_TEMP_CMP) could becreated because of a 11.2 new feature, Compression Advisory.

These two temporary tables  are created during the execution of package -DBMS_COMPRESSION, while doing the analyze of a table. They are created underthe same schema name.

These tables are used to determine the level of compression level can beachieved. 


Bug.9595358 SLOW LOGICAL STANDBY APPLY,APPLYING CHANGES TO DBMS_TABCOMP_TEMP_UNCMP 
This bug is fixed in 11.2.0.2 and should not occur in this release of DB.

Solution


Workaround:
========

Set up the following SKIP rules in the logical standby DB:

1. Stop SQL Apply:

SQL> ALTERDATABASE STOP LOGICAL STANDBY APPLY;



2. Register the SKIP rules:

SQL> EXECUTEDBMS_LOGSTDBY.SKIP('SCHEMA_DDL','%','DBMS_TABCOMP_TEMP_CMP');
SQL> EXECUTE DBMS_LOGSTDBY.SKIP('SCHEMA_DDL','%','DBMS_TABCOMP_TEMP_UNCMP');

SQL> EXECUTE DBMS_LOGSTDBY.SKIP('DML','%','DBMS_TABCOMP_TEMP_CMP');
SQL> EXECUTE DBMS_LOGSTDBY.SKIP('DML','%','DBMS_TABCOMP_TEMP_UNCMP');




3. Start SQL Apply:

SQL> ALTERDATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

 

 


 






發佈了91 篇原創文章 · 獲贊 2 · 訪問量 18萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章