메뉴 건너뛰기

Korea Oracle User Group

Tuning

초기 파라미터 튜닝으로 분류 합니다.

 

--

시작 배경은  UNDO 사이즈가 계속 늘어 나기만 하고 줄어 들지가 않고 있습니다.

물론 버그인지 확인하는데 시간이 걸렸고. 12cR2 까지 사용 하면서 지속적으로 나오고 있는 상태 입니다.

18c .. 19c..  여전히 나오지 않을까 싶네요. (아직 미확인 되었습니다. )

 

열심히 검색 결과 좋은 정보를 찾았고

오라클 온라인 지원 결과 버그라는것도 찾았네요.

 

AUM Common Analysis/Diagnostic Scripts (문서 ID 877613.1) -> 한글버전 :  AUM에서 사용되는 분석/진단 스크립트 (문서 ID 1532541.1)

스크립트도 있네요. ( 첨부파일 )

 

Script - Check Current Undo Configuration and Advise Recommended Setup (문서 ID 1579035.1)

스크립트도 있네요.(첨부 파일)

 

 

 

How To Rollback Alter System Set "_smu_debug_mode" = 33554432; Without restarting the database? (문서 ID 805698.1)

-------

 

In this Document

Goal

Solution

References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.3 and later

Oracle Database Exadata Cloud Machine - Version N/A and later

Oracle Cloud Infrastructure - Database Service - Version N/A and later

Oracle Database Cloud Exadata Service - Version N/A and later

Oracle Database Cloud Schema Service - Version N/A and later

Information in this document applies to any platform.

***Checked for relevance on 21-Jul-2017***

GOAL

Would like to know how to rollback/disable the _smu_debug_mode parameter: 

 

    SQL> alter system set "_smu_debug_mode" = 33554432;

 

dynamically without having to restart the database database.

 

What is the default value for "smu_debug_mode" ?

 

 

SOLUTION

Use the following command to set to unset the parameter:

 

    SQL>alter system set "_smu_debug_mode" = 0;

 

The default value of _smu_debug_mode is 0.

 

 

 

The V$UNDOSTAT view has still got updated in every 10 minutes from 12c (문서 ID 2314796.1)

--------

In this Document

Purpose

Questions and Answers

   

References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 12.1.0.1 to 12.2.0.1 [Release 12.1 to 12.2]

Oracle Database Cloud Schema Service - Version N/A and later

Oracle Database Exadata Cloud Machine - Version N/A and later

Oracle Cloud Infrastructure - Database Service - Version N/A and later

Oracle Database Cloud Exadata Service - Version N/A and later

Information in this document applies to any platform.

PURPOSE

 This article is intended to instruct the new action in 12c about V$UNDOSTAT view's updating.

 

QUESTIONS AND ANSWERS

 

Version from 10.2.0.1 to 11.2.0.4, when the parameter "_undo_autotune" has been set to FALSE, automatic undo tuning has been disabled, 

and the V$UNDOSTAT view is not getting updated every 10 minutes.

 

But from 12c, though the parameter "_undo_autotune" has been set to FALSE, the V$UNDOSTAT view can still get updated, 

of course the action that automatic undo tuning has been disabled remain the same with before.

 

 

The V$UNDOSTAT view is not getting updated in every 10 minutes. (문서 ID 1206365.1)

--------

In this Document

Symptoms

Cause

Solution

References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.4 [Release 10.2 to 11.2]

Oracle Database Cloud Schema Service - Version N/A and later

Oracle Database Exadata Cloud Machine - Version N/A and later

Oracle Cloud Infrastructure - Database Service - Version N/A and later

Oracle Database Backup Service - Version N/A and later

Information in this document applies to any platform.

SYMPTOMS

 

The V$UNDOSTAT view is not getting updated every 10 minutes.

 

SQL> select BEGIN_TIME,END_TIME, UNDOBLKS from v$undostat;

 

BEGIN_TIME END_TIME UNDOBLKS

-------------------- -------------------- ----------

21-aug-2010 03:48:44 07-sep-2010 11:02:14 75016989

 

Only a single record is seen as above.

 

CAUSE

The parameter "_undo_autotune" has been set to FALSE.

 

This has disabled automatic undo tuning.

 

SOLUTION

Set "_undo_autotune" parameter to TRUE:

 

SQL> alter system set "_undo_autotune"=true;

 

This disables the standard tracking of UNDO statistics in V$UNDOSTAT.  You can see only the one row of data as noted in this case.

 

 

 

REFERENCES

NOTE:420525.1 - Automatic Tuning of Undo_retention Causes Space Problems

NOTE:877613.1 - AUM Common Analysis/Diagnostic Scripts

NOTE:2314796.1 - The V$UNDOSTAT view has still got updated in every 10 minutes from 12c

 

블로그문서 : https://hemantoracledba.blogspot.com/2010/04/autotune-undo.html

 

_smu_debug_mode 설명

 

_smu_debug_mode = 33554432;

---------------

With this setting, v$undostat.tuned_undoretention is not calculated based on a percentage of the fixed size undo tablespace, 

instead v$undostat.tuned_undoretention is set to the maximum of {(maxquerylen secs + 300) and undo_retention specified in init.ora}

 

 

 
오라클 문의 할때 당시.. 아래 SQL문을 이용하여 STATUS 가 ACTIVE 인 쿼리를 찾아 보고 왜 ACTIVE 상태 인가를 추적 해 보았네요.
 -> 이것도 관심 있게 봐야지 의심을 할수 있더라고요.
 
select to_char(a.begin_time,'HH24:MI:SS') begin, to_char(a.end_time,'HH24:MI:SS') end,
a.maxquerylen max_q_len, a.maxqueryid max_q_id, a.tuned_undoretention tuned_ur,
substr(b.sql_text,1,3000) sql_text, b.SQL_ID,  s.SCHEMANAME, s.SID, s.STATUS, s.SQL_ID
from v$undostat a, v$sql b, v$session s
where a.maxqueryid = b.sql_id(+) ;
 
 
ordebug 이용하여 system dump도 떠 보고..
 
1) 세션 2개 정도만 샘플로 잡아서 해당 세션의 oracle server process의 pid 확인 (v$process.spid값)
 
2) 각 pid에 대해 trace
sqlplus / as sysdba
oradebug setospid <pid>
oradebug unlimit
oradebug event 10046 trace name context forever, level 12
oradebug dump errorstack 3
oradebug tracefile_name -- <<---------! trace file명 확인
-- 대략 10분 정도 대기
oradebug dump errorstack 3
oradebug event 10046 trace name context off
exit
 
3) db alert log 화일
 
4) systemstate dump
% sqlplus '/ as sysdba'
oradebug setmypid
oradebug unlimit
oradebug dump systemstate 266
-- 1분 정도 기다리셨다가 한번 더 뜹니다.
oradebug dump systemstate 266
-- 1분 정도 기다리셨다가 다시 한번 더 뜹니다.
oradebug dump systemstate 266
oradebug tracefile_name -- <<------! 트레이스 화일명 확인
exit
 

 

결론은 

 

Automatic Tuning of Undo_retention Causes Space Problems (문서 ID 420525.1)

Wrongly calculated MAXQUERYLEN Causing ORA-01555 or ORA-30036 Errors (Doc ID 2005931.1)

 

as per Bug 17925397 - MAXQUERYID,MAXQUERYLEN FROM V$UNDOSTAT INCORRECT

and Bug 19281884 : SELECT 1 FROM OBJ$ WHERE NAME='DBA_QUEUE_SCHEDULES' CONSUMES UNDO TABLESPACE:

[This section is not visible to customers.]

 

이 문서에 근거, _smu_debug_mode=33554432 를 제시, 그 대신에 _undo_autotune=false 만 적용하셔도 됩니다.

 

 

_smu_debug_mode는 undo segment 동작 방식에 대해 디버그를 위한, 특정 동작을 비활성화하거나 트리거링하는 스위치로서 작용하는

히든파라미터입니다.

 

그 값은 여러가지가 정의돼 있습니다.

0x0 (default값)

0x00000001 Generate debugging info when processing undo retention

0x00000002 Force DROP undo tablespace to skip retention check

...

0x20000000 for UndoBlock Opt Testing

** 내부 코드라 공개하지 못하는는것들도 이야기 해 주시네요. 

 

33554432 값의 위 정의된 값들의 특정조합입니다.

 

 

위의 둘중 하나를 설정 하라고 권고를 했으나.

버전이 올라가면 갈수록 

12cR2 이상에서는 

_smu_debug_mode=33554432  값은 제거 후  _undo_autotune=false 설정 권고 하는것으로 최종 변경 하시면 됩니다.

 

 

 

 

 

위로