Скачать презентацию
Идет загрузка презентации. Пожалуйста, подождите
Презентация была опубликована 11 лет назад пользователемwww.ruoug.org
1 In-Memory-Undo in Oracle 10g-11g Ю.Пудовченко Открытые Технологии
2 Сведения об IMU отсутствуют в: Oracle Database 10R1g Documentation Oracle Database 11gR1 Documentation Oracle Database 11gR2 Documentation MyOracleSupport
4 Как это бывает: 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.
5 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
6 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
7 IMU В Shared Pool создается область для хранения информации отката Undo Pool по принципу «Один пул- одна транзакция». Место в сегменте отката резервируется, заголовок сегмента отката обновляется, но информация отката направляется в IMU pool. Польза: транзакция выполняется быстрее. Каждый пул защищается собственной защелкой «in memory undo» IMU pool = bytes IMU pool выделяются в порядке LRU _imu_pools = 10% от TRANSACTIONS
8 IMU Условия для работы IMU: compatibility >= undo_management= AUTO
9 Преимущества IMU Для IMU уменьшается редо. Несколько redo record записываются одной операцией I/O экономия в/в. уменьшение 'redo wastage'. Несколько обновлений одного UNDO-блока объединяются в одно изменение и записываются на диск одной операцией. IMU находится в памяти, поэтому consistent reads выполняемые другими сессиями завершаются быстрее. экономия ЦПУ
10 Особенности 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
11 Особенности (-) 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 ]
12 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
13 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
14 PROC TRAN ILAT Init/ILAT , transactions transactions 519 show parameter cpu cpu_count 4 parallel_threads_per_cpu 2 resource_manager_cpu_allocation 4
15 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.
16 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
17 IMU-пулы можно видеть через представление X$ktifp. Размер каждого пула байт: SQL> select ktifpno,ktifppsi from x$ktifp; KTIFPNO KTIFPPSI KTIFPNO KTIFPPSI … KTIFPNO KTIFPPSI …
18 Транзакции обновляется заголовок undo-сегмента в undo-сегменте выделяется место под данный IMU-пул, физическая запись из IMU в блок UNDO- сегмента происходит несколько позже (при наступлении commit или flush - при заполнении пула до 100%). Эта запись производится одной операцией (batch) блоки, содержащие информацию отката X$BH.FLAG: 0x8002 (PRIVATE CURRENT)
19 Запись на диск Max changes exceeded (~100) Contention flushes (write induced) Bitmap state change flushes Rollback flushes Commit flushes Multi-block undo flushes (undo > blksize)
20 Запись на диск KTIFFCAT KTIFFFLC Undo pool overflow flushes
21 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
22 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
23 Статистики 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
24 IMU Commits select * from v$sysstat where name like '%commit%' STAT# NAME CLASS VALUE STAT_ID user commits IMU commits
25 Мониторинг 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
26 Выброшенное UNDO ConventionalThrow Away Undo REDO redo.log UNDO redo.log, undo.dbf REDO redo.log UNDO undo.dbf UNDO = DATA + REDO
27 Throw Away UNDO О его включении оповещает нас строки в alert.log: … IMODE=TUA
28 Events ORA Internal event for kti tracing ORA Internal event for IMU autotuning
29 Производительность 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).
30 Haisley Updates DB CPU DB Time IMU: 9% 19% TAU: 19% 39%
31 Haisley Redo Statistics Entries Защелка RAL IMU: 94% 77% TAU: 96% 79%
32 Haisley Redo Size IMU: 6,5% TAU: 57%
33 Литература Craig A. Shallahamer, All About Oracles In- Memory Undo Stephan Haisley, Center Of Expertise, Oracle Corporation
Еще похожие презентации в нашем архиве:
© 2024 MyShared Inc.
All rights reserved.