In-Memory-Undo in Oracle 10g-11g Ю.Пудовченко Открытые Технологии.

Презентация:



Advertisements
Похожие презентации
© 2005 Cisco Systems, Inc. All rights reserved.INTRO v Managing Your Network Environment Managing Cisco Devices.
Advertisements

© 2006 Cisco Systems, Inc. All rights reserved. CIPT1 v Administration of Cisco Unified CallManager Release 5.0 Configuring Cisco Unified CallManager.
© 2006 Cisco Systems, Inc. All rights reserved. BSCI v Configuring OSPF OSPF Route Summarization.
USB Download Manual (v1.3) (GP2 Year 2010) LG Electronics/ LCD TV Division Feb. 17 th, Applied Models & Notice - File Copy - User Download Mode.
Overview of the Paysonnel CE. Overview Paysonnel CE Go to URL- 1 Click [Login to Paysonnel CE] 2 How to Log-in to Paysonnel CE 1 2.
© 2006 Avaya Inc. All rights reserved. Using File Management and SD-Card Handling.
S15-1 PAT318, Section 15, March 2005 SECTION 15 MSC.PATRAN FILES.
© 2001, Cisco Systems, Inc. CSIDS Chapter 6 Alarm Management.
Understanding Record and Table Locking In OpenEdge ® SQL Applications Jeff Owen Principle Software Engineer, OESQL Progress Software Session 132.
AVVID Troubleshooting Tools © 2004 Cisco Systems, Inc. All rights reserved. Using Database Tools IPTT v
© 2006 Avaya Inc. All rights reserved. Embedded File Management and SD-Card Handling.
© 2009 Avaya Inc. All rights reserved.1 Chapter Two, Voic Pro Components Module Two – Actions, Variables & Conditions.
Using Actional with OpenEdge The Zen of Business Transaction Assurance David Cleary Principal Software Engineer – Progress Software Session 116.
© 2006 Cisco Systems, Inc. All rights reserved. CIPT1 v Deployment of Cisco Unified CallManager Release 5.0 Endpoints Configuring Cisco Unified CallManager.
Copyright ® 2000 MSC.Software Results S17-1 PAT301, Section 17, October 2003 SECTION 17 FILE MANAGEMENT.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Administering Events and Generating Reports Managing Events.
© 2006 Cisco Systems, Inc. All rights reserved.ISCW v IPsec VPNs Implementing the Cisco VPN Client.
© 2005 Cisco Systems, Inc. All rights reserved. IPTX v Configuring Additional Cisco CallManager Express Features Configuring Cisco CallManager Express.
Copyright 2003 CCNA 2 Chapter 18 Basic Router Troubleshooting By Your Name.
© 2009 Avaya Inc. All rights reserved.1 Chapter Seven, Customer Call Reporter (CCR) Module Two – Standard Configuration.
Транксрипт:

In-Memory-Undo in Oracle 10g-11g Ю.Пудовченко Открытые Технологии

Сведения об IMU отсутствуют в: Oracle Database 10R1g Documentation Oracle Database 11gR1 Documentation Oracle Database 11gR2 Documentation MyOracleSupport

Как это бывает: Bug Corrupt blocks in 11.2 in table with unique key. Applies to: Oracle Server - Enterprise Edition - Version: to Release: 11.2 to 11.2 Information in this document applies to any platform. Description: Block corruption during recovery for a table with Primary or Unique key constraint and lots of inserts done on that table due to Bug The recovery can happen as part of normal STARTUP during crash recovery.Bug Workaround or Resolution: In order to avoid this problem set parameter _in_memory_undo = FALSE (Disable IMU). To repair the existent corruption, the table may need to be recovered from a backup or use DBMS_REPAIR to skip the affected blocks. The redo being applied from the redo log is already corrupt meaning that regular media recovery does not fix the corruption.

Bug : CORRUPT BLOCKS DURING RECOVERY. ORA-600 [KDBLKCHECKERROR] WHEN CHECKING ENABLED Type: B – Defect Fixed in Product Version: 12.1 Severity1: Complete Loss of Service Product Version: Platform: IBM AIX on POWER Systems (64-bit) Created: 24-Feb-2010 Updated: 31-Mar-2010 Affects Platforms: Generic

ORA ORA-00474: SMON process terminated with error Instance terminated by PMON, pid = 2448 startup open IMODE=BR ILAT =363 Completed: ALTER DATABASE OPEN Doing block recovery for file 4 block Block recovery from logseq 20655, block to scn Recovery of Online Redo Log: Thread 1 Group 2 Seq Reading mem 0 Mem# 0: /oradata/redo02.log Block recovery completed at rba , scn Errors in file /oradata/admin/bdump/orcl_smon_25757.trc: ORA-00600: internal error code, arguments: [ktbair1], [4], [1], [], [], [], [], [] Errors in file /oradata/admin/bdump/orcl_pmon_25739.trc: ORA-00474: SMON process terminated with error PMON: terminating instance due to error 474 Instance terminated by PMON, pid = 25739

IMU В Shared Pool создается область для хранения информации отката Undo Pool по принципу «Один пул- одна транзакция». Место в сегменте отката резервируется, заголовок сегмента отката обновляется, но информация отката направляется в IMU pool. Польза: транзакция выполняется быстрее. Каждый пул защищается собственной защелкой «in memory undo» IMU pool = bytes IMU pool выделяются в порядке LRU _imu_pools = 10% от TRANSACTIONS

IMU Условия для работы IMU: compatibility >= undo_management= AUTO

Преимущества IMU Для IMU уменьшается редо. Несколько redo record записываются одной операцией I/O экономия в/в. уменьшение 'redo wastage'. Несколько обновлений одного UNDO-блока объединяются в одно изменение и записываются на диск одной операцией. IMU находится в памяти, поэтому consistent reads выполняемые другими сессиями завершаются быстрее. экономия ЦПУ

Особенности ITL в блоке данных стал указывать на IMU вместо _SYSSMU IMU enabled by default Starting ORACLE instance (normal) … IMODE=BR - Batched Redo Mode ILAT =27 - Number of IMU Pools/Latches … Starting up: Oracle Database 11g Enterprise Edition Release bit Production

Особенности (-) IMU не работает в RAC. т.е. как только CLUSTER_DATABASE=TRUE… Logminer can't handle all new structures in redologs yet + logical standby and streams Bug Corrupt blocks in 11.2 in table with unique key ORA-600 [kdblkcheckerror] [ID ]

8 параметров управляют IMU-ом _in_memory_undo = TRUE|FALSE - включает/отключает IMU, def.=TRUE. _imu_pools - Кол-во IMU-пулов PARAMETER 11.1 SESS_VALUE INST_VALUE _db_writer_flush_imu TRUE TRUE _recursive_imu_transactions FALSE FALSE _imu_pools 3 3 PARAMETER 11.2 SESS_VALUE INST_VALUE _db_writer_flush_imu TRUE TRUE _recursive_imu_transactions FALSE FALSE _imu_pools 3 3

8 параметров управляют IMU-ом PROCESSES - Чем больше это значение, тем больше пулов и IMU latches. Shalahamer: 8.25 processes/one IMU latch Haisley: 10%*Transactions Cогласно документации:Transactions=1.1*Sessions, Sessions=1.1*Processes+5 Следовательно: PROC=300 => (1,1*1,1*300+5)/10= 368

PROC TRAN ILAT Init/ILAT , transactions transactions 519 show parameter cpu cpu_count 4 parallel_threads_per_cpu 2 resource_manager_cpu_allocation 4

8 параметров управляют IMU-ом _recursive_imu_transactions – Использовать IMU для рекурсивных транзакций. The default is FALSE. _db_writer_flush_imu – «allows Oracle the freedom to artificially age a transaction for increased automatic cache management» def.=TRUE.

IMU Pools IMU Pools Функции для выделения/освобождения IMU в коде СУБД: ktiImuPoolAllocate ktiImuPoolFree ktiNonImuPoolAllocate ktiNonImuPoolFree ktiNonImuPoolLatchClean kti_disable_imu kti_enable_imu kti_is_imu ktiimu_chg ktiimu_f ktiredo_imupoolfree ktiundo_imupoolallocate

IMU-пулы можно видеть через представление X$ktifp. Размер каждого пула байт: SQL> select ktifpno,ktifppsi from x$ktifp; KTIFPNO KTIFPPSI KTIFPNO KTIFPPSI … KTIFPNO KTIFPPSI …

Транзакции обновляется заголовок undo-сегмента в undo-сегменте выделяется место под данный IMU-пул, физическая запись из IMU в блок UNDO- сегмента происходит несколько позже (при наступлении commit или flush - при заполнении пула до 100%). Эта запись производится одной операцией (batch) блоки, содержащие информацию отката X$BH.FLAG: 0x8002 (PRIVATE CURRENT)

Запись на диск Max changes exceeded (~100) Contention flushes (write induced) Bitmap state change flushes Rollback flushes Commit flushes Multi-block undo flushes (undo > blksize)

Запись на диск KTIFFCAT KTIFFFLC Undo pool overflow flushes

IMU Latches select name, gets, misses, immediate_gets IM, sleeps from v$latch_children where name like 'In%undo%' Instance Parameters GETS MISSES IM SLEEPS In-memory undo latch In-memory undo latch In-memory undo latch In-memory undo latch In-memory undo latch

IMU Locks select * from v$lock_type where type='IM' TYPE NAME ID1_TAG ID2_TAG IS_USER IM Kti blr lock pool # 0 NO DESCRIPTION Serializes block recovery for an IMU txn

Статистики SQL> select name from v$statname where name like 'IMU%'; IMU commits IMU Flushes IMU contention IMU recursive-transaction flush IMU undo retention flush IMU ktichg flush IMU bind flushes IMU mbu flush IMU pool not allocated IMU CR rollbacks IMU undo allocation size IMU Redo allocation size IMU- failed to get a private strand

IMU Commits select * from v$sysstat where name like '%commit%' STAT# NAME CLASS VALUE STAT_ID user commits IMU commits

Мониторинг SQL> select * from v$sgastat where name like 'KTI%'; 11.1 POOL NAME BYTES shared pool KTI latch structure 5760 shared pool KTI-UNDO shared pool KTI pool states 40 shared pool KTI latches KTI freelists 88

Выброшенное UNDO ConventionalThrow Away Undo REDO redo.log UNDO redo.log, undo.dbf REDO redo.log UNDO undo.dbf UNDO = DATA + REDO

Throw Away UNDO О его включении оповещает нас строки в alert.log: … IMODE=TUA

Events ORA Internal event for kti tracing ORA Internal event for IMU autotuning

Производительность Craig Shalahamer: Benefit: около 20% ЦПУ If you check v$sesstat, you will see the redo size is reduced. I did a test before, the redo size in v$sesstat of a single row update was reduced by 17% (the percentage depends on your DML).

Haisley Updates DB CPU DB Time IMU: 9% 19% TAU: 19% 39%

Haisley Redo Statistics Entries Защелка RAL IMU: 94% 77% TAU: 96% 79%

Haisley Redo Size IMU: 6,5% TAU: 57%

Литература Craig A. Shallahamer, All About Oracles In- Memory Undo Stephan Haisley, Center Of Expertise, Oracle Corporation