Converting Tables Using Report DB6CONV (Version 5.20 or Higher)
For SAP Systems on IBM DB2 for Linux, UNIX, and Windows Target Audience u Consultants u Administrators u Others
Public Document version 3.0 07/20/2012
Copyright 2012 SAP AG. Alle Rechte vorbehalten. All rights reserved. Tous droits rservs. Bce npana samnment. Weitergabe und Vervielfltigung dieser Publikation oder von Teilen daraus sind, zu welchemZweck und in welcher Formauch immer, ohne die ausdrckliche schriftliche Genehmigung durch SAP AG nicht gestattet. In dieser Publikation enthaltene Informationen knnen ohne vorherige Ankndigung gendert werden. Die von SAP AG oder deren Vertriebsfirmen angebotenen Softwareprodukte knnen Softwarekomponenten auch anderer Softwarehersteller enthalten. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the United States and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered trademarks of Adobe Systems Incorporated in the United States and other countries. Oracle and J ava are registered trademarks of Oracle and its affiliates. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems Inc. HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi- Touch, Objective-C, Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc. IOS is a registered trademark of Cisco Systems Inc. RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch, BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App World are trademarks or registered trademarks of Research in Motion Limited. Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik and Android are trademarks or registered trademarks of Google Inc. INTERMEC is a registered trademark of Intermec Technologies Corporation. Wi-Fi is a registered trademark of Wi-Fi Alliance. Bluetooth is a registered trademark of Bluetooth SIG Inc. Motorola is a registered trademark of Motorola Trademark Holdings LLC. Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an SAP company. Crossgate, m@gic EDDY, B2B 360, and B2B 360 Services are registered trademarks of Crossgate AG in Germany and other countries. Crossgate is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Germany T +49/18 05/34 34 24 F +49/18 05/34 34 20 www.sap.c om
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. . Disclaimer Some components of this product are based on Java. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components.
Any J ava Source Code delivered with this product is only to be used by SAPs Support Services and may not be modified or altered in any way.
Typographi c Convent i ons
Type Style Descripti on Example Text Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation Example text Emphasized words or phrases in body text, graphic titles, and table titles EXAMPLE TEXT Technical names of system objects. These include report names, program names, transaction codes, table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE. Exampl e t ext Output on the screen. This includes file and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Example text Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. <Example text> Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER. I c ons
Icon Meaning
Caution
Example
Note
Recommendation
Syntax
Additional icons are used in SAP Library documentation to help you identify different types of information at a glance. For more information, see Help on Help General Information Classes and Information Classes for Business Information Warehouse on the first page of any version of SAP Library.
March 2012 5 Contents
1 Introduction ......................................................................................... 6 2 Performing a Conversion Using Report DB6CONV ......................... 9 2.1 Defining a Conversion Job in DB6CONV ............................................. 9 2.2. Defining a Conversion Job Outside DB6CONV ................................ 14 2.3 Maintaining the Conversion Parameters ............................................ 14 2.4 Maintaining the Conversion Queue of a Mass Conversion .............. 14 2.5 Excluding Tables from Conversion .................................................... 17 2.6 Starting a Conversion Job ................................................................... 18 2.7 Monitoring a Running Conversion ...................................................... 18 2.8 Available Actions on the Conversion Overview Screen ................... 19 2.9 Displaying Old Conversion Logs ....................................................... 21 3 Conversion Steps Performed by Report DB6CONV ...................... 22 3.1 Offline Conversion Steps .................................................................... 22 3.2 Online Conversion Steps ..................................................................... 25 4 Insert Ti me Clustering (ITC) Tables and Candidates ..................... 27 Appendix: Additional Information ...................................................... 29 Available Information on the Conversion Overview Screen ................... 29 Document History ...................................................................................... 33
6 March 2012 1 Introduction This document describes how you can convert a single table or multiple tables using report DB6CONV. Table conversion in this document means that you move one or more tables within the same tablespace or to another tablespace as fast and efficient as possible using DB2 means without explicitly changing the table structure.
This document only applies to report DB6CONV Version 5.20 or higher.You can find the most current version of report DB6CONV attached to SAP Note 1513862. For information about the changes applied to this document, see the Document History [page 33]. Features The following are the main features of report DB6CONV: Single table conversion with one process or mass conversion (conversion of multiple tables) with one or more parallel processes. You can perform a conversion in one of the following modes: ONLINE The table to be converted is still accessible for INSERT, UPDATE, or DELETE operations during the conversion. OFFLINE logged The table to be converted is only accessible for read-only operations and the data transfer from the source to the target table is recorded in the database logs. OFFLINE not logged The table to be converted is only accessible for read-only operations and the data transfer from the source to the target table is not recorded in the database logs. You can define conversions using either target tablespaces or target data classes. As of DB2 V9.1, DB6CONV supports data compression. You can set the compression attribute for target tables. The compression rate is optimized by means of sampling. As of DB2 V9.7, DB6CONV supports index compression. For target tables, you can set the compression attribute separately for data and indexes. As of DB2 10.1, DB6CONV supports the following new features: o Adaptive compression for table data o Hidden columns o Insert time clustering (ITC) tables Activities You use report DB6CONV, for example, if you want to: Circumvent the tablespace size limit
March 2012 7 You can use DB6CONV to move tables that have reached the page size-dependent size limit for tablespaces to another tablespace that has a larger page size. For example, a table is moved from a tablespace with a page size of 4 KB to a tablespace with a page size of 8 KB, 16 KB, or 32 KB. Move tablespaces to new tablespaces using reclaimable storage
This feature is only available if your database is DB2 V9.7 or higher. Replace LONG VARCHAR columns with inline LOBs for all tables, which is referred to as LONGLOB conversion throughout this document.
This feature is only available if your database is DB2 V9.7 or higher and your SAP system has at least SAP basis 7.0 or higher. Convert regular tables to ITC tables
This feature is only available if your database is DB2 10.1. or higher and if the database is not using the DB2 pureScale feature. Add or change the partitioning key of a BW table. In this case, the conversion job is defined outside the DB6CONV report by means of function modules in BW. For more information, see SAP Note 648432. Usage Requirements At least DB2 UDB for UNIX and Windows Version 8.2 or higher At least SAP basis release 6.20 or higher
For conversions with DB2 releases lower than DB2 UDB Version 8.2 and SAP systems lower than 6.20, you can only use report DB6CONV version 4.10 as described in SAP Note 362325. Constraints Report DB6CONV version 5 or higher is not part of the standard SAP delivery. The latest version is available as an attachment to SAP Note 1513862. The attached archive DB6CONV_V<ver si on>_<t i mest amp>. SAR contains the following: The data- and the co-file of the corresponding DB6CONV transport that you have to import into the SAP system File DB6CONV_V<ver si on>_<t i mest amp>_README. TXT This read-me file provides instructions that you must follow to import DB6CONV version 5.x into an SAP system that contains data from a DB6CONV version up to and including version 4.10. The transport consists of the following objects: Reports DB6CONV and DB6CONVP Include DB6CONV_ITC_SUB Tables DB6CONVT, DB6CONVL, DB6CONVQ, and DB6CONVE
8 March 2012 Report DB6CONV can only move tables of the AS ABAP. Moving other kinds of tables, for example, of an SAP J ava system is not supported by DB6CONV. Report DB6CONV cannot perform explicit structure changes when moving a table. Implicit structure changes to tables, such as the conversion of LONG VARCHAR columns to VARCHAR columns or LONG VARCHAR columns to columns of type LOB, are performed depending on the release level of the ABAP Dictionary and the kernel database shared library dbdb6sl i b. Terminology Used in This Document Throughout this document, the following naming conventions apply: Database Name Short Name IBM DB2 Version 10.1 for Linux, UNIX, and Windows DB2 10.1 IBM DB2 Version 9.7 for Linux, UNIX, and Windows DB2 V9.7 IBM DB2 Version 9.5 for Linux, UNIX, and Windows DB2 V9.5 IBM DB2 Version 9.1 for Linux, UNIX, and Windows DB2 V9.1
The term mass conversion is used as a synonym for: Tablespace conversion LONGLOB conversion Conversion of ITC candidates to ITC tables Reconversion of ITC tables to regular tables External conversion
March 2012 9 2 Performing a Conversion Using Report DB6CONV The following sections provide information about: Defining a Conversion J ob in DB6CONV [page 9] Defining a Conversion J ob outside DB6CONV [page 14] Maintaining the Conversion Parameters [page 14] Maintaining the Conversion Queue of a Mass Conversion [page 14] Excluding Tables from Conversion [page 17] Starting a Conversion J ob [page 18] Monitoring a Running Conversion [page 18] Available Actions on the Conversion Overview Screen [page 19] Displaying Old Conversion Logs [page 21]
2.1 Defi ni ng a Conversi on Job in DB6CONV To define a conversion job, call transaction SE38 in your SAP system. In the Program field, enter DB6CONV and choose the Execute pushbutton. The Conversion Overview screen appears providing information about the conversion jobs. For more information, see Available Information on the Conversion Overview Screen [page 29]. On the Conversion Overview screen, choose the New Conversion pushbutton. On the New Conversion screen, you can choose to do one of the following: Convert a single table Convert all or only some tables of a tablespace (in this procedure referred to as tablespace conversion) Perform a conversion on database level. The following scenarios exist: LONGLOB conversion (as of DB2 V9.7) Conversion of ITC candidates to ITC tables (as of DB2 10.1) Reconversion of ITC tables to regular tables (as of DB2 10.1)
For single tables and tablespaces, you can perform conversions using either target tablespaces or the target data class. For more information, see Performing a Conversion Using the Data Class [page 12]. Performing a Table or Tablespace Conversion The following procedure applies to the conversion of a single table as well as to the tablespace conversion because most parameters to be specified are identical on the Single Table Conversion and the Tablespace Conversion tab page: ... 1. In the field Name of the Table to Be Converted or Name of the Tablespace to Be Converted, enter the name of the table to be converted, or choose the tablespace to be converted from the dropdown list.
10 March 2012 2. In the field Target Data Tablespace, choose the appropriate target tablespace for the table or tablespace to be converted from the dropdown list. 3. In the field Target Index Tablespace, choose the appropriate target index tablespace of the table or tablespace to be converted from the dropdown list. 4. Optional: In the field Target Long Tablespace, choose the appropriate long tablespace for the table or tablespace to be converted from the dropdown list. 5. For DB2 10.1 or higher and if the database is not using the DB2 pureScale feature: a. In the Insert Time Clustering field, choose the appropriate option for the table or tablespace to be converted from the dropdown list. The default value is Keep Current Status, that is, the cluster attribute of the table or of all tables in a tablespace is kept. b. Optional and only available for single table conversi ons: If you want to display the ITC characteristics of the table and check or modify the choice that you made in the previous step a., choose the ITC Status pushbutton. 6. Optional and only available for mass conversi ons: If you want to display and maintain the list of tables that are part of the tablespace conversion, choose the Conversion Queue pushbutton. In the Conversion Queue dialog box, you can view and maintain the queue of tables to be converted as described in Maintaining the Conversion Queue of a Mass Conversion [page 14]. 7. Specify if you want to perform the conversion online or offline (by default, the offline radio button is selected): If you choose the Online radio button, specify the following parameters: Use COPY_WITH_INDEXES If you select this option, all indexes of the target table are created before the data transfer. If you deselect this option, all indexes of the target table are created after the data transfer. This may result in a shorter total time for the data transfer itself, but in a higher temporary space request for the creation of the indexes. By default, this option is preselected. Stop Before Switch If you select this option, the online conversion for a single table is stopped before the switch from source to target table. This switch causes a short downtime for the table to be converted. With this option, you can estimate the point in time when the switch (and thus the short downtime) takes place more precisely than when the complete table conversion is performed. By default, this option is not preselected.
The option Stop Before Switch is only available for the conversion of a singl e table. If you choose the Offline radio button, specify the following parameters:
March 2012 11 Data Transfer not Logged This is the fastest conversion method available in DB6CONV. If you select this option, the data transfer itself is not logged. Therefore, you have to back up at least the target tablespace after the conversion. By default, this option is not preselected. Sort Data by Primary Key If you select this option, data is sorted according to the definition of the primary key when data is being transferred to the target table. The result is identical to the result of the following command: db2 reorg table <tabname> index <primary key> By default, this option is not selected. If there is no primary key, this option is not relevant. COMMIT Size (MB) This option is only relevant if you did not select the Data Transfer not Logged checkbox. While the data transfer step is being logged, table data is split into data blocks using a unique index. Each block should have the same size and should not exceed the value that you specified in the COMMIT Size (MB) field. After the data of each data block has been transferred to the target table, a COMMIT is issued to avoid a log full situation. The total size of database logs must be at least equal to or higher than the specified COMMIT size multiplied by the number of batch jobs that you specify to run in parallel. The default COMMIT size is 300 MB. Without a unique index, table data is split according to the non-unique index with the highest FULLKEYCARD. Therefore, an equal block size or a maximum block size of the specified COMMIT size cannot be guaranteed. 8. DB2 V9.1 or higher only: Specify the compression status that the tables and indexes will have after the conversion by choosing the relevant option from the dropdown list in the Compression for Data and Compression for Indexes fields. 9. Specify if you want the source table to be dropped after the conversion by selecting the checkbox Delete Source Table after Conversion.
Do not select this option if, for example, you want to compare the source table with the target table after the conversion. In this case, you have to manually drop the source table at a later point in time. By default, this option is preselected. 10. Specify if you want statistics to be created for the converted table(s) by selecting the checkbox Update Statistics After Conversion. The target table for a conversion is newly created during the conversion. Therefore, there are no statistics available directly after the conversion. With this option, statistics are generated for the converted single table or for all tables of the target tablespace during the last step of the conversion.
12 March 2012 By default, this option is preselected. 11. Save your entries. (For mass conversions, a message window appears providing a summary of the saved queue, that is, the total number of entries as well as the number of deleted, excluded, and rejected objects. Confirm this message window.) The Conversion Overview screen appears and the new conversion job is displayed with status PLANNED in the Conversion Jobs area. 12. Optionally, you can check and maintain the conversion parameters and the conversion queue as described in Maintaining the Conversion Parameters [page 14] and Maintaining the Conversion Queue of a Mass Conversion [page 14]. 13. Start the conversion job [page 18]. Performing a Conversion Using the Data Class Instead of specifying a target data tablespace and a target index tablespace for a table or tablespace conversion, you can also perform a conversion specifying the target data class. The table is then converted to the target tablespaces that are related to the specified target data class in tables TADB6 and IADB6.
Procedure 1. On the New Conversion screen, choose the Specify Target Data Class pushbutton. 2. In the field Name of the Table to Be Converted or Name of the Tablespace to Be Converted, enter the name of the table or choose a tablespace from the dropdown list. 3. Choose the target data class from the dropdown list. 4. Proceed as described in step 5 to 12 in the above procedure Performing a Table or Tablespace Conversion [page 9].
Performing a Database-Level Conversion The different types of database-level conversions are described in the following. You can combine them, that is, run them simultaneously by selecting the relevant checkboxes on the Database-Level Conversions tab page. Depending on your database version, the available scenarios vary.
Database-level conversions can only be applied to tables that are known to the ABAP Data Dictionary. Performing a LONGLOB Conversion
LONGLOB conversion with DB6CONV is only available as of DB2 V9.7 and for SAP systems with SAP basis of 7.0 or higher that contain tables with LONG VARCHAR columns. As of DB2 V9.7, inline LOBs were introduced providing faster access to data than LONG VARCHAR columns. During a LONGLOB conversion with report DB6CONV, new tables are created with inline LOB columns instead of LONG VARCHAR columns. During the LONGLOB conversion, all tables with LONG VARCHAR columns are collected in the conversion queue and are converted within their own tablespaces.
March 2012 13 To perform a LONGLOB conversion, choose the Database-Level Conversions tab page and select the checkbox Replace LONG VARCHAR Columns by LOB Columns (LONGLOB Conversion). Then proceed as described in step 6 to 13 in Performing a Table or Tablespace Conversion [page 9].
Converting ITC Candidates to ITC Tables
This option is only available as of DB2 10.1 and if the database is not using the DB2 pureScale feature.
DB6CONV can create a list of tables that might be candidates for a conversion to ITC tables. For information about how ITC candidates are chosen, see Insert Time Clustering (ITC) Tables and Candidates [page 27]. To convert ITC candidates to ITC tables, choose the Database-Level Conversions tab page and select the relevant checkbox. Then proceed as described in step 6 to 13 in Performing a Table or Tablespace Conversion [page 9].
Reconverting ITC Tables to Regular Tables
This option is only available as of DB2 10.1 and if the database is not using the DB2 pureScale feature.
To reconvert ITC tables to regular tables, choose the Database-Level Conversions tab page and select the relevant checkbox. Then proceed as described in step 6 to 13 in Performing a Table or Tablespace Conversion [page 9].
Naming Convention for Database-Level Conversions After saving, all database-level conversions are named <DLCONV>_###, where # can either have the value X (that is, selected) or O (that is, not selected). The values reflect the selection of the different types of database-level conversions in the following order: ... 1. LONGLOB conversion 2. ITC conversion 3. ITC reconversion Examples: Naming Descripti on <DLCONV>_XOO Only LONGLOB conversion was selected. <DLCONV>_OXO Only ITC conversion was selected. <DLCONV>_XOX Combined selection of LONGLOB conversion and ITC reconversion al
D
14 March 2012 2.2. Defining a Conversi on Job Outsi de DB6CONV A conversion job can also be defined outside the DB6CONV report. Such an externally defined conversion job is then listed in DB6CONV as External object type. The object name of the corresponding conversion job starts with <EXT>_. Currently, you can define external conversion jobs in BW systems only. To do so, call one or more of the following function modules in your BW system:
Function Module Name of Conversion Job RSDU_CHKREP_PKEY_ALL_CUBES_DB6 <EXT>_REP_PK_IC RSDU_CHKREP_PKEY_ALL_ODS_DB6 <EXT>_REP_PK_ODS RSDU_CHKREP_PKEY_ALL_PSA_DB6 <EXT>_REP_PK_PSA
For the correct version of the function modules, see SAP Note 1574965. For more information, see also SAP Note 648432 and the database administration guide SAP NetWeaver Business Warehouse 7.0 Administration Tasks: IBM DB2 for Linux, UNIX, and Windows and SAP at: http://service.sap.com/instguidesnw <Your SAP NetWeaver Main Release> Operations Database-Specific Guides While an external conversion has status PLANNED, you can still modify the conversion parameters and the conversion queue in the DB6CONV report. For more information, see Maintaining the Conversion Parameters [page 14] and Maintaining the Conversion Queue of a Mass Conversion [page 14].
2.3 Maintai ning the Conversion Parameters For any conversion job, you can display or maintain the conversion parameters as follows: For a new conversion, you can specify the parameters for the conversion job on the New Conversion screen (not applicable for external conversions). For conversions with status PLANNED, you can display or maintain the current conversion parameters by choosing the Details pushbutton on the Conversion Overview screen. Exception: For tablespace conversions, you cannot change the option that you have chosen in the Insert Time Clustering field anymore. For conversions with any other status than PLANNED, you can only display the conversion parameters by choosing the Details pushbutton on the Conversion Overview screen.
2.4 Maintai ning the Conversion Queue of a Mass Conversion For a mass conversion, you can display or maintain the current queue of tables to be converted as follows:
March 2012 15 For a new conversion, you can display or maintain the initial conversion queue while specifying the parameters for the conversion job by choosing the Conversion Queue pushbutton on the New Conversion screen (not applicable for external conversions). For conversions with status PLANNED, you can display or maintain the current conversion queue by choosing the Details pushbutton on the Conversion Overview screen and then the Conversion Queue pushbutton on the Details for <object name> screen. For conversions with any other status than PLANNED, you can only display the conversion queue by choosing the Details pushbutton on the Conversion Overview screen and then the Conversion Queue pushbutton on the Details for <object name> screen. For tablespace conversions, all tables that reside in the specified tablespace and that have the table schema of the AS ABAP system are initially displayed in the conversion queue in alphabetical order. A message window is displayed if the tablespace contains tables with a table schema other than the table schema of the AS ABAP system. For LONGLOB conversions, all tables that have the table schema of the AS ABAP system with at least one LONG VARCHAR field are initially displayed in the conversion queue in alphabetical order independently of their tablespace location. For ITC conversions, all ITC candidate tables are initially displayed in the conversion queue in alphabetical order independently of their tablespace location. Similarly, for the reconversion of ITC tables to regular tables, all ITC tables are initially displayed in the conversion queue in alphabetical order independently of their tablespace location. The following information is displayed in the Conversion Queue dialog box: Column Descripti on Queue No. Position of a table in the queue Tables are converted during a mass conversion according to their queue number Excluded X indicates that an entry in the exclude list exists for this table. When you save the queue, excluded tables are removed from the queue. For more information, see Excluding Tables from Conversion [page 17]. Table Name Name of the table Size [KB] Size of the table to be converted in KB based on current database statistics The displayed value is based on the following formula: ( <val ue of syscat . t abl es- npages> t i mes <pagesi ze of t he sour ce t abl espace>) A value of 1- indicates that no statistics exist for the corresponding table. Therefore, its size is unknown.
Without current statistics, the real size of a table can deviate from the size specified here.
16 March 2012 Status For conversions currently being defined or with status PLANNED, the status for each table of the conversion queue is set to NEW. Once a conversion job has started, the status for the tables in the queue changes accordingly, for example, to RUNNING or ABORTED.
For DB2 10.1 or higher and if the database is not using the DB2 pureScale feature:
Column Descripti on Clustering Indicates whether or not the table is clustered before the conversion. Possible values: NO: Table is not clustered MDC: Table is clustered by dimensions ITC: Table is clustered by insert time ITC Conversion strategy using insert time clustering. You can choose between the following values and, if necessary, overwrite your previous selection for the mass conversion: YES: Table will be clustered by insert time after the conversion (independent of the status before). This is the default value for ITC candidates in the following scenarios: Tablespace conversions where the ITC setting is Yes for Candidates ITC conversions NO: Table will not be clustered by insert time after the conversion (independent of the status before). This is the default value for: Tablespace conversions where the ITC setting is No ITC reconversions KEEP: Status of insert time clustering will not change during the conversion. This is the default value for: Tablespace conversions where the ITC setting is Keep Tables that are no ITC candidates in tablespace conversions where the ITC setting is Yes for Candidates LONGLOB conversions
March 2012 17
If you need detailed information about ITC candidates, you can display the following columns by choosing the ITC Status pushbutton: Column Descripti on Deleted Objects
Number of deleted archiving objects for the table This field is empty if the table is not considered an ITC candidate by DB6CONV.
Archiving Object
Archiving object(s) for this table Extent Size The extent size (in KB) of the table
For more information, see Insert Time Clustering (ITC) Tables and Candidates [page 2727]. Available Actions in the Conversion Queue Dialog Box In the Conversion Queue dialog box, you can perform one of the following actions by choosing the appropriate pushbutton: Re-sort the tables in the conversion queue If the conversion queue is sorted, for example, by name or data size and the resulting new order is to be used for the upcoming mass conversion, you have to adapt the queue number accordingly by choosing the Re-sort pushbutton. Without re-sorting, the tables are converted based on the old queue numbers. The re-sort is logged in the conversion log of the appropriate conversion job. The Re-sort pushbutton is disabled when the conversion is started. Delete tables from the conversion queue You can delete a table from the conversion queue by selecting it from the list and choosing the Delete pushbutton. These tables are no longer part of the upcoming mass conversion. The table deletion is logged in the conversion log of the appropriate conversion job. The Delete pushbutton is disabled when the conversion is started. For DB2 10.1 only and if the database is not using the DB2 pureScale feature: Display additional ITC-related columns (see table above). Change the displayed ITC option for individual tables by selecting the appropriate value from the dropdown list. Refresh the conversion queue The Refresh pushbutton is disabled until the conversion is started.
2.5 Excl uding Tabl es from Conversi on You can display and maintain the list of tables that are excluded from conversion by choosing the Exclude List pushbutton on the Conversion Overview screen.
18 March 2012 On the Exclude List screen, the name of the object to be excluded is displayed as well as a comment. As long as an entry for a table exists, this table is excluded from table conversion with report DB6CONV. To add a table to the exclude list, choose the Add pushbutton and enter the name of the table to be excluded as well as a comment why it is to be excluded. To remove a table from the exclude list, select it from the list and choose the Remove pushbutton. Afterwards, the table can be converted again by report DB6CONV (unless it is again automatically added to the exclude list by report DB6CONV).
2.6 Starti ng a Conversi on Job 1. On the Conversion Overview screen, start the conversion job by selecting the planned job from the list and choosing the Start pushbutton. 2. In the Start Conversion dialog box, specify the following parameters: The number of parallel jobs used during the conversion (only available for mass conversions) The value can range from 1 up to <number of batch jobs configured in system>. If you want the conversion job to start immediately, choose the radio button Start Batch Job(s) Immediately. If you want the conversion job to start at a specified time, choose the radio button Schedule Batch Job(s). 3. Confirm your entries by choosing the OK pushbutton. If you specified a certain date and time for the conversion to start, the status of the conversion job changes from PLANNED to SCHEDULED on the Conversion Overview screen. As soon as the conversion starts, the status changes from SCHEDULED to RUNNING. If you specified the conversion to start immediately, the status of the conversion job changes from PLANNED to RUNNING.
2.7 Monitoring a Running Conversion You can monitor the progress of a running conversion using the information displayed in the Comment field on the Conversion Overview screen. Since there is no automatic refresh, you have to manually refresh the information to always have the most current information displayed. For a single table conversion, the Comment field contains the number of the conversion step that is currently being executed. For the data transfer step, the number and percentage of currently transferred table rows is also displayed. For a mass conversi on, the Comment field displays information based on the following formula: <x>/ <y> t abl es ( <z> KB) where: <x>stands for the number of tables that were already successfully converted <y>stands for the total number of tables in the conversion queue at the start of the mass conversion
March 2012 19 <z>stands for the size of data in KB that was successfully moved The tables that are implicitly converted during a mass conversion are displayed in the Tables from Mass Conversion area including their status.
2.8 Avai lable Actions on the Conversion Overview Screen Once you have planned and started a conversion job, you can perform the following actions: Pause a conversion Continue a conversion Replay a conversion Abort a conversion Reset a conversion Change the number of parallel jobs Display the conversion log Delete conversion logs Pausing a Conversion
This pushbutton is only available for mass conversions with status RUNNING. You can interrupt a mass conversion with status RUNNING by selecting the respective conversion job and choosing the Pause pushbutton. All parallel jobs of the selected mass conversion stop after each currently ongoing table conversion, which is part of the mass conversion has finished. You have to manually reset or continue the paused conversion later on. Continuing a Conversion
This pushbutton is only available for aborted single table conversions or aborted or paused mass conversions. To continue an aborted single table conversion or an aborted or paused mass conversion, select the appropriate batch job and choose the Continue pushbutton in the Conversion Jobs area. For a mass conversi on, you have to consider the following: An aborted single table conversion that was started by a batch job of a parent mass conversion is automatically continued unless you reset or continue the conversion on table level earlier by selecting the appropriate table from the list in the Tables from Mass Conversion area and choosing the appropriate pushbutton. When you continue a mass conversion, you can also change the number of parallel jobs that you specified when starting the conversion. Replaying a Conversion
This pushbutton is only available for ONLINE conversions of single tables with status PAUSED.
20 March 2012 For online conversions of a single table that were defined with the Stop Before Switch option, the conversion is stopped after the initial data copy, and the conversion status is set to PAUSED. Continuing a paused conversion will at first apply data modifications of the original table to the target table (replay) and switch the table afterwards. The more data there is to be replayed, the longer it takes until the table is finally switched. Therefore, we recommend that you perform regular replay actions using the Replay pushbutton before continuing the conversion. Aborting a Conversion
This pushbutton is only available for single table conversions with status RUNNING. You can abort the conversion of a single table by either selecting an entry in the Conversion Jobs area or in the Tables from Mass Conversion area and choosing the Abort pushbutton. We recommend that you only use this option in emergency cases, for example, if a conversion is running too long. Resetting a Conversion
This pushbutton is only available for aborted single table conversions or aborted or paused mass conversions. You can reset an aborted single table conversion or a mass conversion by selecting the appropriate job from the list and choosing the Reset pushbutton in the Job Conversion area. For a single table conversion, resetting a table restores the state of the table from before the conversion if the table has not yet been renamed. For a mass conversi on, you have to consider the following: Resetting a mass conversion simply empties the queue of the marked mass conversion and resets table conversions with status ABORTED that belong to this mass conversion. Then, all tables that have already been successfully converted reside in the target tablespace. All tables that have not yet been converted remain in the source tablespace.
Be aware that a conversion reset is always executed immedi atel y and with only one parallel process. This means that you cannot schedule a reset job to start at a specific time. Changing the Number of Parallel Jobs
This pushbutton is only available for currently running mass conversions. You can change the number of parallel jobs of a running mass conversion dynamically without stopping it by selecting the appropriate conversion job from the list and choosing the +/- Jobs pushbutton. You might want to change (that is, increase or decrease) the number of parallel jobs, for example, in the following situations: You accidentally defined not enough or too many parallel processes. Another important process requires more batch processes than the currently running conversion.
March 2012 21 Displaying the Conversion Log You can display log information about any conversion job independently of whether it is running or whether it has finished. To do so, select the appropriate entry on the Conversion Overview screen and choose the Conversion Log pushbutton. Alternatively, you can double- click the appropriate entry: If you double-click an entry in the Tables from Mass Conversion area or an entry with object type Table in the Conversion Jobs area, the conversion log for the conversion of this particular table is displayed. If you double-click an entry of object type Tablespace or LONGLOB in the Conversion Jobs area, a summary log is displayed for this mass conversion containing information about the conversion queue and the batch jobs. If you double-click a line containing Conversion Job <batch job name> in the summary log for this mass conversion, you switch to the summary log of that specific batch job that contains information about the single table conversions started by this batch job (parent). If you double-click a line containing Conversion of table <table name> in the summary log of that specific batch job, the conversion log of that specific table is finally displayed. Deleting the Conversion Log
This pushbutton is only available for conversions with status FINISHED, RESET, or PLANNED. By choosing the Delete pushbutton, you can delete the detailed conversion logs of a single or multiple selected conversions.
2.9 Displ ayi ng Ol d Conversion Logs If version 5 of report DB6CONV was successfully imported into an SAP system that already contains conversion data from older conversions (that is, from DB6CONV versions lower than version 5), this old conversion data is not listed on the Conversion Overview screen. To display the list of old conversions, choose the Conversions before V5 pushbutton that is only available if old conversions exist. You can then display detailed log information about a conversion job by selecting an entry from the list and choosing the Conversion Log pushbutton. To delete an old conversion, select an entry from the list and choose the Delete pushbutton.
22 March 2012 3 Conversion Steps Performed by Report DB6CONV
3.1 Offli ne Conversion Steps In the following, the steps and relevant actions of an offline conversion are described.
If a deferred table is converted offline, only steps 0, 6, and 8 are executed. Step 0 Actions: Checks whether the conversion is possible Writes the following information to the detailed conversion log: A header section containing the conversion parameters For example, the target tablespaces are listed together with their database partition group and database partition number. The data class and data, index, and long tablespaces of the source table together with their database partition group and the data partition number The page sizes of the source and target tablespaces Detailed information about the table size and the compression status (only for DB2 V9.1 or higher) The structure (DESCRI BE TABLE) of the source table (only when a conversion is started) The table type of the source table The possible values are TRANSP, POOL, or CLUSTER. All indexes of the table with index name, uniqueness, index type, and index fields The kernel release and database release Step 1 (skipped for DB2 V9.7 or higher) Actions: Deletes all views that reference the table to be converted Writes the names, view texts, and the total number of deleted views to the detailed conversion log file Step 2 Actions: Reads and modifies the entries for the table to be converted in the DDSTORAGE table Renames the original table from <TABLE>to QCM<TABLE>
March 2012 23 Creates three triggers on QCM<Tabl e>to prevent INSERT, UPDATE, and DELETE operations on the table during conversions The trigger names are <TAB>_T_I NS, <TAB>_T_UPD,and <TAB>_T_DEL. For DB2 versions lower than DB2 V9.7 and table names with more than 12 characters, the trigger names are DB6CONV<#####>_T_I NS/ UPD/ DEL, where <#####>is a unique number. Creates a view with the original name <TAB>on table QCM<TAB> This view references all fields of table QCM<TAB>. The existence of the view in combination with the triggers mentioned earlier allows read-only access for table <TAB> during the conversion and ensures that <TAB>cannot accidentally be created during the conversion by SE11 activation or transports. Re-creates all views that have been deleted in step 1 (for DB2 releases lower than V9.7) or revalidates all views related to the table that is being converted (for DB2 V9.7 or higher) For each action, the corresponding information is written to the detailed conversion log. Step 3 Action: Creates the target table QCM8<TABLE>with the field sequence of the original table QCM<TABLE>as well as the storage parameters (for example, row compression, partitioning key, hashing) according to the entries for the table to be converted in the DDSTORAGE table Writes the CREATE TABLE statement to the detailed conversion log Step 4 Action: Generates alternative index names that are related to the target table (that is, performs an index mapping): For each index that exists on the source table QCM<TAB>, an alternative index name is generated for target table QCM8<TAB>. If an alternative name cannot be determined, the index to be created is temporarily named DB6CONV_<#>, where <#>is a unique number. Writes the information about the index mapping and the CREATE INDEX statements to the detailed conversion log In the detailed conversion log, the number of newly created indexes is displayed and compared to the number of indexes that were defined for the original table. Step 5 Action: Counts the current number of table entries for the tables QCM<TABLE>and QCM8<TABLE>and writes them to the detailed conversion log Transfers data as follows: When tables are converted with content but without the option Data Transfer not Logged, the table entries are portioned by a unique index according to the specified COMMIT Size. Each of these blocks is copied to the target table. The corresponding SQL statement is written to the detailed conversion log. After each block, a COMMI T is issued and the number of table entries of the last block, the total number of table entries that were copied so far, the duration of
24 March 2012 the last block, and the expected remaining runtime for the remaining blocks are displayed. You can monitor the progress in the Comment field on the Conversion Overview screen where the number of already copied table rows is displayed. When tables with content and with the option Data Transfer not Logged are converted, the data is copied in one block. The corresponding SQL statement is also written to the detailed conversion log. In this case, you cannot monitor the conversion progress in the detailed conversion log. However, the number of already copied table entries is displayed in the Comment field on the Conversion Overview screen. If the table has more than 20 MB and is to be compressed, at first 20 MB of data is transferred by using means of sampling. Then, a compression dictionary is built before the table is truncated and all table entries are transferred. If the table is smaller than 20 MB, the complete table content is transferred to the target table. Afterwards, the compression dictionary is built. Finally compares the new number of table entries in table QCM8<TABLE>with the number of table entries in table QCM<TABLE>. This number is written to the detailed conversion log. Step 6 Actions: For real tables, the following steps are performed: The dependent views are dropped again. (Skipped for DB2 V9.7 or higher.) The view with the original name <TAB>is dropped. The three triggers that were defined on the original table QCM<TAB>are dropped. The target table is renamed from QCM8<TAB>to <TAB>. For deferred tables, the original view is dropped and re-created with the new target tablespaces. Step 7 Actions for DB2 versions lower than DB2 V9.7 FP4: Re-creates all views using the converted table <TABLE> in accordance with step 1 Compares the number of re-created views to the number of views deleted in step 1 Actions for DB2 V9.7 FP4 or higher Revalidates all views using the converted table <TABLE> Step 8 Actions: Changes the data class for the target table if you defined the conversion by specifying a target data class. For deferred tables, this is the only action that is executed, the rest of step 8 is skipped. Deletes the original table QCM<TABLE>if you selected Delete Source Table After Conversion when defining the conversion job
March 2012 25 After the original table has been deleted, the indexes of the converted table are renamed to their original names (that is, to the names they had before the conversion). The database statistics for the target table are updated if you selected Update Statistics After Conversion when defining the conversion. If a statistics profile existed for the original table, the same statistics profile is created for the new target table.DB2 V9.1 or higher only: Displays detailed information about the table size and compression again so that you can compare these values. Displays again the structure of the target table
3.2 Onl ine Conversion Steps In the following, the steps and relevant actions of an online conversion are described.
An online conversion calls the following stored procedures for the online table move depending on your database release: For DB2 releases up to and including DB2 V9.5, report DB6CONV calls the SAPTOOLS. ONLI NE_TABLE_MOVE stored procedure. As of DB2 V9.7, report DB6CONV calls the SYSTOOLS. ADMI N_MOVE_TABLE stored procedure. Since the steps performed by report DB6CONV for each of the stored procedures are identical, they are only referred to as OTM in the following (where OTM stands for online table move). For more information about SAPTOOLS.ONLINE_TABLE_MOVE, see SAP Note 1039544. For more information about SYSTOOLS.ADMIN_MOVE_TABLE, see SAP Note 1543745. Step 0 Identical to step 0 of an offline conversion Step 1 Calls the OTM stored procedure for the table to be converted and the target tablespaces with operation parameter I NI T. Creates all temporary objects needed for the online conversion, such as triggers, the target table (if possible using the ABAP Dictionary), and the staging table. Step 2 Calls the OTM stored procedure for the table to be converted and the target tablespaces with operation parameter COPY. Copies all data from the source table to the target table. You cannot monitor the progress of the data transfer in the detailed conversion log but in the Comment field on the Conversion Overview screen. Step 3 Calls the OTM stored procedure for the table to be converted and the target tablespaces with operation parameter REPLAY.
26 March 2012 Data that is modified after the start of the copy step is recorded in the staging table and applied to the target table in subsequent REPLAY actions after the initial copy step has finished.
If the conversion has been defined with the Stop Before Switch option, step 4 is subsequently not executed and the status of the conversion job changes from RUNNING to STOPPED. Step 4 Calls the OTM stored procedure for the table to be converted and the target tablespaces using operation parameter SWAP. As a result, the source table is switched to the target table and the temporary objects that were created during step 1 are deleted.
March 2012 27 4 Insert Time Clustering (ITC) Tables and Candidates As of DB2 10.1, you can create insert time clustering (ITC) tables. ITC tables are based on the infrastructure for MDC tables and allow you to reclaim free space without reorganization using the REORG command with the RECLAIM EXTENTS ONLY clause. In an ITC table, records are clustered based on their insert time. For an effective reclamation of free space for ITC tables, complete extents of the table must be empty. Therefore, a regular table should only be considered an ITC candidate if records that are inserted together are also deleted together. In an SAP system, this access pattern is typical for tables from which data is archived. For example, a business object contract has an associated archiving object. During archiving, usually all contracts up to a specific creation date are written to the archive and afterwards deleted from the corresponding tables.
The fact that data is archived from a table does not necessarily mean that there are empty extents after archiving. Often several criteria can be used to decide which records should be archived. These criteria might not be based on the creation time. Based on the actual archiving session (see SAP transaction SARA Statistics) in the system, DB6CONV can create a list of tables that might be candidates for a conversion to ITC tables. DB6CONV suggests tables that fullfill all of the following conditions: The tables are part of an archiving object for which at least one completed archiving session exists. A complete archiving session exists if data was archived and afterwards deleted from several or all tables that belong to the archiving object. The tables are not already ITC or MDC tables. The tables are at least 1 GB in size. In the Conversion Queue dialog box, the following information is displayed for the ITC candidates: The archiving object(s) to which the table belongs If a table belongs to multiple archiving objetcs, all archiving objects are displayed. The number of deleted archiving objects This is an indication for the amount of data that was actually deleted in these tables. The extent size (in KB) of the tablespace where the table resides. Tablespaces in SAP installations usually come with an extent size of 32 KB (two 16 KB pages). The higher the extent size, the less likely are completely empty extents after deletions.
It is not guaranteed that deletions take place from all tables of an archiving object. Therefore, the list of ITC table candidates can contain tables where actually no deletions took place. These tables, however, are typically less than 1 GB in size.
28 March 2012 More Information Multidimensional and insert time clustering extent management in the IBM DB2 10.1 Information Center at: http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/index.jsp?topic=%2Fcom.ibm.db2.luw.a dmin.partition.doc%2Fdoc%2Fc0054692.html
SAP Note 1700631: DB6: Using DB2 10.1 with SAP Applications SAP Note 975352: DB6: Reorganizations in DB2 / Using DB2 Auto REORG
March 2012 29 Appendix: Additional Information This section provides the following information: Available Information on the Conversion Overview Screen Document History
Avail able Information on the Conversion Overview Screen The Conversion Overview screen consists of the following areas: Conversion Jobs Tables from Mass Conversions In the following, these areas are described in more detail. Information Displayed in the Conversion Jobs Area In this area, all conversion jobs that are known to DB6CONV are displayed. A conversion job is a conversion that you explicitly defined using DB6CONV or that has been defined outside DB6CONV using a BW function module For each conversion job, the following information is displayed: Column Descripti on Status Status of the conversion job The following values are possible: PLANNED SCHEDULED PAUSED RUNNING ABORTED FINISHED RESET Object Type Type of object to be converted The following values are possible: Table Tablespace DLCONV External Object Name Name of the object to be converted Start Date Start date of the conversion Start Time Start time of the conversion
30 March 2012 End Date Date when the status of a running conversion job changed to one of the following statuses: PAUSED ABORTED RESET FINISHED End Time Time when the status of a running conversion job changed to one of the following statuses: PAUSED ABORTED RESET FINISHED Duration Total runtime of the conversion job since its start (does not include wait times) Size [KB] For single table conversions: Size of table to be converted in KB based on current database statistics The displayed value is based on the following formula: ( <val ue of syscat . t abl es- npages> t i mes <pagesi ze of t he sour ce t abl espace>) A value of 1- indicates that no statistics exist for the corresponding table. Therefore, its size is unknown. For mass conversions: For status PLANNED: Total size of all tables of the current conversion queue For statuses other than PLANNED: Total size of all tables of the conversion queue at the time the mass conversion was started. Jobs Number of currently defined parallel processes for the conversion job A value of 1 is displayed for single table conversions and for mass conversions with status PLANNED. For mass conversions with status PLANNED, you can specify the number of parallel jobs in the Start Conversion dialog box. For mass conversions with a status other than PLANNED, the number of parallel jobs can be changed as follows: Manually when you continue an aborted or paused mass conversion (in the Continue Conversion dialog box) Dynamically while the mass conversion is running using the +/- Jobs pushbutton on the Conversion Overview screen For more information, see Available Actions on the Conversion Overview Screen [page 19].
March 2012 31 Online X indicates an online conversion If there is no value displayed, the conversion is performed offline. Comment Information that is related to the conversion as such or to a specific conversion step For single table conversions with status RUNNING, the current conversion step is displayed. While data is being transferred, the progress of the data transfer is also displayed.
For mass conversions, the progress of the conversion is displayed as follows: <x> / <y> t abl es ( <z>KB) where <x>stands for the number of tables that have already been successfully converted <y>stands for the total number of tables in the conversion queue at the start of the mass conversion <z>stands for the size of data in KB that was successfully moved
Information Displayed in the Tables from Mass Conversion Area In this area, all table conversions are listed that have implicitly been started by the batch process that you defined for the parent mass conversion job. In this document, the term mass conversion includes the conversion of all tables of a tablespace and the tables of a LONGLOB conversion. The mass conversion job itself is displayed in the Conversion Jobs area.
32 March 2012 The following information is displayed in the Tables from Mass Conversion area : Column Descripti on Status Status of the conversion job The following values are possible: PLANNED SCHEDULED PAUSED RUNNING ABORTED FINISHED RESET Table Name Name of the table that is converted Start Date Start date of the conversion Start Time Start time of the conversion End Date Date when the status of the conversion job changed The following values are possible: ABORTED RESET FINISHED End Time Time when the status of the conversion job changed The following values are possible: ABORTED RESET FINISHED Duration Total runtime required for a conversion job with status RUNNING (does not include wait times) Size [KB] Displays the value of ( <syscat . t abl es- npages> t i mes <pagesi ze of t he sour ce t abl espace>) for the table to be converted in KB -1 indicates that no statistics exist for the corresponding table. Therefore, its size is unknown. Parent Name of the batch process of the mass conversion job that implicitly performed the conversion of a single table Online X indicates an online conversion Comment Information that is related to the conversion as such or to a specific conversion step For single table conversions with status RUNNING, the current conversion step is displayed as well as the progress of the data transfer.
March 2012 33
Document History
The following table provides an overview of the most important changes to this document: Document Versi on Date Descripti on 1.0 November 12, 2010 Initial version 2.0 April 15, 2011 Document update due to new DB6CONV Version 5.07: New object type for conversion jobs (External) Section Defining a Conversion Job Outside DB6CONV was added
2.1 March 26, 2012 Document update due to new DB6CONV Version 5.15: New online conversion step (chapter 3.2) 3.0 J uly 20, 2012 Document update due to new DB6CONV version 5.20. New features include: Support of new DB2 release (DB2 10.1) Separate data and index compression Replay pushbutton for paused online conversions