티스토리 툴바


ORACLE/ADMIN2012/05/15 17:24




Automatic Tuning of Undo_retention Causes Space Problems [ID 420525.1]

--------------------------------------------------------------------------------
 
  수정 날짜 09-FEB-2011     유형 PROBLEM     상태 PUBLISHED  

In this Document
  Symptoms
  Cause
  Solution
  References

 

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

 

Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.3 - Release: 10.2 to 10.2
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 10.2.0.1 to 10.2.0.3 -- fixed by patchset 10.2.0.4 and no issues on this at 11g
Symptoms
You have verified that Note 413732.1 is not applicable and the problem is not a misunderstanding in the way EXPIRED/UNEXPIRED are used and reused over time.

Look for:

1.) System (Automatic) Managed Undo
undo_management=auto in init.ora file

2.) Fixed size undo tablespace
SQL> select autoextensible from dba_data_files where tablespace_name='<current_undo_tablespace >'

returns "No" for all the undo tablespace datafiles.

3.) The undo tablespace is already sized such that it always has more than enough space to store all the undo generated within the undo_retention time, and the in-use undo space never exceeds the undo tablespace warning alert threshold (see below for the query to show the thresholds).

4.) The tablespace threshold alerts recommend that the DBA add more space to the undo tablespace:

SQL> select creation_time, metric_value, message_type,reason, suggested_action from dba_outstanding_alerts where object_name='<current_undo_ts>';

returns a suggested action of: "Add space to the tablespace"

Or,

This recommendation has been reported in the past but the condition has now cleared:
SQL> select creation_time, metric_value, message_type, reason, suggested_action, resolution from dba_alert_history where object_name='<current_undo_ts>';

5.) The undo tablespace in-use space exceeded the warning alert threshold at some point in time:

To see the warning alert percentage threshold:

SQL> select object_type, object_name, warning_value, critical_value from dba_thresholds where object_type='TABLESPACE';

To see the (current) undo tablespace percent of space in-use:
SQL> select
((select (nvl(sum(bytes),0))
from dba_undo_extents
where tablespace_name='<current_undo_ts>'
and status in ('ACTIVE','UNEXPIRED')) *100) /
(select sum(bytes)
from dba_data_files
where tablespace_name='<current_undo_ts>')
"PCT_INUSE"
from dual;

Cause
This is due to Bug 5387030 that is fixed in 10.2.0.4 patchset of RDBMS server.

 

Solution
Apply the patch for the Bug 5387030. Check the Oracle Support Portal for patch availability for your platform and RDBMS version.

Workaround

There are 3 possible alternate workarounds (any one of these should resolve the problem of the alerts triggering unnecessarily):

1.) Set the autoextend and maxsize attribute of each datafile in the undo ts so it is autoextensible and its maxsize is equal to its current size so the undo tablespace now has the autoextend attribute but does not autoextend:

SQL> alter database datafile '<datafile_flename>'
autoextend on maxsize <current_size>;

With this setting, v$undostat.tuned_undoretention is not calculated based on a percentage of the undo tablespace size, instead v$undostat.tuned_undoretention is set to the maximum of (maxquerylen secs + 300) undo_retention specified in init.ora file.

2.) Set the following hidden parameter in init.ora file:
_smu_debug_mode=33554432

or

SQL> Alter system set "_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) undo_retention specified in init.ora file.

3.) Set the following hidden parameter in init.ora:
_undo_autotune = false

or

SQL> Alter system set "_undo_autotune" = false;

With this setting, v$undostat (and therefore v$undostat.tuned_undoretention) is not maintained and the undo_retention used is the one specified in init.ora file.   NOTE:  This means you loose all advantages in having automatic undo management and is not an ideal long term fix.

NOTE: Even with the patch fix installed, the autotuned retention can still grow under certain circumstances.  The fix attempts to throttle back how aggressive that autotuning will be.  Options 2 and 3 may be needed to get around this aggressive growth in some environments.


References
NOTE:413732.1 - Full UNDO Tablespace In 10gR2

 관련 자료

 

--------------------------------------------------------------------------------
제품
--------------------------------------------------------------------------------

•Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
키워드
--------------------------------------------------------------------------------
TABLESPACE; UNDO_MANAGEMENT; UNDO_RETENTION; UNDO TABLESPACE

 

저작자 표시 비영리
Posted by [PineTree]
ORACLE/ADMIN2012/05/11 11:07




● 개요

- 추가적인 리스너를 생성할 수 있다.
- 오라클 넷 서비스를 생성할 수 있다.
- connect-time failover를 구성할 수 있다.



● 오라클 넷 서비스(Oracle Net Services)
   ◎ 정의
       : 네트워크 connection을 가능하게 하는 소프트웨어

   ◎ 전체 구조도



   ◎ 리스너에 추가하는 법

       ○ telnet으로 추가
           - 리스너가 동작중인지 확인

OS] ps -ef|grep lsnr



           - linstener.ora가 있는 디렉토리로 이동 후 확인

OS] cd $ORACLE_HOME/network/admin
OS] ls


           - listener.ora의 내용을 확인

OS] vi listener.ora


           - 내용을 확인해보면 다음과 같다. 빨간색 부분을 추가한다.(띄어쓰기 안맞을 경우 에러 발생할 가능성이 있다.)

L1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora10gr2.gsedu.com)(PORT = 1521))
    )
  )
SID_LIST_L1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (GLOBAL_DBNAME = orcl)
    )
    (SID_DESC =
      (SID_NAME = ikdb)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (GLOBAL_DBNAME = ikdb)
    )
  )

L2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora10gr2.gsedu.com)(PORT = 1621))
    )
  )
SID_LIST_L2 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = jgh_db)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (GLOBAL_DBNAME = jgh_db)
    )
  )


           - 리스너를 start시킨다.
             기본은 1521 포트의 리스너가 start되지만 리스너를 명시해서 start, stop을 할 수 있다.

OS] lsnrctl start
OS] lsnrctl stop
OS] lsnrctl start L1
OS] lsnrctl start L2
OS] lsnrctl stop L1
OS] lsnrctl stop L2


           - lsnrctl 명령으로도 가능

OS] lsnrctl
LSNRCTL> start l1
LSNRCTL> start l2
LSNRCTL> service l1
LSNRCTL> service l2
LSNRCTL> status l1
LSNRCTL> status l2
LSNRCTL> set current l2           -- 디폴트 리스너를 바꿀 수 있다.



       ○ Oracle Net Manager로 추가

OS] netmgr



       ○ Oracle Configuration Assistant로 추가

OS] netca


       ○ EM으로 추가



 ※ Server에 기본 리스너외에 추가 리스너 등록

SQL> alter system set local_listener = a            -- 같은 machine내에 a리스트를 보고 등록
SQL> alter system set remote_listener =         -- 다른 machine의 리스너 등록


 

<tnsnames.ora>
=
(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.11)(PORT = 1621))
    (CONNECT_DATA =
         (SERVER = DEDICATED)
         (SID = orcl)
    )
)



※ RAC환경에서의 설정
    - SID는 중복 불가, SERVICE_NAME은 중복 가능

SERVER1 (192.168.0.10)
OS] vi initi1.ora
instance_name = i1
service_names = haha, hoho
remote_listener = .....


 

SERVER2 (192.168.0.11)
OS] vi initi2.ora
instance_name = i2
service_names = haha, hoho
remote_listener = .....


 

SERVER3 (192.168.0.12)
OS] vi initi3.ora
instance_name = i3
service_names = haha, hoho
remote_listener = .....


 

CLIENT
<tnsnames.ora>
sqlplus chris/chris@a                         -- a : connect identifier(=network alias, service alias)
a =
(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.11)(PORT = 1521))
    (CONNECT_DATA =
         (SERVER = DEDICATED)
         (SERVICE_NAME = haha)
    ) 
)
-- connect discriptor


- haha라는 서비스명으로 접속하므로 i1이 shutdown되어 있더라도 i2로 접속이 가능
  SID=i1으로 할 경우 문제가 생길 소지가 있음. SERVICE_NAME으로 하는 것이 좋음

※ instance name이 같은 서버가 있어도 도메인으로 식별 가능

instance1
instance_name = HRDB
db_domain = asia.com


 

instance2
instance_name = HRDB
db_domain = africa.com



※ Dedicated Server vs. Shared Server

  Dedicated Server
    - 하나의 유저에 하나의 서버 프로세스가 담당.
    - sserver process당 PGA가 생긴다.

    dedicate server로 접속시 client의 tnsnames.ora설정 파일

<tnsnames.ora>
shared =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.122.1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.122.1)(PORT = 1621))
      (LOAD_BALANCE = yes)
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )



  Shared Server
    - 일정 갯수의 서버 프로세스를 유저서버프로세스가 공유하는 형식
    - UGA(user session data, cursor state, sort data)가 SGA내에 생김(서버 프로세스가 공유하기 위해서)
    - 아래의 파일들을 설정해주어야 함

    shared server 접속시 client의 tnsnames.ora 설정 파일

<tnsnames.ora>
shared =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.122.1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.122.1)(PORT = 1621))
      (LOAD_BALANCE = yes)
    )
    (CONNECT_DATA =
      (SERVER = SHARED)
      (SERVICE_NAME = orcl)
    )
  )


      server의 파라미터 파일 설정

SQL> alter system set shared_servers = 2;                                             -- 서버프로세스를 2개
SQL> alter system set dispatchers = '(protocol=tsp)(dispatchers=3)';        -- 디스패쳐를 3개



기타참고사항

- JDBC 드라이버
    : Java Database Connectivity의 약자. 번역기. DBMS의 벤더들이 만든다.
      oracle net을 simmulate한 것
      사용시에 오라클의 버전에 맞게 사용할 것

- 리스너가 살아있는지 확인(서버가 살아있는지 확인하는 것은 아님)
   tnsping 172.16.122.106:1521/orcl

- name resolution
  : connect identifier(network alias, service alias)를 connect descriptor로 바꾸는 행위를 말한다.

- linux : oerr ora 12154 명령을 치면 에러에 대한 내용이 나옴.

- 오라클에서의 connection과 session
   - connection
      : communication path way
   - session
      : log in ~ log out

저작자 표시 비영리
Posted by [PineTree]
ORACLE/RAC2012/05/11 11:00




 

RAC 10g R2 patch.pdf

저작자 표시 비영리
Posted by [PineTree]
ORACLE/INSTALL2012/05/11 10:57




dbworks 에서 받은 파일입니다.

Oracle Silent Install Guide.pdf

저작자 표시 비영리
Posted by [PineTree]
ORACLE/ORACLE 11G2012/05/11 10:54




OTN펌
  • 목적 :
    Oracle 11g 부터 Alert.log 와 trace file 은 새로운 형식으로 생성이 되며, 이는 ADR (Automatic Diagnotic Repository) 에 생성이 된다.
    본 문서에서는 Database 에 심각한 에러가 발생한 경우, ADRCI 명령어를 이용하여 에러를 확인하고 관련된 alert.log 및 trace file 을 오라클 고객지원센터로 전송하는 방법에 대해서 설명한다.

  • IPS 사용법 :
    ORACLE 11g 는 problem (Database 에서 발생한 에러코드)과 incident (에러가 발생한 기록)에 관련된 trace file 들을 자동으로 수집해주는 기능을 제공한다.
    이 기능을 IPS (Incident Packaging Service) 라고 하며, 인터페이스로 GUI 환경과 ADRCI command 를 제공한다.
    Database 에 발생한 모든 심각한 에러들은 각각의 incident 를 생성한다.
    IPS 를 통해서 생성된 압축 파일은 에러에 대한 alert.log file, 모든 trace file 과 진단 정보를 포함하고 있기 때문에, 해당 error 에 대한 정보수집을 간편히 수행할 수 있다.

    Database 의 에러 확인 및 관련 file을 오라클 고객지원센터로 전송하는 방법 :

    1. Database 에서 발생한 심각한 에러 발생

    SQL> select * from atab;
    select * from atab
    *
    ERROR at line 1:
    ORA-01578: ORACLE data block corrupted (file # 6, block # 11)
    ORA-01110: data file 6: '/opt/oracle/oradata/db11g/tt.dbf'

    2. ADR과 Alert.log 에서 에러를 확인한다.

    ADR에서 에러를 확인하기 위하여 11g 환경의 OS prompt에서 adrci를 실행한다.

    %] adrci

    ADR 홈 경로를 확인한다.

    adrci> show home
    --> 모든 ADR HOME 을 보여준다. 확인하고자 하는 ADR HOME 을 지정한다.

    adrci> set homepath <ADR HOME>

    에러 코드를 problem 이라고 하며, 이를 확인하기 위해서 다음을 실행한다.

    adrci> show problem

    ADR Home = /opt/oracle/diag/rdbms/db11g/db11g:
    *************************************************************************
    PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    1 ORA 1578 18104 2009-06-01 22:06:19.501207 +10:00
    1 rows fetched

    Database 에 문제가 되고 있는 에러 코드를 확인할 수 있다.
    이 중, 분석이 필요한 에러코드에 대하여 압축파일을 생성할 수 있다.

    3. 분석이 필요한 에러의 발생 기록을 확인한다.

    에러의 발생 기록들은 Incident 라고 하며, 모든 incident 는 Alert.log 에 기록된다.
    각각의 incident 는 유일한 incident ID 를 가진다.

    ADR 에서 'show incident' 명령을 수행하여 에러 발생 기록을 확인할 수가 있으며,
    에러에 대한 problem key를 확인하기 위해서는 'show problem' 을 수행한다.

    adrci> show incident -p "problem_key='ORA 1578'"

    ADR Home = /opt/oracle/diag/rdbms/db11g/db11g:
    *************************************************************************
    INCIDENT_ID PROBLEM_KEY CREATE_TIME
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    18147 ORA 1578 2009-06-01 22:02:08.805002 +10:00

    동일한 problem에 대한 incidnet는 여러 건이 발생할 수 있다.

    4. IPS (incident packaging service) 를 수행하여 alert.log , trace file 및 diag 정보에 대한 압축 파일 생성.

    압축 파일을 생성하기 위해서는 특정 경로를 포함한 'IPS pack' 명령을 사용한다.
    다음의 예는 incident 관련 file들을 /tmp directory 에 압축 파일로 생성하는 방법이다.

    adrci> ips pack incident 18147 in /tmp
    Generated package 9 in file /tmp/ORA1578_20090602113045_COM_1.zip, mode complete

    IPS pack 의 예제)

    ips pack problem 100 in /tmp
    -- problem id 100 에 관련된 trace file 들을 /tmp directory 에 압축파일로 생성한다.

    ips pack incident 6439 in /tmp
    -- incident id 6439 에 관련된 trace file 들을 /tmp directory 에 압축파일로 생성한다.

    ips pack problemkey "ORA 1578"
    -- problem_key 'ORA 1578' 를 가지는 모든 problem 에 관련된 trace file 들을 현재 directory 에 압축파일로 생성한다.

    ips pack seconds 8
    -- 최근 8 초 이내에 발생한 incident 에 대한 압축 파일을 생성한다.

    ips pack time '2007-05-01 10:00:00.00' to '2007-05-01 23:00:00.00'
    -- 특정 시간대의 incident 에 대한 압축파일을 생성한다.

    'IPS pack' 명령은 'IPC create' 와 'IPS generage' 명령을 일괄적으로 수행할 수 있는 명령이다.

    이와 같이 생성된 압축 파일을 SR (service request)을 통해 오라클 고객지원센터로 전송하면 된다.

    동영상 참조 :
    IPS package 를 생성하는 방법 (동영상 자료 02:30)
    (My Oracle Support 접속 필요)

    참고자료 :
    DOC ID : 443529.1
    11g Quick Steps to Package and Send Critical Error Diagnostic Information to Support (Video)

    DOC ID: 738732.1
    ADR Different Methods to Create IPS Package

  •  
     

    추가적으로 trace file정리시

    adrci>purge -age 30

    하면 됩니다.

     

    저작자 표시 비영리

    'ORACLE > ORACLE 11G' 카테고리의 다른 글

    11g 데이타베이스 에러수집방법  (0) 2012/05/11
    기준선 및 개선된 계획  (0) 2009/08/25
    Oracle Advanced Compression  (0) 2009/04/02
    Posted by [PineTree]
    TAG 11g, oracle, trace