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.

condition, generated by <strong>SAP</strong> <strong>BI</strong> upon the deletion criteria specified by the <strong>BI</strong><br />

user.<br />

Example 4-2 New implementation of very large data deletions<br />

repeat<br />

DELETE FROM <br />

WHERE (kf1, kf2, ..., kfn) IN<br />

( SELECT kf1, kf2, ..., kfn FROM <br />

WHERE <br />

FETCH FIRST ROWS ONLY );<br />

COMMIT WORK;<br />

until nrows_deleted < paketsize.<br />

To split up this delete into a loop of delete operations with each one deleting<br />

rows only, the statement FETCH FIRST n ROWS ONLY could be<br />

used. After each execution of the DELETE statement, a commit is per<strong>for</strong>med.<br />

The loop continues until all rows specified are deleted.<br />

So the deletion of the data is per<strong>for</strong>med in a loop with a COMMIT after every<br />

deletion of one small packet of rows (packetsize can be configured). This new<br />

<strong>SAP</strong> <strong>BI</strong> implementation <strong>for</strong> data deletion will be available <strong>for</strong> the next <strong>SAP</strong> <strong>BI</strong><br />

release coming after <strong>BI</strong> 7.0. <strong>SAP</strong> plans to make this new implementation <strong>for</strong><br />

selective deletion also available <strong>for</strong> the <strong>BI</strong> 7.00 release, running with <strong>DB2</strong> 9 by<br />

setting a special RSADMIN parameter. This will be documented in a future <strong>SAP</strong><br />

note.<br />

Example 4-3 shows the delete statement that is generated to delete a maximum<br />

of 100,000 rows from the E- fact table of cube IUSALES.<br />

Example 4-3 Using FETCH FIRST n ROWS ONLY <strong>for</strong> E- fact table<br />

DELETE FROM "/<strong>BI</strong>C/EIUSALES"<br />

WHERE ("KEY_IUSALESP", "KEY_IUSALEST", "KEY_IUSALESU", "KEY_IUSALES1",<br />

"KEY_IUSALES2", "KEY_IUSALES3")<br />

IN ( SELECT "KEY_IUSALESP",<br />

"KEY_IUSALEST","KEY_IUSALESU","KEY_IUSALES1","KEY_IUSALES2","KEY_IUS<br />

ALES3"<br />

FROM "/<strong>BI</strong>C/EIUSALES"<br />

WHERE <br />

FETCH FIRST 100000 ROWS ONLY )<br />

52 <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!