07.02.2013 Views

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.4.4 Partitioning a DataStore object<br />

Ideally, an DataStore object would be partitioned as desired be<strong>for</strong>e it is<br />

populated with data. However, in reality it is often partitioned after it contains<br />

data (after it has become large and queries are found not to be per<strong>for</strong>ming well).<br />

Converting a <strong>DB2</strong> table from non-partitioned to partitioned involves dropping and<br />

recreating the table, so you must take care to preserve the data in the table.<br />

We recommend <strong>using</strong> a combination of <strong>SAP</strong> and <strong>DB2</strong> tools to convert an<br />

DataStore object from non-partitioned to partitioned. According to the <strong>SAP</strong> 6.40<br />

DBA Guide, <strong>DB2</strong> utilities should be used to move data between tables if the table<br />

has more than one million rows or it is larger than 100 MB. In general, DataStore<br />

object tables meet this requirement. <strong>SAP</strong> table conversion techniques use SQL<br />

SELECTs and INSERTs to per<strong>for</strong>m the data transfer, which is not as efficient as<br />

<strong>DB2</strong> unload and load utilities when processing large amounts of data.<br />

In the newer releases of <strong>SAP</strong> <strong>BI</strong>, this function will be implemented in the same<br />

way as InfoCube E- fact table repartitioning, described in 6.2, “Repartitioning of<br />

InfoCubes” on page 78.<br />

The following procedure describes how to convert an DataStore object table from<br />

non-partitioned to partitioned <strong>using</strong> table-controlled partitioning. It is taken from<br />

the <strong>SAP</strong> 6.40 DBA Guide, but it has been expanded and tailored <strong>for</strong><br />

table-controlled partitioning, as table controlled partitioning is the recommended<br />

method in <strong>DB2</strong> 9 <strong>for</strong> z/<strong>OS</strong>.<br />

1. Call transaction SE16 (Data Browser) to check the number of rows in the<br />

table to be partitioned. (This is a reality check to verify that you have the same<br />

amount of data in the table be<strong>for</strong>e and after partitioning.)<br />

2. Create a quiesce point <strong>for</strong> the entire <strong>DB2</strong> subsystem. Be sure that you have<br />

full image copies <strong>for</strong> all the <strong>SAP</strong> data. Do not allow other users write access<br />

to the <strong>DB2</strong> system until the table conversion is completed.<br />

3. Use a <strong>DB2</strong> utility to unload the data in the table to be partitioned to a<br />

sequential file. In this example, we used the <strong>DB2</strong> UNLOAD utility. See<br />

Example 7-1 <strong>for</strong> sample JCL <strong>for</strong> the <strong>DB2</strong> UNLOAD utility.<br />

Another option is to use the <strong>DB2</strong> REORG utility with the “UNLOAD<br />

EXTERNAL” option. (For complete details on the <strong>DB2</strong> utilities, refer to <strong>DB2</strong><br />

V9 Utility Guide and Reference.)<br />

Example 7-1 Example of JCL <strong>for</strong> <strong>DB2</strong> UNLOAD utility<br />

//UNLOAD JOB (999,POK),'REORG',CLASS=A,REGION=0M,<br />

// MSGCLASS=T,MSGLEVEL=(1,1),NOTIFY=&SYSUID<br />

/*JOBPARM S=SC04<br />

// JCLLIB ORDER=(<strong>DB2</strong>TU.PROCLIB)<br />

//STEP1 EXEC DSNUPROC,UID=SMPLUNLD,UTPROC=,SYSTEM=<strong>DB2</strong>T<br />

114 <strong>Best</strong> <strong>Practices</strong> <strong>for</strong> <strong>SAP</strong> <strong>BI</strong> <strong>using</strong> <strong>DB2</strong> 9 <strong>for</strong> z/<strong>OS</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!