Session: DB2 9.7 Luis Reina IBM 14/10/2009 1
Agenda Compresión de Datos Lob Inlining Tablespace: High Water Mark Indices Locales en Particionamiento por Rango. Movimiento de Tablas Online y Tablespaces Transportables. HADR: Lecturas en Servidor el Secundario Compatibilidad con Oracle Mejoras en DPF 2
Session DB2 9.7 Compresión de Datos 3
La Mejor Compresión de la Industria Multiples algoritmos para compresión automática de Indices. Unico en la Industria Compresión automática para Tablas Temporales. Table Temp Table Order By Order By Temp Unico en la Industria Compresión de Large Objects (lobs) y XML. 4
RID List Compression In an uncompressed index, DB2 stores the following RIDs: <00 00 00 04, 00 00>, <00 00 00 04, 00 01>, <00 00 00 04, 00 02>, <00 00 00 04, 00 03>, <00 00 00 04, 00 04>, <00 00 00 04, 00 05> <00 00 00 04, 00 06>, <00 00 00 04, 00 07>, <00 00 00 04, 00 08> <00 00 00 04, 00 09> In a compressed index, DB2 will compress the RID list <00 00 00 04, 00 00>, <1>, <1>, <1>, <1>, <1>, <1>, <1>, <1>, <1> Delta s are stored where appropriate can use one byte instead of 6 5
Prefix Compression If we have the following keys in an uncompressed index ( a, a, a ), ( a, a, b ), ( a, a, c ), ( b, b, b ), ( b, b, c ) DB2 Cobra we will keep only ( a, a, a ), (,, b ), (,, c ), ( b, b, b ) (,, c ) 6
Compresión XML 7 7
SunTrust ahorra $2M gracias a la Compresion We're seeing compression rates up to 83% on the data warehouse tables. The projected cost savings are more than $2million initially with ongoing savings of $500,000 a year Michael Henson, SunTrust Bank, Inc. Baje el costo de almacenamiento Ahorre 30% en costos de almacenamiento comparado con Oracle Database. Mejore el rendimiento Incremente las tasas de sus buffer pool y reduzca el I/O. Acelere sus copias de seguridad Menos almacenamiento resulta en backup/restores más rápidos. 1.5 Times Better 3.3 Times Better 2.0 Times Better 8.7 Times Better DB2 9 Other 8
Mejora en la Replicación de Datos DB2 V9.5 with ifilteroption ON Log db2readlog API DB2 V9.7 with ifilteroption ON Log db2readlog API Dictionary Compressed user data in logs Uncompressed user data in logs 9
Session DB2 9.7 LOB Inlining 10
Large Objects (LOB) Inlining En vez de de almacenar los datos LOB en el almacenamiento externo de LOBs, si su tamaño lo permite, se pueden almacenar dentro de la página de DB2 junto con el resto de campos. - El máximo tamaño de un LOB para poder ser inlining es de 32 669 bytes. - LOB inlinling es análogo al XML inlining introducido en DB2 9.5. Ejemplo: create table mytab1 (a int, b char(5), c clob inline length 1000) Base table, mytab1 LOB storage object a b 3 cat 9 dog 27 rat c aaaaaaaaaaa cccccccccccc bbbbbbbbbbbb 11
Ejemplo de LOB Inlining Total physical storage (K B s) 70000 60000 50000 40000 30000 20000 10000 0 V9.5 V9.5 (compression) Cobra (LOB inlining) Cobra (LOB inlining and compression) Base table (KBs) LOB storage (KBs) Indexes (KBs) V9.5 24320 30336 10880 V9.5 (compression) 5248 30336 10752 Cobra (LOB inlining) 22144 128 10880 Cobra (LOB inlining, compression) 4736 128 10752 All LOBs in this table are smaller than the default inline length for the LOB columns 100% of the LOBs for this table, inlined in Cobra! Total (KBs) 65536 46336 33152 15616 12
Session DB2 9.7 Tablespace: High Water Mark 13
Reduce Command in DB2 9.5 Shrinks an automatic storage tablespace to give space back to the OS Will reduce the high water mark of the tablespace and shrink the tablespace to the new high water mark ALTER TABLESPACE ts_name REDUCE T1 T2 T3 T4 T5 Tablespace HWM 14
Reduce Command in DB2 9.5 If there is freespace below the highwater mark which is held up by a real table, can t give that storage back to the OS T1 T2 T3 T4 T5 Tablespace HWM 15
Reduce Command in DB2 9.7 Shrinks an automatic storage tablespace to give space back to the OS Will reduce the high water mark of the tablespace and shrink the tablespace to the new high water mark ALTER TABLESPACE ts_name REDUCE T1 T2 T3 T5 Tablespace HWM 16
Session DB2 9.7 Indices Locales en Particionamiento por Rango 17
Rolling Window= Roll Out + Roll In Reorganizar particiones de forma fácil según las necesidades del negocio. Quitar de forma rápida particiones para archivado de datos o eliminación. Rapido Roll In y Roll Out de los datos Roll in: Añadir nueva partición. Roll out: Quitar partición existente. 18
Roll Out: Quitar una Partición de Datos Users No Z lock on detach Local Index Local Index Local Index Local Index Local Index 64G Jan Feb Mar Apr May ALTER TABLE DETACH PARTITION JAN 19
Roll In: Añadir una Nueva Partición de Datos CREATE TABLE JUNE CREATE INDEX Local Index Local Index Local Index Local Index Local Index Feb Mar Apr May No Global Index to Maintain June ALTER LOAD TABLE ATTACH JUNE SET INTEGRITY 20
Session DB2 9.7 Movimiento de Tablas Online y Tablespaces Transportables 21
Movimiento de Tablas de Forma Sencilla Movimiento de Tablas online" Procedimientos almacenados que permiten el movimiento de tablas. Mover la tabla online a un tablespace distinto. El nuevo tablespace puede tener: Tamaño de página mayor, extent size distinto u otras propiedades de tablespaces distintos. Transportable Tablespaces Rápido Movimiento de Schemas entre bases de datos distintas. Extrae el DDL y otros objetos dependientes. Referencia directa de los containers en la base de datos destino. 22
Session DB2 9.7 HADR: Lecturas en el Servidor Secundario 23
Alta Disponibilidad Muy Rápida (segundos). Para gestionar paradas planificadas y no planificadas. Muy Fácil de montar: No exige reescritura de las aplicaciones. No necesita hardware especializado. Se instala y configura en minutos con un wizard gráfico. Los Servidores pueden estar en CPDs distintos. Primary Keep Servers Synchronized Standby One of the major advantages of DB2 is that we get a disaster recovery solution for our SAP system with HADR at no extra cost. Gustav Elias, Austrian Railways 24
HADR Permite Lecturas en el Servidor Secundario Read/Write Clients Read-Only Clients Clients Primary DB Logs Standby Clients El servidor de Standby permite ejecutar trabajos de sólo lectura db2set DB2_HADR_ROS = Y 25
Session DB2 9.7 Compatibilidad con Oracle 26
Aplicaciones Oracle corriendo nativas en DB2 Porting?? I meant ENABLING!!! Concurrency Control Oracle SQL PL/SQL Packages Built-in packages JDBC SQL*Plus Scripts NO CHANGE DB2 The Oracle compatibility feature will enable Oracle applications to run natively on DB2. In discussions with Gartner, reference customers tell us that DB2 runs 95% or more of Oracle specific functionality found in SQL statements and natively runs PL/SQL, Oracle s stored procedure language. This native functionality is not an emulator, nor does it require changes to the application code (other than the 5%, which is mostly minor functionality, not found in many applications). Any provider offering applications that run with the Oracle DBMS can easily port it s application to IBM s DB2 Donald Feinberg, Gartner VP Distinguished Analyst 27
Qué Corre directamente en DB2 9.7? Oracle DB2 Cobra Concurrency Control No change Oracle SQL No change PL/SQL No Change Packages No Change Built-in packages No Change JDBC No Change SQL*Plus Scripts No Change Changes are the exception. Not the rule. THIS IS WHY WE CALL IT ENABLEMENT AND NOT PORT! 28
Migración de Schemas y Datos de forma fácil 29
Compilador PL/SQL nativo en DB2 9.7 Editor Data Studio PL/SQL Compiler DB2 Server SQL PL Compiler SURE (SQL Unified Runtime Engine) Data base Debugger Profiler DB2's PL/SQL compatibility is excellent. We re looking forward to integrating the current dual source code base into a single one. This will increase our development and testing productivity. The compatibility level that DB2 achieved is also amazing. Now we can stop our program s different behaviors, which comes from DBMS s differences, and this will help us improve the quality of our package. - Masato Kudo, Works Applications 30
Debugging PL/SQL en DB2 9.7 31
Usando SQL*Plus scripts en DB2 9.7 CLPPlus SQL*Plus compatible command Variable substitution Column formatting Simple reporting Control variables 32
Nuevo Isolation Level en DB2 9.7 Lee la versión confirmada de la fila si se encuentra filas no confirmadas se usa la versión confirmada. Se basa en el LOG de transacciones No hay overhead de gestión. No hay overhead en rendimiento. No management overhead No hay desperdicio de memoria/almacenamiento (no hay undo tablespace) User 1: update T1 set name = Russo where country= Italy User 2: select * from T1 Scanner Table T1 X Locks Name Country Rossi Russo Italy Bernard France Garcia Spain Pappas Greece Levi Israel Peeters Belgium Memory Lookup Log Buffer RID 1=Rossi->Russo Log Files 33
Session DB2 9.7 Mejoras en DPF 34
Scan Sharing Releer sólo las páginas que faltan Buffer Pool El scan 2 empieza en la situación actual del scan 1 User 1 Scans Data User 2 Scans Data 35
XML en Data Warehouse (DPF) Business Intelligence con datos XML Alto rendimiento con cargas analíticas sobre datos XML. Trabaje fácilmente con datos XML en su data warehouse. Aproveche XML en partición de datos, particiones por rango, vistas, y MDCs. Mejoras en los índices y en la compresión de datos XML. The new release of DB2 is outstanding for its data warehousing functionality... Jean-Marc Blaise, Venedim The parallelization of queries and inserts of the XML data will allow our researchers to gain access to the data they require even faster... Tom Holdener, BJC HealthCare 36
Más Información en DB2 Information Center http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp 37
Más Información en Developers Works http://www.ibm.com/developerworks/db2/ 38
Más Información en la Página de DB2 LUW http://www.ibm.com/software/data/db2/9/ 39
Preguntas? 40