ibm 5770-af3), and to any subsequent r eleases until otherwise indicated in new editions. make sur e...

Download IBM 5770-AF3), and to any subsequent r eleases until otherwise indicated in new editions. Make sur e you ar e using the corr ect edition for the level of the pr oduct. Specific changes

If you can't read please download the document

Upload: trananh

Post on 25-Mar-2018

222 views

Category:

Documents


8 download

TRANSCRIPT

  • Db2 12 for z/OS

    Command Reference

    SC27-8848-02

    IBM

  • Db2 12 for z/OS

    Command Reference

    SC27-8848-02

    IBM

  • NotesBefore using this information and the product it supports, be sure to read the general information under Notices at theend of this information.

    Subsequent editions of this PDF will not be delivered in IBM Publications Center. Always download the latest edition fromDb2 12 for z/OS Product Documentation.

    May 14, 2018 edition

    This edition applies to Db2 12 for z/OS (product number 5650-DB2), Db2 12 for z/OS Value Unit Edition (productnumber 5770-AF3), and to any subsequent releases until otherwise indicated in new editions. Make sure you areusing the correct edition for the level of the product.

    Specific changes are indicated by a vertical bar to the left of a change. A vertical bar to the left of a figure captionindicates that the figure has changed. Editorial changes that have no technical significance are not noted.

    Copyright IBM Corporation 1983, 2017.US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

    http://www-01.ibm.com/support/docview.wss?uid=swg27047206

  • Contents

    About this information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiWho should read this information. . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiDb2 Utilities Suite for z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiTerminology and citations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiAccessibility features for Db2 12 for z/OS . . . . . . . . . . . . . . . . . . . . . . . . . xiiiHow to send your comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiiHow to read syntax diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv

    Part 1. About Db2 and related commands . . . . . . . . . . . . . . . . . . . 1

    Chapter 1. Commands in Db2 . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    Chapter 2. Command types and environments in Db2 . . . . . . . . . . . . . . . . 9

    Chapter 3. ABEND (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    Chapter 4. -ACCESS DATABASE (Db2) . . . . . . . . . . . . . . . . . . . . . . 17

    Chapter 5. -ACTIVATE (Db2). . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    Chapter 6. -ALTER BUFFERPOOL (Db2) . . . . . . . . . . . . . . . . . . . . . 27

    Chapter 7. -ALTER GROUPBUFFERPOOL (Db2) . . . . . . . . . . . . . . . . . . 37

    Chapter 8. -ALTER UTILITY (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 43

    Chapter 9. -ARCHIVE LOG (Db2). . . . . . . . . . . . . . . . . . . . . . . . . 47

    Chapter 10. BIND PACKAGE (DSN). . . . . . . . . . . . . . . . . . . . . . . . 53

    Chapter 11. BIND PLAN (DSN). . . . . . . . . . . . . . . . . . . . . . . . . . 63

    Chapter 12. BIND QUERY (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . 69

    Chapter 13. BIND SERVICE (DSN) . . . . . . . . . . . . . . . . . . . . . . . . 73

    Chapter 14. BIND and REBIND options for packages, plans, and services . . . . . . . 77ACCELERATOR bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77ACQUIRE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78ACTION bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78APCOMPARE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80APPLCOMPAT bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81APRETAINDUP bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82APREUSE bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83APREUSESOURCE bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85ARCHIVESENSITIVE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86BUSTIMESENSITIVE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86CACHESIZE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87COLLID bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88CONCENTRATESTMT bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . 88CONCURRENTACCESSRESOLUTION bind option . . . . . . . . . . . . . . . . . . . . . . 89

    Copyright IBM Corp. 1983, 2017 iii

    ||

    ||

    ||

    ||

    ||

    ||

  • COPY bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90CURRENTDATA bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92CURRENTSERVER bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93DBPROTOCOL bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93DATE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94DEC bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95DECDEL bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95DEFER and NODEFER bind options . . . . . . . . . . . . . . . . . . . . . . . . . . . 96DEGREE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97DEPLOY bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98DESCRIPTION bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99DESCSTAT bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99DISCONNECT bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100DYNAMICRULES bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101ENABLE and DISABLE bind options . . . . . . . . . . . . . . . . . . . . . . . . . . 106ENCODING bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108EXPLAIN bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110EXTENDEDINDICATOR bind option . . . . . . . . . . . . . . . . . . . . . . . . . . 112FILTER bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113FLAG bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113GENERIC bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113GETACCELARCHIVE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . 114IMMEDWRITE bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115ISOLATION bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117KEEPDYNAMIC bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119LIBRARY bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120MEMBER bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121NAME bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122OPTHINT bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122OPTIONS bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123OWNER bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124PACKAGE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125PATH bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126PATHDEFAULT bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128PKLIST and NOPKLIST bind options . . . . . . . . . . . . . . . . . . . . . . . . . . 128PLAN bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129PLANMGMT bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130PROGAUTH bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132QUALIFIER bind option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133QUERYACCELERATION bind option . . . . . . . . . . . . . . . . . . . . . . . . . . 133QUERYID bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135RELEASE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135REOPT bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138ROUNDING bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140SQLDDNAME bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141SQLENCODING bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142SQLERROR bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142SQLRULES bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143STRDEL bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144SWITCH bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144SYSTIMESENSITIVE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145TIME bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146VALIDATE bind option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

    Chapter 15. Specification of Db2 for z/OS bind options from IBM Data Server clientsand drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

    Chapter 16. -CANCEL THREAD (Db2) . . . . . . . . . . . . . . . . . . . . . . 151

    Chapter 17. DCLGEN (DECLARATIONS GENERATOR) (DSN) . . . . . . . . . . . . 157

    iv Command Reference

    ||||

    ||

    ||

    ||||

    ||

  • Chapter 18. -DISPLAY ACCEL (Db2) . . . . . . . . . . . . . . . . . . . . . . . 167

    Chapter 19. -DISPLAY ARCHIVE (Db2) . . . . . . . . . . . . . . . . . . . . . . 171

    Chapter 20. -DISPLAY BUFFERPOOL (Db2) . . . . . . . . . . . . . . . . . . . 173

    Chapter 21. -DISPLAY DATABASE (Db2) . . . . . . . . . . . . . . . . . . . . . 193

    Chapter 22. -DISPLAY DDF (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 213

    Chapter 23. -DISPLAY DYNQUERYCAPTURE (Db2) . . . . . . . . . . . . . . . . 217

    Chapter 24. -DISPLAY FUNCTION SPECIFIC (Db2). . . . . . . . . . . . . . . . . 219

    Chapter 25. -DISPLAY GROUP (Db2) . . . . . . . . . . . . . . . . . . . . . . 223

    Chapter 26. -DISPLAY GROUPBUFFERPOOL (Db2) . . . . . . . . . . . . . . . . 227

    Chapter 27. -DISPLAY LOCATION (Db2) . . . . . . . . . . . . . . . . . . . . . 235

    Chapter 28. -DISPLAY LOG (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 241

    Chapter 29. -DISPLAY PROCEDURE (Db2) . . . . . . . . . . . . . . . . . . . . 243

    Chapter 30. -DISPLAY PROFILE (Db2) . . . . . . . . . . . . . . . . . . . . . . 247

    Chapter 31. -DISPLAY RLIMIT (Db2) . . . . . . . . . . . . . . . . . . . . . . . 249

    Chapter 32. -DISPLAY STATS (Db2) . . . . . . . . . . . . . . . . . . . . . . . 251

    Chapter 33. -DISPLAY THREAD (Db2) . . . . . . . . . . . . . . . . . . . . . . 253

    Chapter 34. -DISPLAY TRACE (Db2) . . . . . . . . . . . . . . . . . . . . . . . 269

    Chapter 35. -DISPLAY UTILITY (Db2) . . . . . . . . . . . . . . . . . . . . . . 279

    Chapter 36. DSN (TSO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

    Chapter 37. DSNH (TSO CLIST). . . . . . . . . . . . . . . . . . . . . . . . . 289

    Chapter 38. END (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

    Chapter 39. FREE STABILIZED DYNAMIC QUERY (DSN) . . . . . . . . . . . . . . 321

    Chapter 40. FREE PACKAGE (DSN) . . . . . . . . . . . . . . . . . . . . . . . 323

    Chapter 41. FREE PLAN (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . 327

    Chapter 42. FREE QUERY (DSN) . . . . . . . . . . . . . . . . . . . . . . . . 329

    Chapter 43. FREE SERVICE (DSN) . . . . . . . . . . . . . . . . . . . . . . . 333

    Chapter 44. MODIFY admtproc,APPL=SHUTDOWN . . . . . . . . . . . . . . . . 335

    Contents v

    ||

    ||

    ||

    ||

  • Chapter 45. MODIFY admtproc,APPL=TRACE . . . . . . . . . . . . . . . . . . 337

    Chapter 46. -MODIFY DDF (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 339

    Chapter 47. MODIFY irlmproc,ABEND (z/OS IRLM) . . . . . . . . . . . . . . . . 345

    Chapter 48. MODIFY irlmproc,DIAG (z/OS IRLM) . . . . . . . . . . . . . . . . . 347

    Chapter 49. MODIFY irlmproc,PURGE (z/OS IRLM) . . . . . . . . . . . . . . . . 349

    Chapter 50. MODIFY irlmproc,SET (z/OS IRLM) . . . . . . . . . . . . . . . . . . 351

    Chapter 51. MODIFY irlmproc,STATUS (z/OS IRLM) . . . . . . . . . . . . . . . . 355

    Chapter 52. -MODIFY TRACE (Db2) . . . . . . . . . . . . . . . . . . . . . . . 361

    Chapter 53. REBIND PACKAGE (DSN) . . . . . . . . . . . . . . . . . . . . . . 365

    Chapter 54. REBIND PLAN (DSN) . . . . . . . . . . . . . . . . . . . . . . . . 371

    Chapter 55. REBIND TRIGGER PACKAGE (DSN) . . . . . . . . . . . . . . . . . 377

    Chapter 56. -RECOVER BSDS (Db2). . . . . . . . . . . . . . . . . . . . . . . 383

    Chapter 57. -RECOVER INDOUBT (Db2) . . . . . . . . . . . . . . . . . . . . . 385

    Chapter 58. -RECOVER POSTPONED (Db2) . . . . . . . . . . . . . . . . . . . 389

    Chapter 59. -REFRESH DB2,EARLY (Db2) . . . . . . . . . . . . . . . . . . . . 393

    Chapter 60. -RESET GENERICLU (Db2) . . . . . . . . . . . . . . . . . . . . . 397

    Chapter 61. -RESET INDOUBT (Db2) . . . . . . . . . . . . . . . . . . . . . . 399

    Chapter 62. RUN (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403

    Chapter 63. -SET ARCHIVE (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 407

    Chapter 64. -SET LOG (Db2) . . . . . . . . . . . . . . . . . . . . . . . . . . 411

    Chapter 65. -SET SYSPARM (Db2) . . . . . . . . . . . . . . . . . . . . . . . 417

    Chapter 66. SPUFI (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . . . 421

    Chapter 67. -START ACCEL (Db2). . . . . . . . . . . . . . . . . . . . . . . . 423

    Chapter 68. START admtproc . . . . . . . . . . . . . . . . . . . . . . . . . 427

    Chapter 69. -START DATABASE (Db2) . . . . . . . . . . . . . . . . . . . . . . 429

    Chapter 70. -START DB2 (Db2) . . . . . . . . . . . . . . . . . . . . . . . . . 439

    Chapter 71. -START DDF (Db2) . . . . . . . . . . . . . . . . . . . . . . . . . 445

    vi Command Reference

  • Chapter 72. -START DYNQUERYCAPTURE (Db2) . . . . . . . . . . . . . . . . . 447

    Chapter 73. -START FUNCTION SPECIFIC (Db2) . . . . . . . . . . . . . . . . . 451

    Chapter 74. START irlmproc (z/OS IRLM) . . . . . . . . . . . . . . . . . . . . 455

    Chapter 75. -START PROCEDURE (Db2) . . . . . . . . . . . . . . . . . . . . . 461

    Chapter 76. -START PROFILE (Db2) . . . . . . . . . . . . . . . . . . . . . . . 465

    Chapter 77. -START RLIMIT (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 467

    Chapter 78. -START TRACE (Db2). . . . . . . . . . . . . . . . . . . . . . . . 469

    Chapter 79. -STOP ACCEL (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 487

    Chapter 80. STOP admtproc (z/OS ) . . . . . . . . . . . . . . . . . . . . . . . 489

    Chapter 81. -STOP DATABASE (Db2) . . . . . . . . . . . . . . . . . . . . . . 491

    Chapter 82. -STOP DB2 (Db2) . . . . . . . . . . . . . . . . . . . . . . . . . 499

    Chapter 83. -STOP DDF (Db2) . . . . . . . . . . . . . . . . . . . . . . . . . 501

    Chapter 84. -STOP DYNQUERYCAPTURE (Db2) . . . . . . . . . . . . . . . . . . 505

    Chapter 85. -STOP FUNCTION SPECIFIC (Db2) . . . . . . . . . . . . . . . . . . 507

    Chapter 86. STOP irlmproc (z/OS IRLM) . . . . . . . . . . . . . . . . . . . . . 511

    Chapter 87. -STOP PROCEDURE (Db2) . . . . . . . . . . . . . . . . . . . . . 513

    Chapter 88. -STOP PROFILE (Db2) . . . . . . . . . . . . . . . . . . . . . . . 517

    Chapter 89. -STOP RLIMIT (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 519

    Chapter 90. -STOP TRACE (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 521

    Chapter 91. -TERM UTILITY (Db2) . . . . . . . . . . . . . . . . . . . . . . . . 533

    Chapter 92. TRACE CT (z/OS IRLM) . . . . . . . . . . . . . . . . . . . . . . . 537

    Part 2. The Db2 command line processor . . . . . . . . . . . . . . . . . . 541

    Chapter 93. Tutorial: Using the Db2 command line processor . . . . . . . . . . . 543

    Chapter 94. Running the Db2 command line processor . . . . . . . . . . . . . . 547

    Chapter 95. ADD XMLSCHEMA DOCUMENT (Db2 command line processor) . . . . . 549

    Chapter 96. BIND (Db2 command line processor) . . . . . . . . . . . . . . . . . 551

    Chapter 97. CHANGE ISOLATION (Db2 command line processor) . . . . . . . . . . 553

    Contents vii

    ||

    ||

    ||

    ||

    ||

  • Chapter 98. CHANGE MAXCOLUMNWIDTH (Db2 command line processor) . . . . . . 555

    Chapter 99. CHANGE MAXLINESFROMSELECT (Db2 command line processor) . . . . 557

    Chapter 100. COMMIT (Db2 command line processor) . . . . . . . . . . . . . . . 559

    Chapter 101. COMPLETE XMLSCHEMA (Db2 command line processor) . . . . . . . 561

    Chapter 102. CONNECT (Db2 command line processor) . . . . . . . . . . . . . . 563

    Chapter 103. DESCRIBE CALL (Db2 command line processor) . . . . . . . . . . . 565

    Chapter 104. DESCRIBE TABLE (Db2 command line processor) . . . . . . . . . . 567

    Chapter 105. DISCONNECT (Db2 command line processor) . . . . . . . . . . . . 569

    Chapter 106. DISPLAY RESULT SETTINGS (Db2 command line processor) . . . . . . 571

    Chapter 107. ECHO (Db2 command line processor) . . . . . . . . . . . . . . . . 573

    Chapter 108. help (Db2 command line processor) . . . . . . . . . . . . . . . . . 575

    Chapter 109. LIST COMMAND OPTIONS (Db2 command line processor) . . . . . . . 577

    Chapter 110. LIST TABLES (Db2 command line processor) . . . . . . . . . . . . . 579

    Chapter 111. properties file (Db2 command line processor) . . . . . . . . . . . . 581

    Chapter 112. REGISTER XMLSCHEMA (Db2 command line processor) . . . . . . . . 585

    Chapter 113. REMOVE XMLSCHEMA (Db2 command line processor) . . . . . . . . 589

    Chapter 114. ROLLBACK (Db2 command line processor) . . . . . . . . . . . . . 591

    Chapter 115. SQL statements (Db2 command line processor). . . . . . . . . . . . 593

    Chapter 116. start (Db2 command line processor). . . . . . . . . . . . . . . . . 595

    Chapter 117. TERMINATE (Db2 command line processor) . . . . . . . . . . . . . 599

    Chapter 118. z/OS UNIX System Services (Db2 command line processor) . . . . . . 601

    Chapter 119. UPDATE COMMAND OPTIONS (Db2 command line processor) . . . . . 603

    Part 3. Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605

    Information resources for Db2 12 for z/OS and related products . . . . . . . . . . 607

    Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609Programming interface information . . . . . . . . . . . . . . . . . . . . . . . . . . . 610Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611Terms and conditions for product documentation . . . . . . . . . . . . . . . . . . . . . . 611Privacy policy considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612

    viii Command Reference

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

    ||

  • Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615

    Contents ix

  • x Command Reference

  • About this information

    This information describes numerous commands that system administrators,database administrators, and application programmers use. The commands are inalphabetical order for quick retrieval.

    Throughout this information, Db2 means Db2 12 for z/OS. References toother Db2 products use complete names or specific abbreviations.

    Important: To find the most up to date content, always use IBM KnowledgeCenter, which is continually updated as soon as changes are ready. PDF manualsare updated only when new editions are published, on an infrequent basis.

    This information assumes that function level 502 is activated in your Db2subsystem, and that your applications run with the equivalent V12R1M502application compatibility value.

    Overview of Db2 12 new function availabilityThe availability of new function depends on the type of enhancement, theactivated function level, and the application compatibility levels ofapplications. In the initial Db2 12 release, most new capabilities areenabled only after the activation of function level 500 or higher.

    Virtual storage enhancementsVirtual storage enhancements become available at the activation ofthe function level that introduces them or higher. Activation offunction level 100 introduces all virtual storage enhancements inthe initial Db2 12 release. That is, activation of function level 500introduces no virtual storage enhancements.

    Subsystem parametersNew subsystem parameter settings are in effect only when thefunction level that introduced them or a higher function level isactivated. Most subsystem parameter changes in the initial Db2 12release take effect in function level 500. For a list of these changes,see Subsystem parameter changes in Db2 12 (Db2 for z/OS What'sNew?).

    Optimization enhancementsOptimization enhancements become available after the activationof the function level that introduces them or higher, and fullprepare of the SQL statements. When a full prepare occursdepends on the statement type:v For static SQL statements, after bind or rebind of the packagev For non-stabilized dynamic SQL statements, immediately, unless

    the statement is in the dynamic statement cachev For stabilized dynamic SQL statements, after invalidation, free,

    or changed application compatibility level

    Activation of function level 100 introduces all optimizationenhancements in the initial Db2 12 release. That is, function level500 introduces no optimization enhancements.

    SQL capabilitiesNew SQL capabilities become available after the activation of thefunction level that introduces them or higher, for applications that

    Copyright IBM Corp. 1983, 2017 xi

    http://www.ibm.com/support/knowledgecenter/SSEPEK/db2z_prodhome.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK/db2z_prodhome.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_12_subsysparmchanges.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_12_subsysparmchanges.html

  • run at the equivalent application compatibility level or higher. NewSQL capabilities in the initial Db2 12 release become available infunction level 500 for applications that run at the equivalentapplication compatibility level or higher. You can continue to runSQL statements compatibly with lower function levels, or previousDb2 releases, including Db2 11 and DB2 10. For details, seeApplication compatibility levels in Db2 (Db2 Applicationprogramming and SQL)

    Who should read this informationThis information presents reference information for people involved in systemadministration, database administration, and operation. It presents detailedinformation on commands, including syntax, option descriptions, and examples foreach command.

    Db2 Utilities Suite for z/OS

    Important: In this Db2 12, Db2 Utilities Suite for z/OS is available as an optionalproduct. You must separately order and purchase a license to such utilities, anddiscussion of those utility functions in this publication is not intended to otherwiseimply that you have a license to them.

    Db2 12 utilities can use the DFSORT program regardless of whether you purchaseda license for DFSORT on your system. For more information, see the followinginformational APARs:v II14047v II14213v II13495

    Db2 utilities can use IBM Db2 Sort for z/OS (5655-W42) as an alternative toDFSORT for utility SORT and MERGE functions. Use of Db2 Sort for z/OSrequires the purchase of a Db2 Sort for z/OS license. For more information aboutDb2 Sort for z/OS, see Db2 Sort for z/OS.Related concepts:

    Db2 utilities packaging (Db2 Utilities)

    Terminology and citationsWhen referring to a Db2 product other than Db2 for z/OS, this information usesthe product's full name to avoid ambiguity.

    About the Db2 brand change: IBM is rebranding DB2 to Db2. As such, there willbe changes to all the Db2 offerings. For example, DB2 for z/OS is now referredto as Db2 for z/OS, beginning with Db2 11. While IBM implements the changeacross the Db2 family of products, you might see references to the original nameDB2 for z/OS or DB2 in different IBM web pages and documents. DB2 forz/OS and Db2 for z/OS refer to the same product, when the PID, EntitlementEntity, version, modification, and release information match. For more information,see Revised naming for IBM Db2 family products.

    The following terms are used as indicated:

    Db2 Represents either the Db2 licensed program or a particular Db2 subsystem.

    xii Command Reference

    ||||||||

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/apsg/src/tpc/db2z_applicationcompatibility.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/apsg/src/tpc/db2z_applicationcompatibility.htmlhttp://www.ibm.com/software/data/db2imstools/db2tools/db2-sort/http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/ugref/src/tpc/db2z_utlpackaging.htmlhttp://ibm.biz/Rebrand4Db2

  • Tivoli OMEGAMON XE for Db2 Performance Expert on z/OSRefers to any of the following products:v IBM Tivoli OMEGAMON XE for Db2 Performance Expert on z/OSv IBM Db2 Performance Monitor on z/OSv IBM Db2 Performance Expert for Multiplatforms and Workgroupsv IBM Db2 Buffer Pool Analyzer for z/OS

    C, C++, and C languageRepresent the C or C++ programming language.

    CICS Represents CICS Transaction Server for z/OS.

    IMS Represents the IMS Database Manager or IMS Transaction Manager.

    MVS Represents the MVS element of the z/OS operating system, which isequivalent to the Base Control Program (BCP) component of the z/OSoperating system.

    RACF

    Represents the functions that are provided by the RACF component of thez/OS Security Server.

    Accessibility features for Db2 12 for z/OSAccessibility features help a user who has a physical disability, such as restrictedmobility or limited vision, to use information technology products successfully.

    Accessibility features

    The following list includes the major accessibility features in z/OS products,including Db2 12 for z/OS. These features support:v Keyboard-only operation.v Interfaces that are commonly used by screen readers and screen magnifiers.v Customization of display attributes such as color, contrast, and font size

    Tip: The IBM Knowledge Center (which includes information for Db2 for z/OS)and its related publications are accessibility-enabled for the IBM Home PageReader. You can operate all features using the keyboard instead of the mouse.

    Keyboard navigation

    For information about navigating the Db2 for z/OS ISPF panels using TSO/E orISPF, refer to the z/OS TSO/E Primer, the z/OS TSO/E User's Guide, and the z/OSISPF User's Guide. These guides describe how to navigate each interface, includingthe use of keyboard shortcuts or function keys (PF keys). Each guide includes thedefault settings for the PF keys and explains how to modify their functions.

    Related accessibility information

    IBM and accessibility

    See the IBM Accessibility Center at http://www.ibm.com/able for more informationabout the commitment that IBM has to accessibility.

    How to send your commentsYour feedback helps IBM to provide quality information. Please send anycomments that you have about this book or other Db2 for z/OS documentation.

    About this information xiii

    http://www.ibm.com/able

  • Send your comments by email to [email protected] and include the name ofthe product, the version number of the product, and the number of the book. Ifyou are commenting on specific text, please list the location of the text (forexample, a chapter and section title or a help topic title).

    How to read syntax diagramsCertain conventions apply to the syntax diagrams that are used in IBMdocumentation.

    Apply the following rules when reading the syntax diagrams that are used in Db2for z/OS documentation:v Read the syntax diagrams from left to right, from top to bottom, following the

    path of the line.The symbol indicates the beginning of a statement.The symbol indicates that the statement syntax is continued on the nextline.The symbol indicates that a statement is continued from the previous line.The symbol indicates the end of a statement.

    v Required items appear on the horizontal line (the main path).

    required_item

    v Optional items appear below the main path.

    required_itemoptional_item

    If an optional item appears above the main path, that item has no effect on theexecution of the statement and is used only for readability.

    optional_item

    required_item

    v If you can choose from two or more items, they appear vertically, in a stack.If you must choose one of the items, one item of the stack appears on the mainpath.

    required_item required_choice1required_choice2

    If choosing one of the items is optional, the entire stack appears below the mainpath.

    required_itemoptional_choice1optional_choice2

    If one of the items is the default, it appears above the main path and theremaining choices are shown below.

    xiv Command Reference

    mailto:[email protected]

  • required_itemdefault_choice

    optional_choiceoptional_choice

    v An arrow returning to the left, above the main line, indicates an item that can berepeated.

    required_item repeatable_item

    If the repeat arrow contains a comma, you must separate repeated items with acomma.

    required_item

    ,

    repeatable_item

    A repeat arrow above a stack indicates that you can repeat the items in thestack.

    v Sometimes a diagram must be split into fragments. The syntax fragment isshown separately from the main syntax diagram, but the contents of thefragment should be read as if they are on the main path of the diagram.

    required_item fragment-name

    fragment-name:

    required_itemoptional_name

    v With the exception of XPath keywords, keywords appear in uppercase (forexample, FROM). Keywords must be spelled exactly as shown. XPath keywordsare defined as lowercase names, and must be spelled exactly as shown. Variablesappear in all lowercase letters (for example, column-name). They representuser-supplied names or values.

    v If punctuation marks, parentheses, arithmetic operators, or other such symbolsare shown, you must enter them as part of the syntax.

    Related concepts:Commands in Db2

    Db2 online utilities (Db2 Utilities)

    Db2 stand-alone utilities (Db2 Utilities)

    About this information xv

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/ugref/src/tpc/db2z_onlineutilities.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/ugref/src/tpc/db2z_standaloneutilities.html

  • xvi Command Reference

  • Part 1. About Db2 and related commands

    Use the Db2 for z/OS and related commands to execute database administrativefunctions.

    These topics provide detailed reference information for Db2 and relatedcommands, including the environment in which each command is issued, theprivileges and authorities that are required to issue each command, syntax andoption descriptions, usage information, and examples.Related tasks:

    Controlling Db2 operations by using commands (Db2 Administration Guide)

    Copyright IBM Corp. 1983, 2017 1

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/admin/src/tpc/db2z_controldb2opscommands.html

  • 2 Command Reference

  • Chapter 1. Commands in Db2

    You can use commands for many tasks that you do to control and maintain Db2subsystems.

    Privileges and authorization IDs for commands

    Commands can be issued by an individual users, by programs that run in batchmode, or by IMS or CICS transactions. The term process describes any of theseinitiators. Db2 processes are represented by a set of identifiers (IDs), which arecalled authorization IDs. What the process can do with Db2 is determined by theprivileges and authorities that are held by its identifiers.

    If RACF is active, IDs that issue commands from logged-on MVS consoles or fromTSO SDSF must have appropriate RACF authorization for Db2 commands, or theprimary authorization IDs must have Db2 authorization to issue commands.

    Db2 commands that are issued from a logged-on z/OS console or TSO SDSF canbe checked by Db2 authorization using primary and secondary authorization IDs.

    You can use Db2 authorization to check Db2 commands that are issued from aDSN session under TSO or DB2I by using primary authorization IDs, secondaryauthorization IDs, and role, if the commands are running in a trusted context withan associated role.

    SQL IDs do not affect most Db2 and related commands.

    For more information, see Authorization IDs (Managing Security) and Privilegesand authorities (Managing Security).

    Command types in Db2

    Db2 supports the following different types of commands:v The TSO command DSN and its subcommandsv Db2 commandsv CICS attachment facility commandsv IMS commandsv Administrative task scheduler commandsv z/OS IRLM commandsv TSO CLISTs

    For more information, see Command types and environments in Db2.

    Syntax rules for Db2 commands

    For information about the conventions for syntax diagrams in IBM documentation,see How to read syntax diagrams ().

    The syntax of each Db2 command contains the following parts:

    Copyright IBM Corp. 1983, 2017 3

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/seca/src/tpc/db2z_authorizationid.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/seca/src/tpc/db2z_privilegeauthority.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/seca/src/tpc/db2z_privilegeauthority.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/home/src/cmn/db2z_cmn_how2readsyntax.html

  • Recognition characterShown as a hyphen throughout this information, with the followingexceptions:v If the command is issued from a z/OS console, the recognition character

    must be the command prefix.The command prefix can be up to eight characters. The default is'-DSN1'. However, the majority of examples in this information assumethat the command prefix has been defined as a hyphen (-). Examplesinvolving members of a data sharing group demonstrate the use ofmulti-character command prefixes, such as -DB1G. A space between thecommand prefix and the command is optional. For example, you can useeither one of the following formats:-DB1GDIS THREAD(*)

    -DB1G DIS THREAD(*)

    However, using a space makes it easier for users to identify thecommand, especially when the command prefix has multiple characters.

    v If the command is issued from an IMS terminal, the recognitioncharacter must be the command recognition character (CRC). Thecommand recognition character is defined in the IMS SSM PROCLIBmember.

    v If the command is issued from a CICS terminal or under the DSNcommand processor, the recognition character must be a hyphen.

    Command nameThe name of the command. Command names have abbreviations, whichare provided in the description of each command.

    OperandsCombinations of keywords and parameters that can be specified for thecommand.

    KeywordsSometimes called command options. Keywords can be required oroptional. They must be entered exactly as shown in the descriptions ofthe commands.

    ParametersA keyword can have zero or more parameters. A parameter list, ifpresent, must be enclosed in parentheses.

    SeparatorsThese can be one or more blanks or commas. An open parenthesismarks the beginning of a parameter list; no separator is needed.Optionally, an equal sign can be used to separate a single parameterfrom its keyword without using parentheses.

    The following table lists characters that have special meanings when they are usedin Db2 commands.

    Table 1. Special meanings of characters in Db2 commands

    Character Meaning in commands

    Blank or blanks ( ) A separator. Single blanks and multiple blanks are equivalent, exceptin strings that are enclosed between apostrophes.

    Comma (,) A separator. Single blanks and multiple blanks are equivalent, exceptin strings that are enclosed between apostrophes.

    4 Command Reference

  • Table 1. Special meanings of characters in Db2 commands (continued)

    Character Meaning in commands

    Apostrophe () The usual SQL string constant delimiter, and marks the beginning orend of a string constant in SQL. (In COBOL programs only, theQUOTESQL precompiler option allows you to choose the quotationmark as the SQL string delimiter; the apostrophe is then the SQLescape character.)

    Letters that are not in string constants are changed to uppercase. Twosuccessive apostrophes in a string constant are changed to oneapostrophe. Blanks, commas, equal signs, and parentheses in stringconstants are treated as literal characters, and are not recognized asseparators.

    Use apostrophes to enclose options that must have lowercasecharacters. Beware of commands that do not convert lowercasecharacters to uppercase because entering lowercase letters might causea JCL error or an abend. Similarly, entering uppercase letters wherelowercase is required (UNIX Services, for example) might produceincorrect results. For more information, see Starting a system taskfrom a console (MVS System Commands).

    An exception exists to the rule about changing letters to uppercase. Ifthe CODED CHARACTER SET option is set to 930 or 5026, the lettersare not folded to uppercase, whether in an SQL string constant or not.

    If a keyword value contains leading or following asterisk (*) orunderscore (_) pattern-matching characters, and the characters in thekeyword value are enclosed in apostrophes, the leading or followingpattern-matching characters must also be enclosed in thoseapostrophes.

    Quotation mark (") The SQL escape character, and marks the beginning or end of an SQLdelimited identifier. (In COBOL programs only, the QUOTESQLprecompiler option allows you to choose the apostrophe as the SQLescape character; the double quotation mark is then the SQL stringdelimiter.)

    Within a string delimited by quotation marks, two successivequotation marks are changed to one. Other rules are the same as forSQL string constants.

    Equal sign (=) Separates a single parameter from a keyword. Thus, an equal sign isused as a separator for keywords that have only one parameter. Anequal sign can be used for keywords with multiple parameters whenonly one member of the parameter list is specified.

    open parenthesis (() The beginning of a parameter list.

    Close parenthesis())

    The end of a parameter list.

    Colon (:) An inclusive range. For example, (A:D) means the same as (A,B,C,D);(1:5) means (1,2,3,4,5). The colon can be used this way only incommands where this operation is specifically permitted.

    Chapter 1. Commands in Db2 5

    http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieag100/skp1.htmhttp://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieag100/skp1.htm

  • Table 1. Special meanings of characters in Db2 commands (continued)

    Character Meaning in commands

    Asterisk (*) The meaning depends on the context:

    * A single asterisk as a keyword-value indicates all. Forexample:

    -DISPLAY UTILITY (*)

    *keyword-valueAn asterisk as the first character of a keyword-value indicatesthat a match for the value will be satisfied when allcharacters following the * are the same. For example: (*BCD)

    beginning-of-keyword-value*end-of-keyword-valueAn intermediate asterisk indicates that a match for the valuewill be satisfied when all characters preceding and allcharacters following the asterisk are the same. For example:(ABC*EFG)

    keyword-value*An asterisk as the final character of a keyword-value indicatesthat a match will for the value will be satisfied when allcharacters preceding the asterisk are the same. For example:(ABC*)

    beginning-of-keyword-value*middle-of-keyword-value*end-of-keyword-value*

    Asterisks used as the first, intermediate and final charactersin a string are also valid. For example: (*BCD*FGH*)

    For example, DISPLAY UTILITY (*) displays the status of all utilities;whereas, DISPLAY UTILITY (R2*) displays the status of all utilitieswhose identifiers begin with R2.

    The asterisk pattern-matching character is available to all Db2commands, but not all Db2 commands support it. The asterisk can beused this way only in commands in which the pattern-matchingoperation is specifically supported.

    Underscore (_) Indicates that any character is a match a that position in a keywordvalue. For example, A_C matches any three-character keyword valuewith A as the first character and C as the third character.

    The two-characterstring NO

    Negates the keyword that follows. A negated keyword means theopposite of the keyword itself, and is often used to override akeyword default. In keywords that have no opposite meaning, theinitial characters NO can be merely part of the keyword itself; forexample, in NODE.

    Syntax rules for DSN subcommands

    The syntax rules for DSN subcommands conform to standard TSO commandparsing conventions. For general information about the syntax of TSO/Ecommands and subcommands, see TSO/E commands and subcommands.

    To continue a subcommand on the next line in the DSN processor, type either ahyphen (-) or a plus sign (+) at the end of the current line. If you use a plus sign,precede it by at least one blank character to prevent the concatenation of characterstrings from line to line. Using a plus sign causes TSO/E to delete leadingdelimiters (blanks, commas, tabs, and comments) on the continuation line, andreduces the overall size of the command.

    6 Command Reference

    https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ikjc500/secone.htm

  • Important: The names of the DSN command and its subcommands cannot beabbreviated. Abbreviations for some keywords are supported for compatibilitywith prior Db2 releases. However, avoid abbreviating keywords in the DSNcommand and its subcommand to avoid potential problems.

    Data sharing scope of commands

    In a data sharing environment, the scope of a command is the breadth of its impactamong the members of the data sharing group. Many commands used in a datasharing environment have member (or local) scope because they affect only the Db2subsystem for which they are issued. Other commands have group scope becausethey affect an object in such a way that affects all members of the group. For moreinformation, see Command scope (Db2 Data Sharing Planning and Administration)or the Environment in the description of each command.

    Output from commands

    Several factors affect the amount of output you can receive from a Db2 command.

    The amount of output that you receive from a Db2 command is always less than256 KB. The following factors determine the maximum amount of output that isreturned:v The amount of storage available to your Db2 subsystem or to an individual

    command.v The environment from which you issue the Db2 command.

    For example, if you issue a Db2 command from an IMS console, you can receiveno more than 32 KB of output.

    v For DISPLAY DATABASE, the value of the LIMIT keyword. For moreinformation, see -DISPLAY DATABASE (Db2).

    v For DISPLAY THREAD, the number of lines of output. DISPLAY THREADdisplays at most 254 lines of output. For more information, see -DISPLAYTHREAD (Db2).

    Recovery logs and commands

    All Db2 commands issued after Db2 restart and before Db2 shutdown are loggedby Db2. These commands are written in an IFCID 0090 trace record with adestination header that is mapped by macro DSNDQWIW. The log record type is0010 (system event), and the subtype is 0041 (trace record).

    Chapter 1. Commands in Db2 7

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/dshare/src/tpc/db2z_commandscopeds.html

  • 8 Command Reference

  • Chapter 2. Command types and environments in Db2

    Db2 supports several different types of commands that you can use to completedatabase administration tasks.

    The commands are divided into the following categories:

    The DSN command and subcommands

    DSN is the Db2 command processor and executes as a TSO command processor.

    All of the DSN subcommands, except SPUFI, run under DSN in either theforeground or background, and all, except END, also run under Db2 Interactive(DB2I). SPUFI runs only in the foreground under ISPF.

    ABEND (DSN) The DSN subcommand ABEND causes the DSN session toterminate with abend completion code X'04E' and reasoncode of X'00C50101'.Important: The ABEND subcommand is used fordiagnostic purposes only, and is intended to be used onlyunder the direction of IBM Software Support. Use it onlywhen diagnosing a problem with DSN or Db2.

    BIND PACKAGE (DSN) The DSN subcommand BIND PACKAGE builds anapplication package. Db2 records the description of thepackage in the catalog tables and saves the preparedpackage in the directory.

    BIND SERVICE (DSN) The BIND SERVICE (DSN) subcommand builds anapplication package that represents a Db2 REST service.

    BIND PLAN (DSN) The DSN subcommand BIND PLAN builds an applicationplan. All Db2 programs require an application plan toallocate Db2 resources and support SQL requests made atrun time.

    BIND QUERY (DSN) The DSN subcommand BIND QUERY reads the statementtext, default schema, and a set of bind options from everyrow of DSN_USERQUERY_TABLE, and information fromcorrelated EXPLAIN table rows. When LOOKUP(NO) is ineffect, Db2 inserts the pertinent data into certain catalogtables.

    DSN (TSO) The TSO command DSN starts a DSN session.

    END (DSN) The DSN subcommand END is used to end the DSNsession and return to TSO.

    FREE PACKAGE (DSN) The DSN subcommand FREE PACKAGE can be used todelete a specific version of a package, all versions of apackage, or whole collections of packages.

    FREE SERVICE (DSN) The FREE SERVICE (DSN) subcommand deletes anapplication package that represents a Db2 REST service.

    FREE PLAN (DSN) The DSN subcommand FREE PLAN deletes applicationplans from Db2.

    Copyright IBM Corp. 1983, 2017 9

    ||||

  • FREE QUERY (DSN) The DSN subcommand FREE QUERY removes fromcertain catalog tables for one or more queries. If any of thespecified queries are in the dynamic statement cache,FREE QUERY purges them from the dynamic statementcache.

    Chapter 39, FREE STABILIZEDDYNAMIC QUERY (DSN), onpage 321

    The DSN subcommand FREE STABILIZED DYNAMICQUERY removes from certain catalog tables one or morestabilized dynamic queries. If any of the specified queriesare in the dynamic statement cache, FREE STABILIZEDDYNAMIC QUERY purges the statements from thedynamic statement cache.

    DCLGEN (DECLARATIONSGENERATOR) (DSN)

    The declarations generator (DCLGEN) produces an SQLDECLARE TABLE statement and a COBOL, PL/I, or Cdata declaration for a table or a view named in thecatalog.

    REBIND PACKAGE (DSN) The DSN subcommand REBIND PACKAGE rebinds anapplication package when you make changes that affectthe package, but have not changed the SQL statements inthe program.

    REBIND PLAN (DSN) The DSN subcommand REBIND PLAN rebinds anapplication plan when you make changes to the attributesof the plan, such as the package list.

    REBIND TRIGGER PACKAGE(DSN)

    The DSN subcommand REBIND TRIGGER PACKAGErebinds a package for a basic trigger. Any trigger createdbefore the activation of function level 500 or higher is abasic trigger. For advanced triggers, use the REBINDPACKAGE command instead.

    RUN (DSN) The DSN subcommand RUN executes an applicationprogram, which can contain SQL statements.

    SPUFI (DSN) The DSN subcommand SPUFI executes the SQL processorusing file input.

    Db2 commands

    You can use Db2 commands to control most of the operational environment.

    START DB2 commands can be issued only from a z/OSconsole or TSO SDSF. Allother Db2 commands can be issued from the following environments:v z/OS consolesv TSO terminals, by any of the following methods:

    Issuing the DSN command from the TSO READY prompt Entering commands in the DB2 Commands panel inDB2I

    v IMS terminalsv Authorized CICS terminals

    You can issue many commands from the background within batch programs, suchas the following types of programs:v z/OS application programsv Authorized CICS programsv IMS programsv APF-authorized programs, such as a terminal monitor program (TMP)v IFI application programs

    10 Command Reference

    |||

    ||||||

    |||||

    |

  • Db2 commands that are issued from a logged-on z/OS console or TSO SDSF canbe checked by Db2 authorization using primary and secondary authorization IDs.

    For detailed descriptions of the Db2 commands, see the commands with namesthat are preceded by the recognition character - and identified by (Db2) inAbout Db2 and related commands.

    The extended MCS console feature enables a z/OS system have more than 99consoles. Because Db2 supports extended MCS consoles, messages returned from aDb2 command are routed to the extended MCS console that issued the command.

    Message DSN9022I indicates the normal end of Db2 command processing;DSN9023I indicates the abnormal end of Db2 command processing.

    IMS commands

    You can use the following IMS commands to control IMS connections as well as tostart and stop connections to Db2 and display activity on the connections. You canissue IMS commands from an IMS terminal or you can invoke IMS transactions orcommands by using the Db2-supplied stored procedures DSNAIMS or DSNAIMS2.DSNAIMS2 has the same functions as DSNAIMS but also provides multi-segmentinput support for IMS transactions.

    For descriptions of the IMS commands, see IMS commands.

    /CHANGE (IMS) Resets an indoubt unit of recovery as identified by the OASNkeyword of the /DISPLAY command. That command deletes theitem from the standpoint of IMS, but it does not communicate toDb2. For example, issue the following command to reset allindoubt units of recovery for the subsystem named Db2:

    /CHA SUBSYS DB2 RESET

    Issue the following command to reset all indoubt units of recoveryfor all subsystems:

    /CHA SUBSYS ALL RESET

    Issue the following command to reset indoubt recovery units withOASN numbers 99, 685, and 2920 for subsystem Db2:

    /CHA SUBSYS DB2 OASN 99 685 2920 RESET

    /DISPLAY (IMS) Displays the status of the connection between IMS and an externalsubsystem (as well as all application programs communicatingwith the external subsystem), or the outstanding recovery unitsthat are associated with the subsystem. For example, you can issuethe following command to display the status of all connectionswith IMS:

    /DISPLAY SUBSYS ALL

    The result is similar to the following output:

    SUBSYS CRC REGID PROGRAM LTERM STATUSSSTR ? CONN

    1 DDLTLM17 PTERM01 CONN,ACTIVE2 DDLTLM06 PTERM02 CONN

    *85202/065933*

    /SSR (IMS) Allows the IMS operator to enter an external subsystem command.

    Chapter 2. Command types and environments in Db2 11

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/msgs/src/tpc/dsn9022i.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/msgs/src/tpc/dsn9023i.htmlhttp://www-01.ibm.com/support/knowledgecenter/SSEPH2_15.1.0/com.ibm.ims13.doc.cr/imscmds/ims_ic_imscmdsover.htm

  • /START (IMS) Makes the connection between IMS and the specified externalsubsystem available. Establishing the connection allows applicationprograms to access resources managed by the external subsystem.

    /STOP (IMS) With the SUBSYS parameter, prevents application programs fromaccessing external subsystem resources.

    /TRACE (IMS) Directs and controls the IMS capabilities for tracing internal IMSevents. It also starts, stops, and defines the activity to be monitoredby the IMS Monitor. For example, the following command startsIMS trace, enables the Db2 trace, and writes IMS trace tables to theIMS log before they wrap:

    /TRACE SET ON TABLE SUBS OPTION LOG

    The following command starts IMS tracing, enables all trace tables(including Db2 trace tables); (ALL is the default parameter for theTABLE keyword), and writes IMS trace tables to the IMS log beforethey wrap.

    /TRACE SET ON TABLE ALL OPTION LOG

    CICS attachment facility commands

    You can use CICS commands to control CICS connections as well as to start andstop connections to Db2 and display activity on the connections. Each CICSattachment facility command can be issued from a CICS terminal.

    Issuing commands to Db2 using the DSNC transaction (CICS Transaction Serverfor z/OS)DSNC DISCONNECT (CICS Transaction Server for z/OS)DSNC DISPLAY (CICS Transaction Server for z/OS)DSNC STOP (CICS Transaction Server for z/OS)DSNC STRT (CICS Transaction Server for z/OS)

    Administrative task scheduler commands

    You can use administrative task scheduler commands to start, stop, and change theadministrative task scheduler. All administrative task scheduler commands can beissued from a z/OS console.

    MODIFYadmtproc,APPL=SHUTDOWN

    The MODIFY admtproc, APPL=SHUTDOWN commandstops the administrative task scheduler from acceptingrequests and starting new task executions. It also shutsdown the administrative task scheduler.

    MODIFYadmtproc,APPL=TRACE

    The MODIFY admtproc, APPL=TRACE command starts orstops traces in the administrative task scheduler.

    START admtproc The START admtproc command starts the scheduler that isspecified in the admtproc parameter

    STOP admtproc (z/OS ) The STOP admtproc command stops the administrativetask scheduler that is specified in the admtproc parameter.

    z/OS IRLM commands

    You can use z/OS Internal Resource Lock Manager (IRLM) commands to start,stop, and change the IRLM. All z/OS IRLM command can be issued from a z/OSconsole.

    12 Command Reference

    http://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.doc/dfhtk/topics/dfhtk0v.htmlhttp://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.doc/dfhtk/topics/dfhtk0v.htmlhttp://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.doc/dfhtk/topics/dfhtk0s.htmlhttp://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.doc/dfhtk/topics/dfhtk0x.htmlhttp://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.doc/dfhtk/topics/dfhtk0y.htmlhttp://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.doc/dfhtk/topics/dfhtk0t.html

  • MODIFY irlmproc,ABEND(z/OS IRLM)

    The MODIFY irlmproc , ABEND command terminatesIRLM abnormally. IRLM processes this command even if aDb2 subsystem is identified to it.

    MODIFY irlmproc,DIAG (z/OSIRLM)

    The MODIFY irlmproc , DIAG command initiatesdiagnostic dumps for IRLM subsystems.)

    MODIFY irlmproc,PURGE(z/OS IRLM)

    The MODIFY irlmproc,PURGE command releases IRLMlocks retained due to a Db2, IRLM, or system failure.

    MODIFY irlmproc,SET (z/OSIRLM)

    The MODIFY irlmproc,SET command dynamically setsvarious IRLM operational parameters

    MODIFY irlmproc,STATUS(z/OS IRLM)

    The MODIFY irlmproc,STATUS command displaysinformation for one or more subsystems connected to theIRLM that is specified using irlmproc .

    TSO CLISTs

    You can use Time Sharing Option (TSO) commands to perform TSO tasks such asprepare and execute programs under TSO.Related tasks:

    Controlling Db2 operations by using commands (Db2 Administration Guide)

    Submitting work to Db2 (Db2 Administration Guide)

    Chapter 2. Command types and environments in Db2 13

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/admin/src/tpc/db2z_controldb2opscommands.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/admin/src/tpc/db2z_submitwork.html

  • 14 Command Reference

  • Chapter 3. ABEND (DSN)

    The DSN subcommand ABEND causes the DSN session to terminate with abendcompletion code X'04E' and reason code of X'00C50101'. It is intended to be used atthe direction of IBM Software Support, if a problem is suspected (such as incorrectoutput) with another DSN subcommand, and the problem does not cause an abendand a dump to be generated.

    Important: The ABEND subcommand is used for diagnostic purposes only, and isintended to be used only under the direction of IBM Software Support. Use it onlywhen diagnosing a problem with DSN or Db2.

    Environment

    You can use ABEND from DB2I, or from a DSN session under TSO that runs ineither the foreground or background.

    Data sharing scope: Member.

    Authorization

    None is required.

    Syntax

    ABEND

    Usage notes

    Sometimes, the information dumped is not the information that you want. Alwaysuse the ABEND subcommand as soon as possible after a problem is re-created toincrease the chances of obtaining meaningful data. Do not press the ATTENTIONkey before issuing the ABEND subcommand; usually, the data is lost.Related tasks:

    ABEND subcommand of the DSN command processor (Diagnosing Db2problems)Related reference:DSN (TSO)Related information:

    00C50101 (Db2 Codes)

    Copyright IBM Corp. 1983, 2017 15

    |

    |

    |||||

    |||

    |

    ||

    |

    |

    |

    |

    ||||||||

    |

    ||||

    |

    ||

    |

    |

    |

    |

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/trbshoot/src/tpc/db2z_trbshootuseabendsubcommanddsncproc.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/trbshoot/src/tpc/db2z_trbshootuseabendsubcommanddsncproc.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/codes/src/tpc/00c50101.html

  • 16 Command Reference

  • Chapter 4. -ACCESS DATABASE (Db2)

    The Db2 command ACCESS DATABASE forces a physical open of a table space,index space, or partition, or removes the GBP-dependent status for a table space,index space, or partition, or externalizes the real-time statistics and optimizerstatistics recommendations from in-memory blocks to the appropriate catalogtables. The MODE keyword specifies the desired action.

    Abbreviation: -ACC

    Environment

    This command can be issued from a z/OS console, a DSN session under TSO, aDB2I panel (DB2 COMMANDS), an IMS or CICS terminal, or a program usingthe instrumentation facility interface (IFI).

    Data sharing scope: Member or group

    Authorization

    To execute this command, you must use a privilege set of the process that includesone of the following authorities:v STARTDB privilegev DBMAINT authorityv DBCTRL authorityv DBADM authorityv SYSCTRL authorityv SYSADM authorityv System DBADM authority

    When you are using a privilege set that does not contain the STARTDB privilegefor a specified database, Db2 issues an error message and the ACCESS commandfails.

    All specified databases with the STARTDB privilege included in the privilege set ofthe process are started.

    Db2 commands that are issued from a logged-on z/OS console or TSO SDSF canbe checked by Db2 authorization using primary and secondary authorization IDs.

    When data definition control is active, installation SYSOPR or installation SYSADMauthority is required to start a database, a table space, or an index space containinga registration table or index.

    Copyright IBM Corp. 1983, 2017 17

  • Syntax

    ACCESS

    ,

    DATABASE( database-name )*dbname1:dbname2dbname**dbname*dbname**dbstring1*dbstring2*

    ,

    SPACENAM ( space-name )*spacename1:spacename2spacename**spacename*spacename**spacestring1*spacestring2*

    ,

    PART ( integer )integer1:integer2

    MODE ( OPEN )NGBPDEPSTATS

    Option descriptions

    DATABASE (database-name,...)Specifies the names of the database, or database for the table spaces or indexspaces to access.

    Abbreviation: DB

    database-nameThe name of one or more database to access. To specify multiple databasenames, separate the values in the list by commas.

    SPACENAM(space-name, ...)Indicates names of table spaces or indexes within the specified database toaccess.

    Abbreviation: SPACE, SP

    space-nameThe name of one or more table spaces or index spaces to access.

    You can write space-name like database-name to designate the name of asingle table space or index space.

    PART(integer,)Indicates the partition number of one or more partitions, within thespecified table space or index, that are to be accessed.

    The specified integer value must identify a valid partition number for thecorresponding space name and database name. If you specify nonvalid

    18 Command Reference

  • partition numbers, you receive an error message for each non-validnumber, but all valid partitions that you specified are accessed.

    integer can be written to designate one of the following specifications:v A list of one or more partitions.v A range of all partition numbers that collate greater than or equal to

    integer-1 and less than or equal to integer-2.v A combination of lists and ranges.

    PART is valid with partitioned table spaces, partitioned indexes, andnonpartitioned type 2 indexes of partitioned table spaces. If you specifyPART with a nonpartitioned table space or index on a nonpartitioned tablespace, you receive an error message, and the nonpartitioned space is notaccessed. When a logical partition is accessed, the index is not closed. Anonpartitioning index must be accessed without the use of PART to closethe index.

    MODE( mode-value )Specifies the action for the command, where mode-value is one of thefollowing values:

    OPENForces the physical opening of the page set or partition on just thelocal member. This moves the overhead of the physical open from anSQL thread to the command thread. This improves the transaction ratefor the first SQL thread to reference a given page set or partition.

    When MODE(OPEN) is specified, Db2 does not process objects withthe following characteristics:v The objects are defined with DEFINE NO.v The physical data sets for the objects have not been created.

    NGBPDEPRemoves group buffer pool dependency from the specified page set orpartition. Use this before running large batch processes against aparticular page set or partition to improve performance in a datasharing environment. Issue this command only on the same memberthat runs the batch processes. The page set or partition is drainedwhen you specify this keyword.

    STATSExternalizes the in-memory real-time statistics and the optimizerrecommendations to the appropriate catalog tables. In data sharingenvironments, the in-memory statistics are externalized for allmembers. This mode does not physically open the page sets or changethe states of the page sets.

    When the MODE (STATS) option is specified, only certaincombinations of database-name and space-name values are recommended.

    Related information:

    Updating real-time statistics immediately (Db2 Performance)

    Usage notes

    The following description contains additional information about how to use theACCESS DATABASE command.

    Chapter 4. -ACCESS DATABASE (Db2) 19

    ||||||

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/perf/src/tpc/db2z_rtsupdateimmediate.html

  • What to do if ACCESS DATABASE returns error message DSNI045IIssuing ACCESS DATABASE MODE(OPEN) on several members of a datasharing group at the same time might result in error message DSNI045Iand reason code 00C90090, due to resource contention. If this error occurs,reissue the ACCESS DATABASE MODE(OPEN) command to open all ofthe objects that the command affects. To avoid the error, do not issueACCESS DATABASE MODE(OPEN) on multiple data sharing groupmembers at the same time.

    Examples

    Example: Physically opening partitionsThis command physically opens partitions 1 and 3 of table space DSN9002of database DSN9001.-ACCESS DATABASE(DSN9001) SPACENAM(DSN9002) PART(1,3) MODE(OPEN)

    Example: Physically closing a nonpartitioned table spaceThis command physically closes the entire nonpartitioned table spaceDSN9003 of database DSN9001 and makes it non-group bufferpooldependent.-ACCESS DATABASE(DSN9001) SPACENAM(DSN9003) MODE(NGBPDEP)

    Output similar to the following output indicates that the commandcompleted successfully:

    -DSNTDDIS ACCESS DATABASE NORMAL COMPLETION

    Example: Externalize all in memory statistics to the real-time statistics tablesThe following command externalizes all in-memory statistics and optimizerrecommended statistics that are currently held in the system to thereal-time statistics table.-ACCESS DB(*) SP(*) MODE(STATS)

    Related concepts:

    Physical open of a page set of partition (Db2 Data Sharing Planning andAdministration)

    Inter-Db2 interest and GBP-dependency (Db2 Data Sharing Planning andAdministration)Related tasks:

    Improving batch processing performance in data sharing (Db2 Data SharingPlanning and Administration)

    Setting up your system for real-time statistics (Db2 Performance)Related information:

    DSNT538I (Db2 Messages)

    20 Command Reference

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/dshare/src/tpc/db2z_physicalopenpageset.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/dshare/src/tpc/db2z_physicalopenpageset.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/dshare/src/tpc/db2z_interdb2interestgbpdep.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/dshare/src/tpc/db2z_interdb2interestgbpdep.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/dshare/src/tpc/db2z_removegbpdependency.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/dshare/src/tpc/db2z_removegbpdependency.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/perf/src/tpc/db2z_setup4realtimestatistics.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/msgs/src/tpc/dsnt538i.html

  • Chapter 5. -ACTIVATE (Db2)

    The Db2 command ACTIVATE enables use of new capabilities and enhancementsat the specified function level, and lower function levels. Use of the ACTIVATEcommand to activate function level 500 or higher also marks the boundarybetween the ability to coexist with or fallback to Db2 11.

    Important: Before you activate function level 500 or higher for the first time, readMigration step 28: Activate function level 500 or higher (Db2 Installation andMigration).

    On successful completion of the ACTIVATE command, the specified function leveland all lower function levels become available for use. Use of the ACTIVATEcommand requires that the data sharing group contains no active Db2 11 members.

    Important: Do not attempt to start Db2 at any code level that is lower than thehighest ever activated function level, even at the lower * function level. Activate afunction level only after you are satisfied that Db2 can continue to run at therequired code level.

    Abbreviation:-ACTIVATE FUNCTION LEVEL(function-level)

    Environment

    The ACTIVATE command can be issued from a z/OS console, a DSN sessionunder TSO, a Db2I panel (DB2 COMMANDS), an IMS or CICS terminal, or aprogram using the instrumentation facility interface (IFI).

    Tip: You can tailor and run the DSNTIJAF job to issue the ACTIVATE commands.For more information, see Activating Db2 12 function levels (Db2 for z/OS What'sNew?).

    Data sharing scope: Group

    Authorization

    To execute the ACTIVATE command, you must use a privilege set that includes theinstallation SYSADM or installation SYSOPR authority. The installation SYSOPRauthority enables you to install or migrate Db2 without access to user objects.

    ACTIVATE FUNCTION LEVEL ( function-level )TEST

    Option descriptions

    function-levelThe function level to activate in the subsystem or data sharing group. Theformat is VvvRrMmmm, where vv is the version, r is the release, and mmm isthe modification level. For example, V12R1M502 identifies function level 502.For a list of all available function levels in Db2 12, see What's new in Db212 function levels (Db2 for z/OS What's New?).

    Copyright IBM Corp. 1983, 2017 21

    |

    |

    ||||

    |||

    |||

    ||||

    |

    |

    |||

    |||

    |

    |

    |||

    |||||||||||||||||||

    |

    |

    ||||||

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/inst/src/tpc/db2z_activatenewfunction.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/inst/src/tpc/db2z_activatenewfunction.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_activatefunctionlevel.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_activatefunctionlevel.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_db2functionlevels.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_db2functionlevels.html

  • Activation of a function level succeeds only if the subsystem or everyactive member in the data sharing group runs at the required code level.

    You can specify a higher or lower function level than the current functionlevel. If a lower function level is specified, the corresponding * functionlevel is activated in the subsystem or data sharing group. For moreinformation about * function levels, see Responding to problems afterfunction level activation (Db2 for z/OS What's New?).

    A DSNU757I message indicates successful completion of the command, orthe reason why that command was not successful.

    TEST The specified function level is not activated. Instead, the DSNU757Imessage output indicates the eligibility for the activation of the specifiedfunction-level of the subsystem or data sharing group. The message outputdisplays information about any member that prevents activation of thespecified function level for the group. The message output displays code,catalog, and function level information for each subsystem or groupmember.

    Important: When you check the readiness of your Db2 environment for afunction level, be careful to specify the TEST option with the ACTIVATEcommand. After any successful completion of the ACTIVATE commandwithout TEST, Db2 must remain at the higher code level. That is, youcannot remove any PTFs that the code level requires, even at a lower *function level. You can also use the DISPLAY GROUP command todetermine the highest function level that your Db2 environment supports,without risk of inadvertent function level activation. For more informationand examples, see Determining the Db2 code level, catalog level, andfunction level (Db2 for z/OS What's New?).

    Examples

    The following examples demonstrate use of the ACTIVATE command to test andactivate Db2 12 function levels.

    Example: Testing function level activation

    The following command checks whether the subsystem or data sharinggroup is ready for the specified function level.-ACTIVATE FUNCTION LEVEL (V12R1M500) TEST

    The DSNU757I message indicates whether the group is ready for thespecified level. Because TEST is specified, the output includes detailedinformation about each active member of the data sharing group. In thisexample, all of the members are at the required code level and cataloglevel so that function level 500 can be activated.DSNU757I -DB2A DSNUGCCA*** BEGIN ACTIVATE FUNCTION LEVEL (V12R1M500)

    GROUP ELIGIBLE FOR FUNCTION LEVEL (V12R1M500)CATALOG LEVEL(V12R1M500)CURRENT FUNCTION LEVEL(V12R1M100)PREVIOUS HIGHEST FUNCTION LEVEL (V12R1M100)HIGHEST POSSIBLE FUNCTION LEVEL(V12R1M500)

    --------------------------------------------------------------------DB2 CURRENT CAPABLE FUNCTION LEVELSMEMBER ID CODE-LEVEL LOWEST HIGHEST STATUS-------- --- ---------- ---------- ---------- -------------------

    22 Command Reference

    ||

    |||||

    ||

    ||||||||

    ||||||||||

    |

    ||

    ||

    |||

    |

    |||||

    |||||||||||

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_revertfunctionlevel.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_revertfunctionlevel.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_determinefunctionlevel.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_determinefunctionlevel.html

  • DB2A 1 V12R1M500 V12R1M100 V12R1M500 ELIGIBLEDB2B 2 V12R1M500 V12R1M100 V12R1M500 ELIGIBLEDB2C 3 V12R1M500 V12R1M100 V12R1M500 ELIGIBLE--------------------------------------------------------------------DSN9022I -DB2A DSNZACMD -ACTIVATE FUNC NORMAL COMPLETION

    Example: Activating function level 500

    The following command attempts to activate function level 500.-ACTIVATE FUNCTION LEVEL (V12R1M500)

    The DSNU757I message indicates that function level 500 is successfullyactivated for the data sharing group.DSNU757I -DB2A DSNUGCCA*** BEGIN ACTIVATE FUNCTION LEVEL (V12R1M500)

    FUNCTION LEVEL (V12R1M500) SUCCESSFULLY ACTIVATEDCATALOG LEVEL(V12R1M500)CURRENT FUNCTION LEVEL(V12R1M500)PREVIOUS HIGHEST FUNCTION LEVEL (V12R1M500)HIGHEST POSSIBLE FUNCTION LEVEL(V12R1M500)

    DSN9022I -DB2A DSNZACMD -ACTIVATE FUNC NORMAL COMPLETION

    Example: Activating function level 502The following command attempts to activate function level 502.TheDSNU757I message indicates that function level 502 is successfullyactivated for the data sharing group.DSNU757I -DB2A DSNUGCCA*** BEGIN ACTIVATE FUNCTION LEVEL (V12R1M502)

    FUNCTION LEVEL (V12R1M502) SUCCESSFULLY ACTIVATEDCATALOG LEVEL(V12R1M502)CURRENT FUNCTION LEVEL(V12R1M500)PREVIOUS HIGHEST FUNCTION LEVEL (V12R1M500)HIGHEST POSSIBLE FUNCTION LEVEL(V12R1M502)

    DSN9022I -DB2A DSNZACMD -ACTIVATE FUNC NORMAL COMPLETION

    Example: Attempting to activate a function level with ineligible members

    For example the following command attempts to activate the specifiedfunction level.-ACTIVATE FUNCTION LEVEL (V12R1M500)

    The DSNU757I message indicates that the group is not yet ready for theactivation of function level 500. The example subsystem is being migratedfrom Db2 11. One or more members is not at the required code level.DSNU757I -DB2A DSNUGCCA*** BEGIN ACTIVATE FUNCTION LEVEL (V12R1M500)

    GROUP NOT ELIGIBLE FOR FUNCTION LEVEL (V12R1M500)MEMBER(S) NOT STARTED WITH REQUIRED CODE LEVELCATALOG LEVEL(V12R1M500)CURRENT FUNCTION LEVEL(V12R1M100)

    Chapter 5. -ACTIVATE (Db2) 23

    |||||

    |

    |

    |

    |

    ||

    |

    ||

    ||||||||

    |

    |

    ||||

    ||||||||

    |

    |

    |||

    |

    |||

    ||||||

  • PREVIOUS HIGHEST FUNCTION LEVEL (V12R1M100)HIGHEST POSSIBLE FUNCTION LEVEL(V12R1M100)

    --------------------------------------------------------------------DB2 CURRENT CAPABLE FUNCTION LEVELSMEMBER ID CODE-LEVEL LOWEST HIGHEST STATUS-------- --- ---------- ---------- ---------- -------------------DB2A 1 V12R1M500 V12R1M100 V12R1M500 ELIGIBLEDB2B 2 V11R1M500 V11R1M500 V12R1M100 NOT ELIGIBLEDB2C 3 V12R1M500 V12R1M100 V12R1M500 ELIGIBLE--------------------------------------------------------------------DSN9022I -DB2A DSNZACMD -ACTIVATE FUNC NORMAL COMPLETION

    Example: Activating a lower (*) function level

    Assuming that the subsystem or data sharing group is at function level500, the following command reverts the subsystem or group to functionlevel 100*-ACTIVATE FUNCTION LEVEL (V12R1M100)

    The DSNU757I message indicates that function level 100* is activated.DSNU757I -DB2A DSNUGCCA*** BEGIN ACTIVATE FUNCTION LEVEL (V12R1M100)

    FUNCTION LEVEL (V12R1M100) SUCCESSFULLY ACTIVATEDCATALOG LEVEL(V12R1M500)CURRENT FUNCTION LEVEL(V12R1M100*)PREVIOUS HIGHEST FUNCTION LEVEL (V12R1M500)HIGHEST POSSIBLE FUNCTION LEVEL(V12R1M500)

    DSN9022I -DB2A DSNZACMD -ACTIVATE FUNC NORMAL COMPLETION

    Usage notes

    Overview of Db2 12 new function availabilityThe availability of new function depends on the type of enhancement, theactivated function level, and the application compatibility levels ofapplications. In the initial Db2 12 release, most new capabilities areenabled only after the activation of function level 500 or higher.

    Virtual storage enhancementsVirtual storage enhancements become available at the activation ofthe function level that introduces them or higher. Activation offunction level 100 introduces all virtual storage enhancements inthe initial Db2 12 release. That is, activation of function level 500introduces no virtual storage enhancements.

    Subsystem parametersNew subsystem parameter settings are in effect only when thefunction level that introduced them or a higher function level isactivated. Most subsystem parameter changes in the initial Db2 12release take effect in function level 500. For a list of these changes,see Subsystem parameter changes in Db2 12 (Db2 for z/OS What'sNew?).

    24 Command Reference

    |||||||||||

    |

    |

    |

    |

    ||||

    |

    |

    ||||||||

    |

    |

    |

    |||||

    ||||||

    |||||||

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_12_subsysparmchanges.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_12_subsysparmchanges.html

  • Optimization enhancementsOptimization enhancements become available after the activationof the function level that introduces them or higher, and fullprepare of the SQL statements. When a full prepare occursdepends on the statement type:v For static SQL statements, after bind or rebind of the packagev For non-stabilized dynamic SQL statements, immediately, unless

    the statement is in the dynamic statement cachev For stabilized dynamic SQL statements, after invalidation, free,

    or changed application compatibility level

    Activation of function level 100 introduces all optimizationenhancements in the initial Db2 12 release. That is, function level500 introduces no optimization enhancements.

    SQL capabilitiesNew SQL capabilities become available after the activation of thefunction level that introduces them or higher, for applications thatrun at the equivalent application compatibility level or higher. NewSQL capabilities in the initial Db2 12 release become available infunction level 500 for applications that run at the equivalentapplication compatibility level or higher. You can continue to runSQL statements compatibly with lower function levels, or previousDb2 releases, including Db2 11 and DB2 10. For details, seeApplication compatibility levels in Db2 (Db2 Applicationprogramming and SQL)

    Related tasks:

    Migrating Db2 to Db2 12 (Db2 Installation and Migration)

    Adopting new capabilities in Db2 12 continuous delivery (Db2 for z/OSWhat's New?)

    Migration step 28: Activate function level 500 or higher (Db2 Installation andMigration)

    Chapter 5. -ACTIVATE (Db2) 25

    ||||||||||

    |||

    |||||||||||

    |

    |

    ||

    ||

    http://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/apsg/src/tpc/db2z_applicationcompatibility.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/apsg/src/tpc/db2z_applicationcompatibility.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/inst/src/tpc/db2z_migrdb2.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_managenewcapability.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/wnew/src/tpc/db2z_managenewcapability.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/inst/src/tpc/db2z_activatenewfunction.htmlhttp://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/inst/src/tpc/db2z_activatenewfunction.html

  • 26 Command Reference

  • Chapter 6. -ALTER BUFFERPOOL (Db2)

    The Db2 command ALTER BUFFERPOOL alters attributes for active or inactivebuffer pools. Altered values are used until altered again.

    Abbreviation: -ALT BPOOL

    Environment

    This command can be issued from a z/OS console, a DSN session under TSO, aDB2I panel (DB2 COMMANDS), an IMS, or CICS terminal, or a program using theinstrumentation facility interface (IFI).

    Data sharing scope: Member

    Authorization

    To issue this command, you must use a set of privileges for the process thatincludes one of the following authorities:v SYSOPR authorityv SYSCTRL authorityv SYSADM authority

    Db2 commands that are issued from a logged-on z/OS console or TSO SDSF canbe checked by Db2 authorization that uses primary and secondary authorizationIDs.

    Copyright IBM Corp. 1983, 2017 27

  • Syntax

    ALTER BUFFERPOOL (bpname)VPSIZE(integer)

    *

    VPSIZEMIN( integer )*

    VPSIZEMAX( integer )

    FRAMESIZE( 4K )

    1M2G

    VPSEQT(integer) VPPSEQT(integer)

    DWQT(integer) VDWQT(integer1,integer2) PGSTEAL( LRU )

    FIFONONE

    NO

    PGFIX( YES )NO

    AUTOSIZE( YES )SPSIZE(integer)

    SPSEQT(integer)

    Option descriptions

    ( bpname )Specifies the buffer pool to alter.v 4 KB page buffer pools are named BP0 through BP49v 8 KB page buffer pools are named BP8K0 through BP8K9v 16 KB page buffer pools are named BP16K0 through BP16K9v 32 KB page buffer pools are named BP32K through BP32K9

    VPSIZE ( integer ) Changes the buffer pool size.

    The value of integer specifies the number of buffers to allocate to the activebuffer pool.

    The value of integer can range 0 - 4000000000 for 4 KB page buffer pools otherthan BP0. For BP0, the minimum value is 2000. For 8 KB page buffer pools, theminimum value is 1000. For 16 KB page buffer pools, the minimum value is500. For 32 KB page buffer pools, the minimum value is 250.

    Db2 limits the sum of VPSIZE and SPSIZE for all buffer pools to 16 TB. Inaddition, Db2 limits the sum of buffer pool storage and simulated buffer poolstorage to the smaller of the following values:v Twice the available real storage in the z/OS systemv 16TB

    When you set VPSIZE to 0 for an active buffer pool, the Db2 database managerquiesces all current database access and update activities for that buffer pool,and then deletes the buffer pool. Subsequent attempts to use table spaces or

    28 Command Reference

    ||||

    |||

    |

    |

  • indexes that are assigned to that buffer pool fail. In addition, when you setVPSIZE to 0, and a simulated buffer pool is allocated, the database managerdeletes the simulated buffer pool.

    VPSIZEMIN (integer|*) Sets the minimum size for the buffer pool. Possible values are:

    *

    Indicates that Db2 sets the minimum value to 75% of the current size. *is the default.

    integerSpecifies the minimum number of buffers to allocate to the activebuffer pool when AUTOSIZE(YES) is in effect. The following rulesapply to integer:v For buffer pools other than BP0, BP8K0, BP16K0, or BP32K, the

    value of integer for VPSIZEMIN must be less than or equal to thevalue of integer for VPSIZE. The value of VPSIZEMIN cannot be 0.

    v For buffer pools BP0, BP8K0, BP16K0, or BP32K, valid ranges forinteger are:

    Buffer pool page size Range for integer

    4 KB 2000 - 4000000000

    8 KB 1000 - 2000000000

    16 KB 500 - 1000000000

    32 KB 250 - 500000000

    Abbreviation: VPMIN

    VPSIZEMAX (integer|*) Sets the maximum size for the buffer pool. Possible values are:

    *

    Indicates that Db2 sets the maximum value to 125% of the current size.* is the default.

    integerSpecifies the maximum number of buffers to allocate to the activebuffer pool when AUTOSIZE(YES) is in effect. The following rulesapply to integer:v For buffer pools other than BP0, BP8K0, BP16K0, or BP32K, the

    value of integer for VPSIZEMAX must be greater than or equal to thevalue of integer for VPSIZE. The value of VPSIZEMAX cannot be 0.

    v For buffer pools BP0, BP8K0, BP16K0, or BP32K, integer has thefollowing range:

    Buffer pool page size Range for integer

    4 KB 2000 - 4000000000

    8 KB 1000 - 2000000000

    16 KB 500 - 1000000000

    32 KB 250 - 500000000

    Abbreviation: VPMAX

    Chapter 6. -ALTER BUFFERPOOL (Db2) 29

    |

    |

    |

    |

    |

    |

    |

    |

  • FRAMESIZE(4K|1M|2G) Sets the frame size for the buffer pool. Possible values are 2G, 1M, or 4 K.

    If FRAMESIZE is 1M, and PGFIX is NO, Db2 uses 4 KB frames.

    The frame size can be changed to 2 GB only if 2 GB of real memory isavailable. In addition, 2 GB of buffer storage must be available. If 2 GB framescannot be allocated, Db2 allocates 1 MB frames.

    The following examples demonstrate the number of 2 GB frames that areallocated for various VPSIZE values and 4 KB buffer pools. This information issubject to change, and is intended only to give an approximate idea of the waythat frames are allocated.

    VPSIZENumber of 2 GBframes allocated Comment

    100 0 The amount of storage that is availableis less than 2 GB, and is less than theinternally defined limit for rounding upto 2 GB.

    498688 1 The amount of storage that is availableis less than 2 GB, but is within aninternally defined limit for rounding upto 2 GB.

    524288 1 The amount of storage that is availableis exactly 2 GB.

    549888 1 The amount of storage that is availableis greater than 2 GB, and less than aninternally defined limit for rounding upto 4 GB.

    Abbreviation: FRAME

    VPSEQT ( integer ) Changes the sequential steal threshold for the buffer pool.

    This threshold is a percentage of the buffer pool that might be occupied bysequentially accessed pages. The pages can be in any state: updated, in-use, oravailable.

    The getpage operations for a transaction are classified as sequential if thetransaction attempts to prefetch the pages. The buffers that contain those pagesare governed by VPSEQT, which makes them more likely to be stolen ordemoted out of the buffer pool than buffers that are not governed by VPSEQT.A random buffer can never be reclassified as sequential, but a sequential bufferthat is touched by a random getpage operation is classified as random.

    The value of integer specifies the sequential steal threshold for the buffer pool.This value is expressed as a percentage of the total buffer pool size. The valueof integer must be 0 - 100, inclusive. The default value is 80.

    The sequential steal threshold:v Prevents a sequential scan, a disorganized index scan, or certain other

    prefetch operations from overwhelming the buffer poolv Helps reduce synchronous I/O by favoring random pagesv Affects the allocation of buffers and least-recently used (LRU) algorithms

    If PGSTEAL(LRU) is specified for a buffer pool, and the number of sequentialbuffers in the pool is less than the VPSEQT value, Db2 steals the oldest buffer.

    30 Command Reference

  • When the number of sequential buffers in the pool is greater than the VPSEQTvalue, Db2 steals the oldest sequential buffer.

    Buffers that are classified as sequential are stolen more quickly than buffersthat are classified as random because VPSEQT limits the number of sequentialbuffers. Therefore, Db2 uses random buffers more than sequential buffers toreduce the frequency of synchronous I/O. As a result, Db2 might use moreasynchronous prefetch I/O. Db2 classifies a buffer as sequential when a bufferis allocated for one of the following purposes:v For use by Db2 prefetchv For reading a LOB

    Buffers for reading LOBs are classified as sequential because LOB pages areless likely to be referenced again than other types of pages.

    v When a Db2 utility is writing a new Db2 data set sequentially

    Db2 might also reclassify a sequential buffer as a random buffer if a randomgetpage operation touches a sequential buffer.

    Setting VPSEQT to 0 disables prefetch. Any sequentially accessed pages arediscarded when the number of available buffers is exceeded by the number ofobjects that are accessed. You can set VPSEQT to 0 to avoid unnecessaryprefetch scheduling when the pages are already in the buffer pool, such as inthe case of in-memory indexes or data. However, setting VPSEQT to 0 mightdisable parallelism. You can achieve the same result, and use fewer systemresources, by specifying PGSTEAL(NONE).

    To avoid accelerated LRU dem