19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.9.1 Per<strong>for</strong>mance<br />

We can implement RACF external security with MLS at the <strong>DB2</strong> object level to control access<br />

to databases, table spaces, tables, views, indexes, storage groups, buffer pools, plans,<br />

packages, stored procedures, and more. This is done by implementing the <strong>DB2</strong> and RACF<br />

security exit DSNX@XAC. See the <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Administration Guide,<br />

SC18-7413-01, and the <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 RACF Access Control Module Guide,<br />

SC18-7433, <strong>for</strong> discussions regarding how to implement RACF External Security <strong>for</strong> <strong>DB2</strong>.<br />

At the time of writing this book, there have been no per<strong>for</strong>mance studies conducted<br />

comparing RACF External Security <strong>for</strong> <strong>DB2</strong> objects, (either with or without using MLS), with<br />

<strong>DB2</strong> native security. However, we consider the impact of <strong>DB2</strong> External Security over <strong>DB2</strong><br />

native security (GRANT and REVOKE) insignificant.<br />

We can also implement RACF MLS security with row level granularity, as is described here.<br />

These per<strong>for</strong>mance studies explore the per<strong>for</strong>mance impact of <strong>DB2</strong> Row Level Security<br />

where there was no RACF external security at all, only <strong>DB2</strong> native security. No application<br />

changes were made and there was no “application” row level security implemented (<strong>for</strong><br />

example via views). Obviously, if you wish to change your application to remove any<br />

application-implemented row level security techniques and implement <strong>DB2</strong> Row Level<br />

Security, your application probably becomes less complex and there<strong>for</strong>e less CPU intensive.<br />

Any CPU overhead caused by <strong>DB2</strong> Row Level Security should be offset by these savings.<br />

A user or thread has only one SECLABEL “active” at any one time. When rows are accessed,<br />

<strong>DB2</strong> checks the thread’s, or user’s SECLABEL value with each new SECLABEL value from<br />

the rows being accessed. To avoid going to RACF <strong>for</strong> each and every row accessed, <strong>DB2</strong><br />

caches all the SECLABEL values that have been checked, both successfully or<br />

unsuccessfully. The cache is maintained per thread and is flushed on commit and rollback.<br />

So, if immediate changes are required in the security policy, then long-running applications<br />

which have not committed or rolled back may need to be canceled.<br />

In a general sense, you can think of <strong>DB2</strong> evaluating SECLABEL values in the same way as<br />

<strong>DB2</strong> evaluating Stage 1 predicates, only in that <strong>DB2</strong> attempts to per<strong>for</strong>m SECLABEL<br />

checking as a Stage 1 activity. During access path selection, the <strong>DB2</strong> optimizer does not<br />

consider the task of evaluating the SECLABELs the same way as it would any Stage 1<br />

predicates. This is similar to resolving referential constraints. However, the need to evaluate<br />

SECLABEL values can impact SQL access paths. For example, Index Only access may now<br />

be regressed to an Index plus data access (to retrieve each row’s SECLABEL value), if the<br />

index being selected does not also contain the SECLABEL column. Row Level Security can<br />

there<strong>for</strong>e have a significant impact on your application per<strong>for</strong>mance by changing access<br />

paths.<br />

The overhead of Row Level Security in <strong>DB2</strong> is recorded as Accounting class 2 CPU time and<br />

varies depending on the complexity of your SQL, how many rows your query needs to “touch”<br />

during Stage 1 processing, and how many different SECLABEL values you have in your table.<br />

The more complex the query, the less impact Row Level Security has on CPU. This is<br />

because the overhead of Row Level Security is diluted with more CPU intensive queries.<br />

There<strong>for</strong>e, your mileage will vary!<br />

SELECT<br />

The user's SECLABEL is compared to the data SECLABEL of each row to be selected, also<br />

<strong>for</strong> the rows that do not qualify. If the SECLABEL of the user dominates the SECLABEL of the<br />

row, <strong>DB2</strong> returns the row. If the SECLABEL of the user does not dominate the SECLABEL of<br />

the row, <strong>DB2</strong> does not return the data from that row, and <strong>DB2</strong> does not generate an error.<br />

Chapter 4. <strong>DB2</strong> subsystem per<strong>for</strong>mance 195

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

Saved successfully!

Ooh no, something went wrong!