06.01.2013 Views

Download PDF - IBM Redbooks

Download PDF - IBM Redbooks

Download PDF - 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.

2. Ensure that the user who is creating hints has one of the following authorizations:<br />

– SYSADM<br />

– SYSCTRL<br />

– SYSOPR<br />

– SQLADM<br />

3. Create an instance of the DSN_USERQUERY_TABLE in the schema of the user using the<br />

following statement:<br />

CREATE TABLE userid.DSN_USERQUERY_TABLE<br />

(<br />

QUERYNO INTEGER NOT NULL PRIMARY KEY,<br />

SCHEMA VARCHAR(128) NOT NULL DEFAULT ' ',<br />

HINT_SCOPE SMALLINT NOT NULL DEFAULT 0,<br />

QUERY_TEXT CLOB(2M) NOT NULL,<br />

QUERY_ROWID ROWID NOT NULL GENERATED ALWAYS,<br />

QUERYID BIGINT NOT NULL DEFAULT 0,<br />

USERFILTER CHAR(8) NOT NULL DEFAULT ' ',<br />

OTHER_OPTIONS CHAR(128) NOT NULL DEFAULT ' ',<br />

COLLECTION VARCHAR(128) NOT NULL DEFAULT ' ',<br />

PACKAGE VARCHAR(128) NOT NULL DEFAULT ' ',<br />

VERSION VARCHAR(128) NOT NULL DEFAULT ' ',<br />

REOPT CHAR(1) NOT NULL DEFAULT ' ',<br />

STARJOIN CHAR(1) NOT NULL DEFAULT ' ',<br />

MAX_PAR_DEGREE INTEGER NOT NULL DEFAULT -1,<br />

DEF_CURR_DEGREE CHAR(3) NOT NULL DEFAULT ' ',<br />

SJTABLES INTEGER NOT NULL DEFAULT -1,<br />

OTHER_PARMS VARCHAR(128) NOT NULL DEFAULT ' '<br />

) CCSID UNICODE;<br />

4. Create a plan table in the schema of the user. When using a schema for which SAP DBA<br />

Cockpit has been set up, this table is automatically created by SAP. Otherwise, use the<br />

syntax from member DSNTESC of the SDSNSAMP library.<br />

5. Create an index on the plan table by using the following statement:<br />

CREATE INDEX userid.PLAN_TABLE_HINT_IX ON<br />

userid.PLAN_TABLE<br />

( "QUERYNO",<br />

"APPLNAME",<br />

"PROGNAME",<br />

"VERSION",<br />

"COLLID",<br />

"OPTHINT" )<br />

Additional optimization hints<br />

For more information about suggesting access paths by creating statement-level access path<br />

hints and specifying optimization parameters, go to the DB2 10 for z/OS Information Center at<br />

the following address, and search for Suggesting access paths by creating statement level<br />

access path hints:<br />

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.<br />

db2z10.doc%2Fsrc%2Falltoc%2Fdb2z_10_prodhome.htm<br />

52 Running SAP Solutions with <strong>IBM</strong> DB2 10 for z/OS on the <strong>IBM</strong> zEnterprise System

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

Saved successfully!

Ooh no, something went wrong!