9
18.08.2013 Page 1 of 9 SAP Note 1431296 - LOB conversion and table compression with BRSPACE 7.20 Note Language: English Version: 28 Validity: Valid Since 05.02.2013 Summary Symptom 1. New BRSPACE options for LOB conversion and table compression ==================================================================== 1.1 General --------------- Among other things, Oracle 11g contains two important new features in the data storage area. * new LOB types, SecureFile LOBs with the following advantages: - Performance improvements - Data compression - Data encryption (For additional information about SecureFile LOBs, see Note 1426979.) * New and improved method of table compression known as compression for OLTP (COMPRESS FOR OLTP) that promises significant memory space savings. (For more information about the new table compression, particularly in relation to license questions, see Note 1436352.) BRSPACE 7.20 provides new options for activating the new features: * New action "lob2lob" (convert old LOBs to new LOBs) for the BRSPACE function "tbreorg" (table reorganization). * New options "-c|-compress" (table compression action) and "-lc|-lobcompr" (LOB compression degree) for the BRSPACE function "tbreorg". 1.2 Syntax of the options for LOB conversion --------------------------------------------- The new (complete) syntax of the new "lob2lob" action is: -a|-action reorg|reopart|long2lob|lob2lob|heap2iot|iot2heap reorganize table action: reorg - reorganize tables reopart - reorganize table partitions check - check tables for reorganization cleanup - cleanup tables after failure stop - stop reorganization suspend - suspend reorganization resume - resume reorganization long2lob - convert LONG fields to (new) LOBs lob2lob - convert old LOBs to new (SecureFile) LOBs heap2iot - convert heap tables to IOTs iot2heap - convert IOTs to heap tables Default: reorg The other actions in addition to "lob2lob" are already known by BRSPACE Version 7.10, where the "lob2lob" action also supports the SecureFile LOBs. This means that the system automatically converts LONG fields into SecureFile LOBs in Oracle 11g. In contrast, the system still creates BasicFile LOBs for this action in Oracle 10g. Note 1: A hidden option "-COL" (create old LOBs) exists that prevents this. If this is set on the command line, the system converts the LONG fields into the old LOBs (BasicFiles). In the "lob2lob" action, you can use this option to force the system to convert the new LOBs into old LOBs.

sapnote_0001431296.pdf

Embed Size (px)

DESCRIPTION

sapnote_0001431296.pdf

Citation preview

Page 1: sapnote_0001431296.pdf

18.08.2013 Page 1 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

Note Language: English Version: 28 Validity: Valid Since 05.02.2013

Summary

Symptom1. New BRSPACE options for LOB conversion and table compression====================================================================1.1 General---------------Among other things, Oracle 11g contains two important new features in thedata storage area. * new LOB types, SecureFile LOBs with the following advantages: - Performance improvements - Data compression - Data encryption (For additional information about SecureFile LOBs, see Note 1426979.) * New and improved method of table compression known as compression forOLTP (COMPRESS FOR OLTP) that promises significant memory space savings. (For more information about the new table compression, particularly inrelation to license questions, see Note 1436352.)

BRSPACE 7.20 provides new options for activating the new features: * New action "lob2lob" (convert old LOBs to new LOBs) for the BRSPACEfunction "tbreorg" (table reorganization). * New options "-c|-compress" (table compression action) and"-lc|-lobcompr" (LOB compression degree) for the BRSPACE function"tbreorg".

1.2 Syntax of the options for LOB conversion---------------------------------------------The new (complete) syntax of the new "lob2lob" action is:

-a|-action reorg|reopart|long2lob|lob2lob|heap2iot|iot2heap reorganize table action: reorg - reorganize tables reopart - reorganize table partitions check - check tables for reorganization cleanup - cleanup tables after failure stop - stop reorganization suspend - suspend reorganization resume - resume reorganization long2lob - convert LONG fields to (new) LOBs lob2lob - convert old LOBs to new (SecureFile) LOBs heap2iot - convert heap tables to IOTs iot2heap - convert IOTs to heap tables Default: reorg

The other actions in addition to "lob2lob" are already known by BRSPACEVersion 7.10, where the "lob2lob" action also supports the SecureFile LOBs.This means that the system automatically converts LONG fields intoSecureFile LOBs in Oracle 11g. In contrast, the system still createsBasicFile LOBs for this action in Oracle 10g.

Note 1: A hidden option "-COL" (create old LOBs) exists that preventsthis. If this is set on the command line, the system converts the LONGfields into the old LOBs (BasicFiles). In the "lob2lob" action, you can usethis option to force the system to convert the new LOBs into old LOBs.

Page 2: sapnote_0001431296.pdf

18.08.2013 Page 2 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

Note 2: You can execute the "lob2lob" action only in conjunction with anonline reorganization using DBMS_REDEFINITION packages ("-f tbreorg -monline"). You cannot use the "ALTER TABLE MOVE" command to perform anoffline reorganization.

Note 3: In "lob2lob" or "long2lob" actions, BRSPACE only permitsreorganization of tables that have old LOBs (BasicFiles) or LONG fields.Therefore, if you want to convert tables that have old LOBs or LONG fields,you can simply select all of the tables in the SAP schema (for example, "-oSAPSR3 -t allsel"). When you do this, the system skips tables that do nothave old LOBs or LONG fields.

Note 4:To be able to use BR*Tools 7.20 under Oracle 11g on Unix platforms(except for AIX), you must set up the following soft link in$ORACLE_HOME/lib:> > cd $ORACLE_HOME/lib> ln -s libnnz11.so libnnz10.soRemark:The soft link is no longer required for the version of BR*Tools 7.20 thatis delivered with SAP Kernel 7.20_EXT. You can only use these tools as ofcertain operating system versions (see Product Availability Matrix (PAM),for example, for IBM AIX as of Version 6.1).

Remark 5: Read remark 19 in SAP Note 646681 if you only want to compresstables of a certain size.

1.3 Syntax of the options for table compression-------------------------------------------------The syntax of the new table compression actions is as follows:

-c|-compressnone|ctab|clob|ctablob|dtab|dlob|dtablob|ctab_only|clob_only|ctablob_only|dtab_only|dlob_only|dtablob_only table compression action: none - no action ctab - compress tables clob - compress LOBs ctablob - compress tables and LOBs dtab - decompress tables dlob - decompress LOBs dtablob - decompress tables and LOBs ctab_only - compress uncompressed tables only clob_only - compress uncompressed LOBs only ctablob_only - compress uncompressed tables and LOBsonly dtab_only - decompress compressed tables only dlob_only - decompress compressed LOBs only dtablob_only - decompress compressed tables and LOBsonlyDefault: none

-lc|-lobcompr low|medium|high LOB compression degreeDefault: medium

The option "-c|-compress" specifies the compression action (this can be acompression action or a decompression action).

Page 3: sapnote_0001431296.pdf

18.08.2013 Page 3 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

The following difference arises between the option values depending onwhether the "only" suffix exists or not. If the option does not have the"only" suffix (for example, "ctablob"), the system reorganizes all of theselected tables. Therefore, the system compresses the tables that are notyet compressed; in tables that contain SecureFile LOBs that are notcompressed, the system compresses the LOBs. In an option with the "only"suffix (for example, "ctablob_only"), the system skips all tables in theselection that do not require any compression actions. This applies totables and LOBs that already have the correct compression status. Thesystem also checks the compression degree of LOBs.The option "-lc|-lobcompr" defines the compression degree of SecureFileLOBs and applies only to the following compression actions: clob, ctablob,clob_only, and ctablob_only.If you did not set the option "-c|-compress", the system does not changethe compression status of the reorganized tables and LOBs during thereorganization.

Note 4: You can also set the compression options for the actions "lob2lob"and "long2lob". This means that you can perform the conversion to new LOBsand the LOB table compression (of tables that contain LOBs) in oneoperation (see below).

1.4 Exception handling during table compression-----------------------------------------------We recommend not to compress the following tables in Oracle (if thesetables have SecureFile LOBs, you should also not compress them):

- Tables with more than 255 columns (Oracle requirement) - SAP pool tables (for example, ATAB, UTAB) - SAP cluster tables (for example, CDCLS, RFBLG) - INDX-type tables (for example, BALDAT, SOC3) - The ABAP source and ABAP load tables REPOSRC and REPOLOAD - The update tables VBHDR, VBDATA, VBMOD, and VBERROR - The RFC tables ARFCSSTATE, ARFCSDATA, ARFCRSTATE,TRFCQDATA, TRFCQIN, TRFCQOUT, TRFCQSTATE, QRFCTRACE, andQRFCLOG - NRIV

The majority of the tables mentioned above (pool, cluster, INDX-type, ABAPsource, and ABAP loads) are already compressed in the SAP system.Therefore, a second compression in the Oracle system does not make sense.A similar situation applies to tables that are used intensively in thequeuing mode (such as update tables and RFC tables). For RFC tables, thisapplies only if the system is integrated in an SAP system group and anintensive data exchange takes place between the systems.

These recommendations are accommodated in BRSPACE as follows: - Tables with more than 255 columns are automatically excluded from tablecompressions. - Pool and cluster tables, INDX-type tables, ABAP source and ABAP loadtables, and update tables are excluded using the special option "-SCT"(skip compressed table). - RFC tables are excluded using the special parameter "_reorg_excl_tab",in which you can specify the tables explicitly.

To handle RFC tables, we recommend that you create a separate BRSPACEprofile file in the directory $ORACLE_HOME/dbs (Unix) or%ORACLE_HOME%\database (for example, with the name "reorgEXCL.tab"). This

Page 4: sapnote_0001431296.pdf

18.08.2013 Page 4 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

profile file will then have the following contents (only one parameter):

_reorg_excl_tab = (ARFCSSTATE, ARFCSDATA, ARFCRSTATE,TRFCQDATA,TRFCQIN, TRFCQOUT, TRFCQSTATE, QRFCTRACE, QRFCLOG, NRIV)

The special handling of RFC tables is justified by its optional character.For systems that remain in isolation (without an intensive data exchangewith other systems via RFC), you do not have to create or use a separateBRSPACE profile file.

The special option "-SCT" and the special profile "reorgEXCL.tab" mentionedabove are used according to the examples listed below. Since the list oftables in the special parameter "_reorg_excl_tab" does not currentlycontain any tables with LONG or LOB fields, the special profile"reorgEXCL.tab" is used only in point 2.3.

The list of the tables to be excluded may not necessarily be complete andmay be changed and extended over time and with more experience.

2. LOB conversion and table compression of the entire database=================================================================In principle, an LOB conversion and table compression of the entiredatabase using BRSPACE 7.20 runs in a similar way to a migration tolocally-managed tablespaces that is described in Note 646681 (both actionscan even be combined). We therefore recommend that you move all tables intonewly-created tablespaces. The tablespaces must be locally-managed (LMTS)and automatic segment space management (ASSM) must be activated. When youuse BRSPACE to create the new tablespaces, you must ensure that the tabledata classes (tabart) are handled exactly correctly. For more details, seeNote 646681. The newly-created tablespaces did not have to activate thecompression attribute at tablespace level.

If there is a lack of disk space, you can also perform the entire operationwithin the existing tablespaces. These must already be LMTS with ASSM. Whenyou do this, you must accept the disadvantage that tablespace fragmentingis not solved; instead, it actually increases.

The entire action runs online (online reorganization). That is, it cantheoretically take place while the SAP system is running. However, sincethis requires a large amount of resources, the operation of the SAP systemis restricted. We recommend that you perform this when the system load islow or, if possible, when the SAP system is stopped.

The LOB conversion and table compression of the entire database normallytakes place by tablespace. To do this, the option "-s <src_tsp>" is used torestrict the table selection to tables from the specified source tablespace<src_tsp>. You can also specify several tablespaces in the option "-s".This is the case if you want to change the tablespace layout at the sametime.

The entire operation can be performed by using new tablespaces in thefollowing steps:

2.1 Converting tables with LONG fields online---------------------------------------------After you create the new tablespace <new_tsp>, in the first step, thesystem converts LONG fields (LONG and LONG RAW) into SecureFile LOB fields

Page 5: sapnote_0001431296.pdf

18.08.2013 Page 5 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

(CLOB and BLOB).This step must be executed only if LONG fields are still used in the SAPschema. This is the case if the SAP system was installed before BasisRelease 7.00 and a migration to LOB fields did not yet take place. As ofBasis Release 7.00, the system no longer creates tables with LONG fields innew installations.

* Converting the tables with LONG fields that are not compressed in the SAPsystem:

brspace -u / -f tbreorg -a long2lob -o sap<sid> -s <src_tsp>-t allsel -n <new_tsp> -c ctablob -lc medium -SCT

Where: <src_tsp> - Source tablespace <new_tsp> - New target tablespace "-c ctablob" - Activates the compression of the tables and theSecureFile LOBs that are to be created "-lc medium" - Specifies the compression degree of the SecureFile LOBsthat are to be created as "medium" (instead, you can also use "low" or"high"). "-SCT" - causes all tables that were compressed in the SAP system to beskipped (pool and cluster tables, INDX-type tables, REPOSRC, REPOLOAD, andthe update tables VBHDR, VBDATA, VBMOD, VBERROR).

* Converting the tables with LONG fields that are compressed in the SAPsystem:

brspace -u / -f tbreorg -a long2lob -o sap<sid> -s <src_tsp>-t allsel -n <new_tsp>

These tables are compressed again in the Oracle system.

2.2 Converting tables with old LOB fields online--------------------------------------------------In this step, BasicFile LOB fields (CLOB and BLOB) are converted toSecureFile LOB fields.

* Converting the tables with old LOB fields that are not compressed in theSAP system:

brspace -u / -f tbreorg -a lob2lob -o sap<sid> -s <src_tsp> -tallsel -n <new_tsp> -c ctablob -lc medium -SCT

Where: <src_tsp> - Source tablespace <new_tsp> - New target tablespace "-c ctablob" - Activates the compression of the tables and theSecureFile LOBs that are to be created "-lc medium" - Specifies the compression degree of the SecureFile LOBsthat are to be created as "medium" (instead, you can also use "low" or"high"). "-SCT" - Causes all tables that were compressed in the SAP system to beskipped (for example, pool and cluster tables).

* Converting the tables with old LOB fields that are compressed in the SAPsystem:

brspace -u / -f tbreorg -a lob2lob -o sap<sid> -s <src_tsp> -tallsel -n <new_tsp>

Page 6: sapnote_0001431296.pdf

18.08.2013 Page 6 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

These tables are compressed again in the Oracle system.

2.3 Compress tables without LONGs and without old LOBs--------------------------------------------------------In this step, tables without LONG and LOB fields are reorganized and,therefore, compressed.

* Compressing the tables without LONG and LOB fields:

brspace -u / -p reorgEXCL.tab -f tbreorg -a reorg -o sap<sid>-s <src_tsp> -t allsel -n <new_tsp> -c ctablob -SCT

Where: -p reorgEXCL.tab - Special profile with exception tables <src_tsp> - Source tablespace <new_tsp> - New target tablespace "-SCT" - Causes all tables that were compressed in the SAP system to beskipped "-c ctablob" should enter the new LOBs instead of "-c ctab" (ifavailable)

You can perform this action both in online mode and in offline mode(option: "-m online|offline"). Offline mode is usually much faster forsmaller tables. However, the tables are locked in this case.

2.4 Reorganizing the remaining tables from the source tablespace---------------------------------------------------------------In this step, the remaining tables from the source tablespace arereorganized and, therefore, moved to the new tablespace. For example, theseare the tables that are not to be compressed and were excluded from theprevious steps due to the option "-SCT".

* Reorganization of the remaining tables from the source tablespace:

brspace -u / -f tbreorg -a reorg -o sap<sid> -s <src_tsp> -tallsel -n <new_tsp>

These tables are not compressed in the Oracle system.The source tablespace may be blank before this step and the system may nolonger find any tables during the BRSPACE call.You can perform this action both in online mode and in offline mode(option: "-m online|offline"). Offline mode is usually much faster forsmaller tables. However, the tables are locked in this case.After this step, the reorganization of all tables from the sourcetablespace ends and you can delete the tablespace. The new tablespace<new_tsp> is then renamed to the same as the old source tablespace(<src_tsp>). You must perform both actions due to the handling of tabledata classes with BRSPACE.

2.5 Additional information-----------------------------Remark 1:If you want to store indexes in a separate index tablespace, you must alsoset the option "-i <ind_tsp>" in addition to the option "-n <new_tsp>".

Remark 2:You can accelerate the entire process by using reorg threads to activateparallel processing; you can use the option "-p <par_threads>" to do this.

Page 7: sapnote_0001431296.pdf

18.08.2013 Page 7 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

The value of <par_threads> can be set to 4, 8, or even 16 (for example) toobtain the best possible throughput. A corresponding number of systemresources must also be available.However, when you determine the parallelism, you must consider that the"locality" of the table extents in the target tablespace may be impaired.For large tables, you can use the option "-e <par_degree>" to activateparallel processing within the package DBMS_REDEFINITION. However, this mayalso have the disadvantage that the "natural" sorting of the data recordsfrom the original tables may be lost.

Remark 3:In general, the table and LOB compression significantly reduce the spacerequired. However, the space that becomes free can be used in another wayonly if the INITIAL extent size of the tables is not set too high. Otherwise, an unnecessarily large amount of space is allocated for thetable segment, only some of which is occupied. You can determine the sizeof the INITIAL extent for the reorganization process using the BRSPACEoption "-l|-initial <category>". You should use this option for tables witha very large INITIAL extent. For more information about this, see Note914174 point 3.

3. Special procedures for LOB conversion and table compression===================================================================This section provides information about selected example proceduresrelating to LOB conversion and table compression:

3.1 Changing the compression degree of SecureFile LOBs--------------------------------------------------------You can use the following BRSPACE call to change the compression degree(for example, from "medium" to low"):

brspace -u / -p reorgEXCL.tab -f tbreorg -o sap<sid> -t allsel-c clob_only -lc low -SCT

This processes only tables with SecureFile LOBs that do not have the LOBcompression degree "low". This does not change the table compressionstatus. The profile reorgEXCL.tab and the option "-SCT" ensure that tablesthat are compressed in the SAP system and other exception tables are notprocessed.

3.2 Decompressing individual tables------------------------------------------Proceed as follows to decompress individual tables (including decompressingany SecureFile LOBs contained within them):

brspace -u / -f tbreorg -o sap<sid> -tVBDATA,VBHDR,VBLOG,VBMOD -c dtablob

3.3 Compressing individual pool or cluster tables-----------------------------------------------------------In exceptional situations (for example, if we recommend it), you cancompress individual pool or cluster tables as follows;

brspace -u / -f tbreorg -o sap<sid> -t ATAB -c ctablob

When you do this, the system selects the LOB compression degree "medium" bydefault.Caution: Currently, there are no cases that would justify this exception.

Page 8: sapnote_0001431296.pdf

18.08.2013 Page 8 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

3.4 Converting from new to old LOBs-------------------------------------In exceptional situations (for example, if we recommend it), it may makesense to convert tables with SecureFile LOBs back to BasicFile LOBs asfollows:

brspace -u / -f tbreorg -o sap<sid> -a lob2lob -t allsel -COL

Here, the system processes only tables with SecureFile LOBs. The SecureFileLOBs are decompressed automatically because BasicFile LOBs do not supportcompression. If you want to decompress the table at the same time, you mustalso set the option "-c dtab".Caution: Currently, there are no cases that would justify this exception.

3.5 "Normal" reorganization of tables-----------------------------------------In a "normal" reorganization of tables (action "reorg", option"-c|-compress" not set), the system does not change the compression statusof tables and LOBs:

brspace -u / -f tbreorg -o sap<sid> -t "T*" -n <new_tsp>

As a result, the system moves tables that have a name beginning with "T" toa new tablespace without changing the compression status.

Other termsSecureFile LOBs, compression, BR*Tools

Reason and PrerequisitesReason: This is an advance development.Prerequisites: BR*Tools 7.20, Oracle 11gDue to Oracle Bugs 9531984 and 9482399, you must apply the following bundlepatches/patch collections (or higher):UNIX: SAP_112010_201005Windows: Patch Collection 5

SolutionImplemented in BRSPACE 7.20 patch level 1.Download the most recent BR*Tools 7.20 patch from SAPService Marketplace. The exact procedure is described in Notes 12741 and19466.

Header Data

Release Status: Released for CustomerReleased on: 05.02.2013 16:14:41Master Language: GermanPriority: Recommendations/additional infoCategory: Advance developmentPrimary Component: BC-DB-ORA-DBA Database Administration withOracle

Valid Releases

Page 9: sapnote_0001431296.pdf

18.08.2013 Page 9 of 9

SAP Note 1431296 - LOB conversion and table compressionwith BRSPACE 7.20

Software Component Release FromRelease

ToRelease

andSubsequent

SAP_BASIS 71 720 720

Related Notes

Number Short Text

1818320 Oracle 11g Advanced Compression for LONG data restriction

1464156 Support for index compression in BRSPACE 7.20

1436352 Oracle 11g Advanced Compression for SAP Systems

1430669 BR*Tools support for Oracle 11g

1426979 Oracle 11g: SecureFiles - The new way to store LOB data

1289494 FAQ: Oracle compression