CA RC/Migrator for DB2 for z/OS User Guide - CA Technologies

9 downloads 133 Views 4MB Size Report
This documentation and any related computer software help programs ( hereinafter referred to as the. "Documentation") are for your informational purposes only ...
CA RC/Migrator for DB2 for z/OS ™

User Guide r12

This documentation and any related computer software help programs (hereinafter referred to as the "Documentation") are for your informational purposes only and are subject to change or withdrawal by CA at any time. This Documentation may not be copied, transferred, reproduced, disclosed, modified or duplicated, in whole or in part, without the prior written consent of CA. This Documentation is confidential and proprietary information of CA and may not be used or disclosed by you except as may be permitted in a separate confidentiality agreement between you and CA. Notwithstanding the foregoing, if you are a licensed user of the software product(s) addressed in the Documentation, you may print a reasonable number of copies of the Documentation for internal use by you and your employees in connection with that software, provided that all CA copyright notices and legends are affixed to each reproduced copy. The right to print copies of the Documentation is limited to the period during which the applicable license for such software remains in full force and effect. Should the license terminate for any reason, it is your responsibility to certify in writing to CA that all copies and partial copies of the Documentation have been returned to CA or destroyed. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, LOST INVESTMENT, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE. The use of any software product referenced in the Documentation is governed by the applicable license agreement and is not modified in any way by the terms of this notice. The manufacturer of this Documentation is CA. Provided with "Restricted Rights." Use, duplication or disclosure by the United States Government is subject to the restrictions set forth in FAR Sections 12.212, 52.227-14, and 52.227-19(c)(1) - (2) and DFARS Section 252.2277014(b)(3), as applicable, or their successors. Copyright © 2009 CA. All rights reserved. All trademarks, trade names, service marks, and logos referenced herein belong to their respective companies.

CA Product References This document references the following CA products: ■

CA Database Analyzer™ for DB2 for z/OS (CA Database Analyzer)



CA Fast Check® for DB2 for z/OS (CA Fast Check)



CA Fast Load for DB2 for z/OS (CA Fast Load)



CA Fast Recover™ for DB2 for z/OS (CA Fast Recover)



CA Fast Unload® for DB2 for z/OS (CA Fast Unload)



CA Log Analyzer™ for DB2 for z/OS (CA Log Analyzer)



CA Plan Analyzer® for DB2 for z/OS (CA Plan Analyzer)



CA Quick Copy for DB2 for z/OS (CA Quick Copy)



CA Rapid Reorg® for DB2 for z/OS (CA Rapid Reorg)



CA RC/Compare™ for DB2 for z/OS (CA RC/Compare)



CA RC/Extract™ for DB2 for z/OS (CA RC/Extract)



CA RC/Migrator™ for DB2 for z/OS (CA RC/Migrator)



CA RC/Query® for DB2 for z/OS (CA RC/Query)



CA RC/Secure™ for DB2 for z/OS (CA RC/Secure)



CA RC/Update™ for DB2 for z/OS (CA RC/Update)

Contact CA Contact Technical Support For your convenience, CA provides one site where you can access the information you need for your Home Office, Small Business, and Enterprise CA products. At http://ca.com/support, you can access the following: ■

Online and telephone contact information for technical assistance and customer services



Information about user communities and forums



Product and documentation downloads



CA Support policies and guidelines



Other helpful resources appropriate for your product

Provide Feedback If you have comments or questions about CA product documentation, you can send a message to [email protected]. If you would like to provide feedback about CA product documentation, complete our short customer survey, which is also available on the CA Support website, found at http://ca.com/docs.

Documentation Changes The following documentation updates have been made since the last release of this documentation: ■

"Possible Global Changes" (see page 82)—Now includes sequences.



“Table Global Changes” (see page 91)—Added TEXT CREATOR and TEXT NAME description items.



"Sequence Global Changes" (see page 93)—New topic.



“View Global Changes” (see page 98)—Added TEXT T/V CREATOR, TEXT T/V NAME, TEXT UDF SCHEMA, and TEXT UDF NAME descriptions.



“Routine Global Changes” (see page 105)—New topic.



“Trigger Global Changes” (see page 109)— Added TEXT T/V CREATOR, TEXT T/V NAME, TEXT UDF/SP SCHEMA, TEXT UDF/SP NAME, TEXT SQ SCHEMA, and TEXT SQ NAME parameter descriptions.



“Table Object Attributes for a Rule Set” (see page 121)—Added MATERIALIZED, REFRESH, ENABLE, MAINTENANCE, ISOLATION, and TEXT rule descriptions; removed UNIQUE_CONSTRAINT, UNIQUE_TYPE, and UNIQUE_COLNAME; added the following attributes: RESTARTWITH, ORDER PAIR_FOREIGN_KEYS (and FOREIGN_KEY_NAME, FOREIGN_KEY_TBCREATOR, FOREIGN_KEY_TBNAME, FOREIGN_KEY_DELRULE subordinates), MOVE_UNPAIRED_SRC_FKS, DROP_UNPAIRED_TRG_FKS, PAIR_CONSTRAINTS, CONSTRAINT_NAME, CONSTRAINT_TYPE, MOVE_UNPAIRED_SRC_CONSTS, DROP_UNPAIRED_TRG_CONSTS.



"Sequence Object Attributes for a Rule Set" (see page 132)—New topic.



“Conditional Automatic Symbols for All Objects” (see page 178)—Added GENIDOVR and IDOVRRID to the special-use symbolics table.



"Select Dependent, Parent, and Related Objects" (see page 232)—Added "MQT Implode" and "SEQ Implode" bullet items to Step 3.



“Routine Implode” (see page 237)—New topic.



“MQT Implode” (see page 237)—New topic.



“Sequence Implode” (see page 237)—New topic.



"Migrate All Dependent Objects of the Primary Objects" (see page 248)— New topic.



"Migrate All Objects Related to the Primary Objects" (see page 249)—New topic.



"Remove Implode and Explode Selections for All Related Objects" (see page 250)—New topic.



“Sequence is the Primary Object” (see page 268)—New topic.



"Sequence Defaults" (see page 278)—New topic.



“Alteration Considerations” (see page 292)—Updated table entries: ■

Corrected the Table row entry to remove ‘data type’ and ‘length’ as reasons for drop/recreate because now, with Online Schema Evolution support, we generate the ALTERs as opposed to DROP/CREATE.



Added table row for Sequence.



"Propagation of Changes" (see page 295)—Added sequence content.



"RCMTOLR Data Set Usage During Analysis" (see page 352)—New topic



"Control Options" (see page 369)—Added MQT Implode, TABLE OBID, SEQ Implode, MQT REFRESH, Drop & Re-Create, and descriptions.



“Relationship of MQT REFRESH and ALL ROWS Analysis Options” (see page 389)—New topic.



"How to Use RTN IMPLODE and RTN INTERACTION During Analysis" (see page 390)—New topic.



“ALTER SEQUENCE Syntax” (see page 423)—New topic.



"Supported Tablespace Formats for RC/Merger" (see page 430)—New topic.



“Sequence” (see page 483)—New topic.



"Online Schema Support Regarding Table Alterations" (see page 571)—New topic



"MQT Restrictions" (see page 594)—New topic.



“Access MQT Functions from a Migration Strategy” (see page 597)—New topic.



“Access MQT Functions from an Alteration Strategy” (see page 598)—New topic.



“Access MQT Functions from a Comparison Strategy” (see page 599)—New topic.



"Isolation Level Considerations for MQTs" (see page 600)—New topic.



"Online Schema Support Regarding Index Alterations" (see page 634)—New topic.



"Overview of Sequences" (see page 659)—New topic.



“Access Sequence Functions from a Migration Strategy” (see page 659)— New topic.



“Access Sequence Functions from an Alteration Strategy” (see page 660)— New topic.



“Access Sequence Functions from a Comparison Strategy” (see page 661)—New topic.

Contents Chapter 1: Introduction

27

Overview of CA RC/Migrator .................................................................................................. 27 Benefits ............................................................................................................................. 28 Increases Productivity .................................................................................................... 28 Maintains DB2 System Integrity ....................................................................................... 29 Performs Impact Analysis ................................................................................................ 29 Provides DDL Backup...................................................................................................... 29 Facilitates Global Changes ............................................................................................... 29 Preserves Referential Integrity ......................................................................................... 29 Provides Recovery Option................................................................................................ 30 Automates Subsystem and DDL File Comparison ................................................................ 30 Product Overview ................................................................................................................ 30 Strategy Services........................................................................................................... 31 DB2 Object Migration ..................................................................................................... 32 DB2 Object Alterations ................................................................................................... 34 Compare Facility ............................................................................................................ 35 Analysis Facility ............................................................................................................. 39 Execution Facility ........................................................................................................... 41 Execution Monitor .......................................................................................................... 42 Advanced Features ......................................................................................................... 43 Access the Product Options ................................................................................................... 47 Header Fields ................................................................................................................ 47 Object Management Screen Headers................................................................................. 48 Selection Screens ................................................................................................................ 48 Selection Screen Header ................................................................................................. 49 Primary Object Selection Screens ..................................................................................... 49 Dependent Object Selection Screens ................................................................................. 51 Other Product Components.............................................................................................. 53 Primary Commands ............................................................................................................. 53 Scrolling and Expanding Fields .............................................................................................. 53 Syntax Checking ................................................................................................................. 54 Access the Syntax Checker .............................................................................................. 55 Syntax Checker Report ................................................................................................... 57 VSAM Read Option .............................................................................................................. 59 FULLTREE BUILD Option ....................................................................................................... 60 VIEWSCAN Option ............................................................................................................... 60

Contents 9

Chapter 2: Operational Considerations

61

Product Authorization ........................................................................................................... 61 Product Functions .......................................................................................................... 61 Activate Model Services .................................................................................................. 62 Deactivate Model Services ............................................................................................... 62 DB2 Security ................................................................................................................. 62 Authorization IDs ................................................................................................................ 65 Primary ID .................................................................................................................... 65 Secondary ID ................................................................................................................ 65 AUTH Command ............................................................................................................ 65 SQL ID ......................................................................................................................... 65 Authorization ID Summary .............................................................................................. 67

Chapter 3: Profile

69

Access the Profile Menu ........................................................................................................ 69 Define Global Operational Parameters .................................................................................... 70 Updating Output Specifications ........................................................................................ 72 Default Considerations .................................................................................................... 75 Global Change Services ........................................................................................................ 75 Access Global Change Services ........................................................................................ 76 Create Global Change Sets .............................................................................................. 77 Maintain Global Change Sets ........................................................................................... 78 Masks .......................................................................................................................... 80 Object Types for Global Changes ...................................................................................... 82 Global Changes and Edits .............................................................................................. 111 Priority of Global Changes ............................................................................................. 112 Validation ................................................................................................................... 113 CHANGE Command ...................................................................................................... 113 Compare Rule Database Services ......................................................................................... 114 Considerations When Working with Rule Sets ................................................................... 115 Create a Rule Set ......................................................................................................... 115 View and Update Existing Rule Set Attributes ................................................................... 116 Common Object Attributes for a Rule Set ........................................................................ 117 Storage Group Object Attributes for a Rule Set................................................................. 117 Database Object Attributes for a Rule Set ........................................................................ 117 Tablespace Object Attributes for a Rule Set ..................................................................... 118 Table Object Attributes for a Rule Set ............................................................................. 121 Index Object Attributes for a Rule Set ............................................................................. 126 Synonym Object Attributes for a Rule Set ........................................................................ 129 View Object Attributes for a Rule Set .............................................................................. 129 Alias Object Attributes for a Rule Set .............................................................................. 130

10 User Guide

Trigger Object Attributes for a Rule Set ........................................................................... 131 Sequence Object Attributes for a Rule Set ....................................................................... 132 Compare Automapping Mask Services .................................................................................. 133 Accessing Automapping Mask Services ............................................................................ 133 Automap Mask Services Screen ...................................................................................... 133 Compare Automapping Masks Screen.............................................................................. 134 Exiting the Screen ........................................................................................................ 137 Managed Output Maintenance ............................................................................................. 137 Access the Managed Output Maintenance Facility .............................................................. 138 Set Managed Output Maintenance Defaults ...................................................................... 138 Apply Output Maintenance to a Single Strategy ................................................................ 139 Applying Managed Output Maintenance ........................................................................... 139 Managed Output Maintenance Reports ............................................................................ 146 Managed Output Maintenance PARM Records ................................................................... 162

Chapter 4: Expert Profile

165

Access the Expert Profile Menu ............................................................................................ 165 Utility Model Services ......................................................................................................... 166 Model IDs ................................................................................................................... 166 Default Model ID .......................................................................................................... 167 Utility Model Services Privilege ....................................................................................... 168 Maintain General Model Services .................................................................................... 168 Maintaining Model IDs .................................................................................................. 169 Example Model Utility ................................................................................................... 173 Conditional Logic ......................................................................................................... 174 Symbolic Parameters .................................................................................................... 176 Conditional Automatic Symbols ...................................................................................... 186 Model Symbols Screen .................................................................................................. 187 Automatic Symbolics .................................................................................................... 188 Edit the Model Utility Text ............................................................................................. 189 %CALC Function .......................................................................................................... 189 %SUBSTR Function ...................................................................................................... 190 Utilities Referenced by @DEFAULT .................................................................................. 190 Model Utility Control Statements .................................................................................... 192 Model Utilities Work Data Sets ....................................................................................... 194 Model Utility Data Set Calculations ................................................................................. 196 Model Utility Partition Level Support ............................................................................... 197 Model Services Frequently Asked Questions........................................................................... 199 Changing Utility Models by Exclusion and Inclusion ........................................................... 199 No Generation of Resume No Replace in a Tablespace ....................................................... 200 Adding a DCLGEN Utility ............................................................................................... 200 Logging Based on Unload Size ....................................................................................... 202

Contents 11

Specifying an Expiration Date or Retention Period on a Tape .............................................. 202 Sending the Unload Data Set to Tape .............................................................................. 203 Copy Group Services.......................................................................................................... 203 Access Copy Group Services .......................................................................................... 204 Create and Maintain Copy Group Sets ............................................................................. 204 Specify Utility Options for a Member of a Copy Group Set .................................................. 207 Catalog PDS Unload ........................................................................................................... 208 Prepare JCL for Batch Execution ..................................................................................... 208 Using the PDS and ACM Options Together........................................................................ 210 Importing ICL ................................................................................................................... 211 Import ICL Dataset Screen ............................................................................................ 211 Producing DDL from the Imported ICL............................................................................. 213

Chapter 5: Strategy Services Facility

215

Overview of the Strategy Services Facility ............................................................................. 215 Strategy Services Panel ...................................................................................................... 216 Strategy Specification Fields .......................................................................................... 216 Processing .................................................................................................................. 218 Strategy and Analysis Output Options ............................................................................. 219 List Option .................................................................................................................. 221 Analysis Row Protect Option .......................................................................................... 221 Share Options ............................................................................................................. 222 Scrolling ..................................................................................................................... 223 Commands ................................................................................................................. 224 Processing Strategies ......................................................................................................... 224 Create and Update a Strategy ........................................................................................ 225 Delete a Strategy ......................................................................................................... 225 Analyze Strategies ....................................................................................................... 226 Reanalyze a Strategy ................................................................................................... 226 Quick Migration Updates and Reanalysis .......................................................................... 227 Exit Strategy Services .................................................................................................. 227 Strategy Maintenance ........................................................................................................ 227

Chapter 6: Migration Strategies

229

Defining a Strategy............................................................................................................ 229 Processing Flow ........................................................................................................... 230 How to Define a Migration Strategy ................................................................................ 231 Processing Considerations ............................................................................................. 233 Migration Structure ............................................................................................................ 234 Explode ...................................................................................................................... 235 Implode...................................................................................................................... 235

12 User Guide

Auxiliary Implode ......................................................................................................... 236 Routine Implode .......................................................................................................... 237 Implode MQT .............................................................................................................. 237 Sequence Implode ....................................................................................................... 237 Referential Integrity ..................................................................................................... 238 Create a Migration Strategy ................................................................................................ 239 Selection Criteria ......................................................................................................... 241 Compound Search Conditions ........................................................................................ 241 Where Field................................................................................................................. 241 Primary Object Selection ............................................................................................... 242 Implode/Explode Services ............................................................................................. 242 Dependent Object Selection........................................................................................... 250 Creating New Objects ........................................................................................................ 253 Editing Existing Objects ...................................................................................................... 254 Quickly Select Objects for Migration and Analysis ................................................................... 254 Quick Migration JCL Statements ..................................................................................... 257 Quick Migration Updates and Reanalysis .......................................................................... 259 Group Migration ................................................................................................................ 259 Migration Considerations .................................................................................................... 260 Using the Charts .......................................................................................................... 261 Storage Group is the Primary Object ............................................................................... 261 Database Is the Primary Object...................................................................................... 263 Tablespace Is the Primary Object ................................................................................... 265 Table Is the Primary Object ........................................................................................... 266 Sequence Is the Primary Object ..................................................................................... 268 Index Is the Primary Object........................................................................................... 268 View Is the Primary Object ............................................................................................ 270 Synonym/Alias Is the Primary Object .............................................................................. 271 Referential Integrity Alterations ..................................................................................... 273 Referential Integrity Rebuild Strategy ............................................................................. 274 Propagation of Changes...................................................................................................... 275 Storage Group ............................................................................................................. 275 Database .................................................................................................................... 275 Tablespace.................................................................................................................. 276 Table ......................................................................................................................... 276 View .......................................................................................................................... 277 Synonyms or Aliases .................................................................................................... 278 Sequence ................................................................................................................... 278 Additional Information ....................................................................................................... 279 Auxiliary Implode ......................................................................................................... 279 Tablespaces ................................................................................................................ 279 SYSIBM Objects ........................................................................................................... 279 Analysis Output ........................................................................................................... 280

Contents 13

Chapter 7: Alteration Strategies

281

Overview of Alteration Strategies ......................................................................................... 281 Defining a Strategy............................................................................................................ 282 Alteration Strategy Quick Steps ..................................................................................... 283 Alteration Strategy Services ................................................................................................ 285 Alter Report Output ...................................................................................................... 288 Processing .................................................................................................................. 288 Alteration Explode List .................................................................................................. 289 Object Creation and Alteration ....................................................................................... 290 Object Selection ................................................................................................................ 291 Object Alterations.............................................................................................................. 292 Alteration Considerations .................................................................................................... 292 Referential Integrity Alterations ........................................................................................... 293 Foreign Key Changes .................................................................................................... 293 Unique Constraint Changes ........................................................................................... 294 Referential Integrity Rebuild Strategy ............................................................................. 294 Propagation of Changes...................................................................................................... 295

Chapter 8: Compare Strategies

297

Comparing Subsystems ...................................................................................................... 297 Synchronizing Logical Designs with Physical Databases...................................................... 297 Automapping Comparisons ............................................................................................ 298 DDL File Comparisons ................................................................................................... 298 Comparison Strategies, Strategy Analysis, and Execution .................................................. 299 Additional Compare Facility Features .............................................................................. 299 Process Overview .............................................................................................................. 300 Compare Strategy Flow................................................................................................. 302 Compare Strategy Quick Steps ...................................................................................... 304 Compare Strategy Services ................................................................................................. 307 Compare Option Menu Screen ........................................................................................ 307 Create Compare Strategy panel ..................................................................................... 308 Source and Target Subsystem Specifications .................................................................... 310 Source SQL Specifications ............................................................................................. 312 Rule Sets .................................................................................................................... 314 Automapping Masks ..................................................................................................... 315 Import SQL Error Report ............................................................................................... 317 Primary Object Mapping ..................................................................................................... 317 Mapping Objects .......................................................................................................... 319 Automapping............................................................................................................... 320 Selected Object Queue ................................................................................................. 321 Editing Primary Objects ................................................................................................ 321

14 User Guide

CA RC/Query Reporting ................................................................................................ 322 Dependent Object Mapping ................................................................................................. 322 Compare Explode Services Screen .................................................................................. 322 Multiple Global Change Sets .......................................................................................... 327 Compare Strategy Information Screen ............................................................................ 329 Create/Drop Selection Screen ........................................................................................ 330 Templating Existing Objects .......................................................................................... 333 Choosing Some Dependents .......................................................................................... 333 Re-Pairing Dependents ................................................................................................. 337 Choosing All Dependents ............................................................................................... 338 Excluding Unmapped Dependents ................................................................................... 338 Keeping Original Target Dependent Objects (O)................................................................ 340 Edit Dependent Objects ................................................................................................ 340 Compare Report Output ..................................................................................................... 341 Table Column Mapping ....................................................................................................... 341 Saving the Strategy ........................................................................................................... 343

Chapter 9: CA RC/Extract Strategies

345

What Is CA RC/Extract?...................................................................................................... 345 Basic Process Flow ....................................................................................................... 346 Overview of CA RC/Extract Strategies................................................................................... 347 Create a CA RC/Extract Strategy Type .................................................................................. 347 Analyze a CA RC/Extract Strategy ........................................................................................ 348 Update Extraction Analysis Options ................................................................................. 349

Chapter 10: Analysis

351

Overview of Analysis .......................................................................................................... 351 RCMTOLR Data Set Usage During Analysis ............................................................................ 352 Analysis Options................................................................................................................ 352 Processing Flow ................................................................................................................ 354 Analysis Screens ............................................................................................................... 354 Accessing Analysis Screens ........................................................................................... 355 Analysis Screen Layout ................................................................................................. 355 Group Migration Analysis Considerations ......................................................................... 363 Analysis Options Panels ...................................................................................................... 367 Control Options ........................................................................................................... 369 Utility Options ............................................................................................................. 377 Output Options ............................................................................................................ 380 Dataset Delete Options ................................................................................................. 381 Data Unload Options .................................................................................................... 381 Model Options ............................................................................................................. 383

Contents 15

IDCAMS Options .......................................................................................................... 385 Exclusive Options ......................................................................................................... 387 Relationship of MQT REFRESH and ALL ROWS Analysis Options ........................................... 389 How to Use RTN IMPLODE and RTN INTERACTION During Analysis ...................................... 390 Recovery Option................................................................................................................ 391 Executing ................................................................................................................... 392 Recovery Options Screen .............................................................................................. 396 Recovery Processing ..................................................................................................... 396 Valid PARMFILE DD Analysis Parameters for Any Strategy ....................................................... 397 Creator, Strategy Name, and Strategy Location Specifications ............................................ 397 Execution Specifications ................................................................................................ 397 Access Specifications .................................................................................................... 398 Output Analysis Specifications ....................................................................................... 398 Control Parameters ...................................................................................................... 398 Data Unload Parameters ............................................................................................... 399 Exclusive Parameters ................................................................................................... 399 Utility Parameters ........................................................................................................ 399 Output Listing Parameters ............................................................................................. 400 Data Set Delete Parameters .......................................................................................... 400 Idcam Parameters........................................................................................................ 401 Model Parameters ........................................................................................................ 401 Ruleset Specifications ................................................................................................... 401 Global Change Sets ...................................................................................................... 401 Control Parameters for Recovery Analysis ........................................................................ 402 Data Unload Parameters for Recovery Analysis ................................................................. 402 Exclusive Parameter for Recovery Analysis ...................................................................... 402 Utility Parameters for Recovery Analysis .......................................................................... 402 Output Listing Parameters for Recovery Analysis .............................................................. 403 Data Set Delete Parameters for Recovery Analysis ............................................................ 403 Output Analysis Specifications for Recovery Analysis ......................................................... 403 Model Parameters for Recovery Analysis .......................................................................... 404

Chapter 11: Incremental Change Language

405

Overview of ICL ................................................................................................................ 405 Producing the ICL .............................................................................................................. 406 ICL Analysis Output ...................................................................................................... 406 Producing DDL from ICL ..................................................................................................... 409 Select the ICL Output for Analysis .................................................................................. 409 ICL to DDL Analysis Output ........................................................................................... 411 Group ICL to DDL .............................................................................................................. 416 Preparing and Accessing the Copy Group Set ................................................................... 416 Invoking Group ICL to DDL Analysis ............................................................................... 416

16 User Guide

Group ICL to DDL Analysis Output .................................................................................. 418 Submitting the DDL ........................................................................................................... 418 Selecting the DDL Output for Submission ........................................................................ 418 Submitting the DDL Output for Processing ....................................................................... 419 Import ICL ....................................................................................................................... 419 Producing DDL from the Imported ICL............................................................................. 420 ICL Command Syntax ........................................................................................................ 421 Command Notation ...................................................................................................... 421 ALTER ALIAS Syntax .................................................................................................... 421 ALTER DATABASE Syntax .............................................................................................. 422 ALTER INDEX Syntax .................................................................................................... 422 ALTER SYNONYM Syntax ............................................................................................... 423 ALTER SEQUENCE Syntax ............................................................................................. 423 ALTER STOGROUP Syntax ............................................................................................. 423 ALTER TABLE Syntax .................................................................................................... 424 ALTER TABLESPACE Syntax ........................................................................................... 426 ALTER VIEW Syntax ..................................................................................................... 427

Chapter 12: RC/Merger

429

Overview of RC/Merger ...................................................................................................... 429 Processing ........................................................................................................................ 429 Supported Tablespace Formats for RC/Merger ....................................................................... 430 Strategies ........................................................................................................................ 431 Moving and Copying Objects .......................................................................................... 431 Move Considerations .................................................................................................... 431 Copy Considerations ..................................................................................................... 432 Move and Copy Restrictions ........................................................................................... 433 Data Change Considerations .......................................................................................... 433 Quick Steps ...................................................................................................................... 434 Analyze the Strategy .................................................................................................... 434 Stop the Source Tablespaces ......................................................................................... 435 Execute the Move ........................................................................................................ 435 Information About the .CALL RCMERGER Cards ................................................................ 436 Specify Analysis Options ..................................................................................................... 437 Specify Move and Copy Options ........................................................................................... 437

Chapter 13: Analysis Output

441

Analysis Output Files.......................................................................................................... 441 Managed Output ............................................................................................................... 441 Access the Managed Output Feature ............................................................................... 442 Analysis Screen with Managed Output Off ........................................................................ 443

Contents 17

Analysis Screen with RC/M Managed Output On ................................................................ 444 Strategy Services Panel ................................................................................................ 444 Using the Analysis Output ............................................................................................. 446 Executing an Analysis ................................................................................................... 446 Managed Output Selection Screen .................................................................................. 447 Change Analysis Report ...................................................................................................... 449 Analysis Output File ........................................................................................................... 449 Header ....................................................................................................................... 450 Commands ................................................................................................................. 453 Impact Analysis ........................................................................................................... 454 RPT IN DDLFILE ........................................................................................................... 456 Analysis Messages ............................................................................................................. 456 Compare Report ................................................................................................................ 456

Chapter 14: Execution Facility

457

Overview of the Execution Facility ........................................................................................ 457 Analysis ........................................................................................................................... 458 Analyze a Strategy Online ............................................................................................. 458 Analyze a Strategy in Batch Mode .................................................................................. 459 Submission....................................................................................................................... 463

Chapter 15: Execution Display Facility

465

Overview of the Execution Display Facility ............................................................................. 465 Usage .............................................................................................................................. 466 Specifying Selection Criteria .......................................................................................... 466 Maintaining and Tracking the Executions ......................................................................... 469 BPID Considerations ..................................................................................................... 470 Custom Display Format ...................................................................................................... 470 Execution Display Commands .............................................................................................. 470 BPIDCHAR .................................................................................................................. 471 CYCLE ........................................................................................................................ 471 FORMAT ..................................................................................................................... 471 HEADER ..................................................................................................................... 472 PROFILE ..................................................................................................................... 472 SAVEF ........................................................................................................................ 472 SORT ......................................................................................................................... 473 UNFORMAT ................................................................................................................. 473 Define Execution Display Session Defaults............................................................................. 473

Chapter 16: Object Definition Defaults

475

Masking and ID Groups ...................................................................................................... 475

18 User Guide

Required Authorization ....................................................................................................... 475 Define Defaults for Attributes Used during Object Creation ...................................................... 476 Object Type Defaults ......................................................................................................... 477 Global Defaults ............................................................................................................ 477 Storage Group Defaults ................................................................................................ 479 Database Defaults ........................................................................................................ 480 Tablespace Defaults ..................................................................................................... 480 Table Defaults ............................................................................................................. 482 Sequence Defaults ....................................................................................................... 483 Index Defaults ............................................................................................................. 485 View Defaults .............................................................................................................. 486 Alias Defaults .............................................................................................................. 487

Chapter 17: Storage Group

489

Overview of Storage Groups ............................................................................................... 489 Storage Group Functions .................................................................................................... 490 Accessing Storage Group Functions ...................................................................................... 490 Selection Screens ........................................................................................................ 491 Storage Groups Compared to VSAM Data Sets ................................................................. 493 Commands ................................................................................................................. 493 Storage Group Create Option .............................................................................................. 494 Storage Group Create Screen ........................................................................................ 494 Processing Considerations ............................................................................................. 495 Confirming the Creation ................................................................................................ 495 Storage Group Template Option .......................................................................................... 495 Storage Group Alter Option ................................................................................................. 496 Drop Considerations .......................................................................................................... 496 DDL Execution .................................................................................................................. 497

Chapter 18: Database

499

Overview of Databases ....................................................................................................... 499 Accessing Database Functions ............................................................................................. 499 Alteration Strategy ....................................................................................................... 500 Migration Strategy ....................................................................................................... 500 Compare Strategy ........................................................................................................ 500 Selection Screens .............................................................................................................. 501 Commands ....................................................................................................................... 502 Database Create ............................................................................................................... 502 Database Alter Screen .................................................................................................. 502 Confirming the Creation ................................................................................................ 504 Storage Group Object Selection Screen ........................................................................... 504

Contents 19

Database Template ............................................................................................................ 505 Database Alter .................................................................................................................. 505 Create a Database for Declared Temporary Tables ................................................................. 506 Drop Considerations .......................................................................................................... 506 DDL Execution .................................................................................................................. 506

Chapter 19: Tablespace

507

Product Features for Maintaining DB2 Tablespaces ................................................................. 507 Accessing Tablespace Functions ........................................................................................... 508 Alteration Strategy ....................................................................................................... 508 Migration Strategy ....................................................................................................... 508 Compare Strategy ........................................................................................................ 509 Define a VSAM Cluster ....................................................................................................... 509 Selection Screens .............................................................................................................. 510 Selection Criterion ....................................................................................................... 511 Screen Layout ............................................................................................................. 511 Selecting Tablespaces ................................................................................................... 513 Tablespace Create ............................................................................................................. 514 Creating Simple Tablespaces ......................................................................................... 514 Creating Segmented Tablespaces ................................................................................... 515 Creating Partitioned Tablespaces .................................................................................... 517 Tablespace Create Screen ............................................................................................. 519 Partition Information Fields ........................................................................................... 524 Group Bufferpool Cache Setting Pop-up Screen ................................................................ 527 Processing Considerations ............................................................................................. 527 Tablespace Template ......................................................................................................... 527 Tablespace Template Screen ......................................................................................... 528 LC Line Command ........................................................................................................ 528 Confirming the Template ............................................................................................... 528 Tablespace Alter................................................................................................................ 528 Change Tablespace Type from Simple to Segmented ......................................................... 529 Change Tablespace Type from Simple to Partitioned.......................................................... 530 Change Tablespace Type from Simple to Range-Partitioned ................................................ 530 Change Tablespace Type from Partitioned to Range-Partitioned .......................................... 531 Change Tablespace Type from Segmented to Partitioned ................................................... 532 Change Tablespace Type from Segmented to Range-Partitioned ......................................... 533 Alter the Index for a Table in a Partitioned Tablespace ...................................................... 533 Convert a Non-Partitioned Table to a TCP Table ................................................................ 534 Tablespace Alter Screen ................................................................................................ 535 Processing Considerations ............................................................................................. 535 LC Line Command ........................................................................................................ 536 Calculate Space Requirements for Tablespaces ...................................................................... 536

20 User Guide

Locate Free Space ............................................................................................................. 539 VSAM Cluster Definitions .................................................................................................... 541 Define a VSAM Cluster .................................................................................................. 543 LOB Tablespaces ............................................................................................................... 543 Tablespace Drop Considerations .......................................................................................... 544

Chapter 20: Table

545

Product Features for Maintaining DB2 Tables ......................................................................... 545 Accessing Table Functions .................................................................................................. 546 Alteration Strategy ....................................................................................................... 547 Migration Strategy ....................................................................................................... 547 Compare Strategy ........................................................................................................ 547 Selecting Tables .......................................................................................................... 548 Editing or Browsing Table Data in Views .......................................................................... 550 Table Create Screen .......................................................................................................... 550 Create a Table ............................................................................................................. 551 Table Definition Fields................................................................................................... 552 Column Definition Fields ............................................................................................... 557 Column Line Commands ............................................................................................... 563 Primary Commands ...................................................................................................... 566 Column Default Value Specifications Screen ..................................................................... 567 Inserting Columns from Other Tables .............................................................................. 568 Insert a Column........................................................................................................... 568 Insert a User-Defined Column ........................................................................................ 569 Table Template ................................................................................................................. 569 Table Alter ....................................................................................................................... 569 TABLE ALTER Statement ............................................................................................... 570 Alter Table Option ........................................................................................................ 570 Online Schema Support Regarding Table Alterations ......................................................... 571 Data Type Conversions ................................................................................................. 571 Changing the Table Type............................................................................................... 575 Drop Considerations ..................................................................................................... 575 Table-Controlled Partitioning ............................................................................................... 575 Migration Strategy Considerations .................................................................................. 576 Alteration Strategy Considerations.................................................................................. 577 Comparison Strategy Considerations............................................................................... 577 REORG Utility Restrictions ............................................................................................. 579 Convert from ICP to TCP ............................................................................................... 579 Convert a TCP Table to Use ICP ..................................................................................... 580 Manage Key Columns for a TCP Table ............................................................................. 582 Modify the Partitions and Limit Key Values of a TCP Table .................................................. 584 Auxiliary Tables................................................................................................................. 586

Contents 21

Identity Columns ............................................................................................................... 588 Create Identity Columns ............................................................................................... 588 Using the Value Command ............................................................................................ 588 View or Update Identity Column Attributes ...................................................................... 589 Determining the Default Value ....................................................................................... 592 Restart of Identity Column Numbering after a Table Reload................................................ 593 Materialized Query Tables (MQTs) ........................................................................................ 593 MQT Restrictions .......................................................................................................... 594 Access MQT Functions from a Migration Strategy .............................................................. 597 Access MQT Functions from an Alteration Strategy ............................................................ 598 Access MQT Functions from a Comparison Strategy........................................................... 599 Isolation Level Considerations for MQTs .......................................................................... 600 Table Check Constraints List Screen ..................................................................................... 600 SQL Editor Screen ............................................................................................................. 601 Referential Integrity........................................................................................................... 602 Referential Integrity Screen Flow.................................................................................... 602 Referential Integrity Fields on the Table Screens .............................................................. 603 Unique Constraints ....................................................................................................... 604 Referential Constraints ................................................................................................. 606 Display Referential Rules............................................................................................... 607

Chapter 21: Indexes

611

Product Features for Maintaining Indexes .............................................................................. 611 Accessing Index Functions .................................................................................................. 612 Alteration Strategy ....................................................................................................... 612 Migration Strategy ....................................................................................................... 612 Compare Strategy ........................................................................................................ 613 Selecting Indexes ........................................................................................................ 613 Create Index Option .......................................................................................................... 614 Create Non-Partitioned DB2 Indexes ............................................................................... 615 Create Partitioned DB2 Indexes ..................................................................................... 615 Index Alter Screen ....................................................................................................... 617 Index Table Selection Screen ......................................................................................... 627 Index Column Selection & Key Maintenance ..................................................................... 628 Processing Considerations ............................................................................................. 632 Confirming the Creation ................................................................................................ 632 Template Index Option ....................................................................................................... 632 Alter Index Option ............................................................................................................. 632 Processing Considerations ............................................................................................. 633 Online Schema Support Regarding Index Alterations ......................................................... 634 Change Non-Partitioned to Partitioned............................................................................. 634 Index Partitions Limit Keys Values Screen ....................................................................... 635

22 User Guide

Automatic Partitions Management ........................................................................................ 638 AUTOPARTS Command Syntax ....................................................................................... 638 Usage Notes................................................................................................................ 639 Calculate Space Requirements for Indexes ............................................................................ 639 Auxiliary Indexes .............................................................................................................. 641 Data-Partitioned Secondary Indexes (DPSIs) ......................................................................... 642 Create a DPSI ............................................................................................................. 642 Drop Considerations .......................................................................................................... 645 DDL Execution .................................................................................................................. 645

Chapter 22: View

647

Product Features for Maintaining Views ................................................................................. 647 Accessing View Functions ................................................................................................... 648 From CA RC/Update ..................................................................................................... 648 From CA RC/Migrator.................................................................................................... 648 Selection Screens .............................................................................................................. 649 Screen Layout ............................................................................................................. 649 Text Command ................................................................................................................. 651 Editing or Browsing View Data ............................................................................................. 652 Commands ....................................................................................................................... 652 Create View ...................................................................................................................... 652 View Create Screen ...................................................................................................... 652 SELECT Statement ....................................................................................................... 653 Table Selection ............................................................................................................ 654 Column Area ............................................................................................................... 654 Confirming the Creation ................................................................................................ 655 Template View .................................................................................................................. 655 Alter View ........................................................................................................................ 656 ALL Command .................................................................................................................. 656 Commands ....................................................................................................................... 657 Drop Considerations .......................................................................................................... 658

Chapter 23: Sequence

659

Overview of Sequences ...................................................................................................... 659 Access Sequence Functions from a Migration Strategy ............................................................ 659 Access Sequence Functions from an Alteration Strategy .......................................................... 660 Access Sequence Functions from a Comparison Strategy ......................................................... 661

Chapter 24: Synonyms

663

Overview of Synonyms....................................................................................................... 663 Product Features for Maintaining Synonyms .......................................................................... 663

Contents 23

Accessing Synonym Functions ............................................................................................. 663 Alteration Strategy ....................................................................................................... 664 Migration Strategy ....................................................................................................... 664 Compare Strategy ........................................................................................................ 664 Synonym Selection Screens ................................................................................................ 665 Screen Layout ............................................................................................................. 665 Create Synonym Option ..................................................................................................... 666 Table Selection Screen.................................................................................................. 666 Create Screen ............................................................................................................. 666 Specifying Other User IDs ............................................................................................. 667 User ID Selection Screen .............................................................................................. 667 Template Synonym Option .................................................................................................. 667 Alter Synonym Option ........................................................................................................ 667 Compare Command ........................................................................................................... 668 Drop Considerations .......................................................................................................... 668 DDL Execution .................................................................................................................. 668

Chapter 25: Alias

669

Overview of Aliases ........................................................................................................... 669 Product Features for Maintaining Aliases ............................................................................... 669 Accessing Alias Functions ................................................................................................... 670 From CA RC/Update ..................................................................................................... 670 From CA RC/Migrator.................................................................................................... 670 Selection Screens .............................................................................................................. 671 Editing or Browsing Alias Data ............................................................................................. 672 Commands ....................................................................................................................... 672 Alias Create ...................................................................................................................... 673 Create Screen ............................................................................................................. 673 Confirming the Alias Creation ........................................................................................ 674 Alias Template .................................................................................................................. 674 Alias Alter ........................................................................................................................ 675 Alias Drop ........................................................................................................................ 675 DDL Execution .................................................................................................................. 676

Chapter 26: Triggers

677

Overview of Triggers .......................................................................................................... 677 Accessing Trigger Functions ................................................................................................ 678 Alteration Strategy ....................................................................................................... 678 Migration Strategy ....................................................................................................... 678 Compare Strategy ........................................................................................................ 678 Selection Screens .............................................................................................................. 679

24 User Guide

Commands ....................................................................................................................... 680 Create Trigger .................................................................................................................. 680 Template Trigger ............................................................................................................... 683 Alter Trigger ..................................................................................................................... 683 Drop Trigger ..................................................................................................................... 683

Chapter 27: Routines

685

User Defined Functions....................................................................................................... 685 Stored Procedures ............................................................................................................. 685 Routine Processing ............................................................................................................ 686 DDL Requirements............................................................................................................. 686 Size Considerations ...................................................................................................... 687 Encoding Scheme Considerations ................................................................................... 687 Additional Considerations .............................................................................................. 687 DDL Statement Generation Sample ................................................................................ 689 Migrate a Routine .............................................................................................................. 690 Migrating an SQL Stored Procedure ...................................................................................... 692

Appendix A: Selection Screen Fields

695

Database ......................................................................................................................... 695 Storage Group .................................................................................................................. 695 Tablespace ....................................................................................................................... 696 Table ............................................................................................................................... 697 View ................................................................................................................................ 699 Index .............................................................................................................................. 700 Synonym/Alias .................................................................................................................. 702 Triggers ........................................................................................................................... 702

Appendix B: Batch Compare Facility

703

Overview of the Compare Facility ......................................................................................... 703 Merge Program ................................................................................................................. 703 MERGE Member ........................................................................................................... 704 Output File .................................................................................................................. 705 Return Codes .............................................................................................................. 705 MSGFILE .................................................................................................................... 705 Syntax Checker ................................................................................................................. 706 Syntax Member ........................................................................................................... 706 Output File .................................................................................................................. 708 Return Codes .............................................................................................................. 708 Message File ............................................................................................................... 708 Batch Compare Automap Strategy ....................................................................................... 708

Contents 25

Automap Member ........................................................................................................ 709 How to Perform a DDL-to-DDL Comparison in Batch .......................................................... 712 Return Codes .............................................................................................................. 713 Generate JCL for the Batch Analysis ..................................................................................... 713 Sample Compare JCL.................................................................................................... 714 Message File ............................................................................................................... 715 Final Processing ................................................................................................................ 715

Appendix C: Parallel Execution

717

Enable Parallel Execution .................................................................................................... 717 Split Analysis Output into Multiple Jobs ................................................................................. 718 Submit the First Job Manually ............................................................................................. 719 Restart if Jobs Fail ............................................................................................................. 720

Index

26 User Guide

721

Chapter 1: Introduction This section contains the following topics: Overview of CA RC/Migrator (see page 27) Benefits (see page 28) Product Overview (see page 30) Access the Product Options (see page 47) Selection Screens (see page 48) Primary Commands (see page 53) Scrolling and Expanding Fields (see page 53) Syntax Checking (see page 54) VSAM Read Option (see page 59) FULLTREE BUILD Option (see page 60) VIEWSCAN Option (see page 60)

Overview of CA RC/Migrator CA RC/Migrator is the product of choice for performing DB2 migrations, alterations, and subsystem and DDL file comparisons. It automates the process of migrating and altering DB2 objects, data, and security. With the addition of the Compare Facility, a separate component, you can now have automatic comparison and synchronization of your DB2 subsystems or DDL files. You can shape the migration, alteration, or comparison to fit specific requirements, decide what is included, and specify when you want the migration, alteration, or comparison to be performed. Note: This guide assumes the product has already been installed. For detailed installation information, see the CA Database Management Solutions for DB2 for z/OS Installation Guide and CA Database Management Solutions for DB2 for z/OS Implementration Guide. Using CA RC/Migrator, you can do the following: ■

Create, update, delete, display, copy, analyze, and execute a strategy



Permit migration of DB2 objects, security, and data between DB2 subsystems or within the same DB2 subsystem



Alter the definition of one or more DB2 objects with all changes automatically propagated to dependent objects, including views and indexes

Chapter 1: Introduction 27

Benefits



Compare and synchronize DB2 structures, including dependent structures such as indexes, views, synonyms, and aliases



Process strategies and produce executable output to perform the requested migration, alteration, or comparison



Execute the output from the processed strategies in online or batch mode and produce a complete audit trail



Track the execution of analysis and execution runs



Merge DDL files and check them for syntactical errors or compare and execute DDL files in batch mode



Integrate with CA RC/Extract to perform analysis on source definitions, create databases and tablespaces, and any dependent indexes, views, and aliases

Benefits CA RC/Migrator provides the following benefits: ■

Increases productivity (see page 28)



Maintains DB2 system integrity (see page 29)



Performs impact analysis (see page 29)



Provides DDL backup (see page 29)



Facilitates global changes (see page 29)



Preserves referential integrity (see page 29)



Provides recovery option (see page 30)



Automates subsystem and DDL file comparison (see page 30)

Increases Productivity CA RC/Migrator performs migration and DB2 alteration regularly in any DB2 environment. CA RC/Migrator automates the entire process. Any number of users can update the same migration, alteration, or comparison definition. Once all changes and specifications are made, you execute the analysis function, review the analysis output for warnings, and execute the migration, alteration, or comparison. You can execute the migration, alteration, or comparison immediately, or write the job to a data set or managed table for later execution by a job scheduling system. This provides you with immediate productivity gains in any DB2 environment.

28 User Guide

Benefits

Maintains DB2 System Integrity You can automatically maintain the integrity of the DB2 structures as part of a migration, alteration, or comparison. CA RC/Migrator performs any necessary SET CURRENT SQLID or authorization ID switching to correctly set the CREATOR and CREATEDBY fields. It takes synchronization points after every logical execution step for restartability. It creates all objects in a specific order to help ensure correct object creations. For example, before CA RC/Migrator creates a view, it creates any tables, views, or synonyms to which that view refers, and propagates any changes made to those objects to the dependent view.

Performs Impact Analysis You can request Impact Analysis as part of any alteration, comparison, or migration. CA RC/Migrator provides a summary that shows the effect of the DB2 object alteration or migration. You can also request data statistics that detail the volume of data to be unloaded or loaded as part of the strategy.

Provides DDL Backup CA RC/Migrator provides a DDL Only option that generates the necessary DDL statements to re-create a DB2 structure. The generated DDL re-creates the DB2 structure, including any referential integrity rules or security. You can save the DDL in a data set or managed table and use it as backup to recover from accidental drops or object alterations.

Facilitates Global Changes You can specify global changes as part of any migration, alteration, or comparison. CA RC/Migrator automatically propagates and consolidates global changes to dependent objects and any specific object edits. You can make a substantial number of changes to DB2 objects with minimal effort.

Preserves Referential Integrity You can preserve referential integrity without having to know all the relationships among the parent and child tables. The global RI option automatically includes tables contained within the referential integrity structure, giving you the assurance that referential structures always remain intact during alterations and migrations.

Chapter 1: Introduction 29

Product Overview

Provides Recovery Option All migrations, alterations, and comparisons are completely reversible when you specify the recovery option specified as part of your strategy. You can request utilities automatically as part of the recovery.

Automates Subsystem and DDL File Comparison With the addition of the optional Compare Facility through CA RC/Compare, you can automate comparison of test and production DB2 subsystems. While migration strategies enable the migration of a structure from one subsystem to another, comparison strategies let you compare two structures and create a union of or intersection between those structures. The Compare Facility provides a sophisticated tool for moving test objects into a production subsystem while maintaining the integrity of the production subsystem. For sites using CASE tools to design new DB2 structures, the Compare Facility lets you compare existing DB2 structures and DDL files alike. Note: CA RC/Compare does not compare security between source and target. It only compares DDL and then replaces any security that exists on a target subsystem.

Product Overview When migrating or altering DB2 objects or when comparing subsystems or DDL files, the basic steps are as follows: 1.

Create a strategy. Use the Strategy Services facility to create or update a strategy. You define each migration, alteration, or comparison with a strategy.

2.

Analyze a strategy. The Analysis Facility lets you specify options that control the overall strategy output and generates the commands necessary to perform the requested tasks. Some analysis options permit you to make global changes, request DB2 utilities, and control data migration. Using the same underlying strategy with different analysis options, you can generate multiple versions of the migration, alteration, or comparison.

3.

Execute. Use the Execution Facility to execute the actual migration, alteration, or comparison. The Execution Facility invokes the Batch Processor to execute all the commands generated by the Analysis Facility. The Batch Processor is restartable and produces a complete audit trail. An online Execution Monitor is also available for viewing the status of job executions.

30 User Guide

Product Overview

Strategy Services Strategy Services is a comprehensive facility for creating, deleting, copying, updating, and analyzing strategies that define the DB2 migration, alteration, subsystem comparison or DDL file comparison. If you specify the recovery option when creating migration, alteration, and comparison strategies, the executed strategy is fully reversible. You can execute utilities as part of the recovery.

Analysis Summary You can view a history of analysis executions for a strategy. You can execute all major functions from the Strategy Services panel. For example, to analyze a strategy, specify A (Analysis) next to the appropriate strategy name. The Strategy Services panel also serves as a report of all available strategies. You can control the strategy listing by entering selection criteria in the screen's header, then you can use the QPRINT command to print the strategy listing.

Multiple DB2 Subsystems You can store your strategies on a single central DB2 subsystem, regardless of the DB2 subsystem they reference. This capability makes it easy for you to track strategies across multiple DB2 subsystems.

Strategy Access Control You assign a share option to each strategy during creation. The share option denotes if you can view or update the strategy. If multiple users should be able to edit the same strategy (for example, to consolidate changes to multiple objects), you simply designate the strategy as updateable. When you finalize all your changes, you can switch the strategy to non-shareable to prevent further changes.

Autobuild The Autobuild feature lets you specify that all objects of a specific object type be included as part of the migration. As you add new objects, they are automatically included the next time you execute the migration.

Chapter 1: Introduction 31

Product Overview

DB2 Object Migration Object Migration lets you migrate DB2 objects, security, and data between DB2 subsystems or within the same DB2 subsystem. The target DB2 subsystem can be on a different CPU. You can include dependent or parent objects, bind dependent plans, and execute DB2 utilities as part of the migration. You can customize the migration by choosing exactly which objects to include and by specifying whether to include table and security data. You can also change objects as part of the migration. For each primary object selected, you can select the parent objects above the object (implode) and the dependent objects below the object (explode) in the DB2 hierarchy. The implode-explode concept provides an overall view of the primary objects and their related dependency selections.

Global Changes When you need to make extensive changes, you can make global changes that apply to all objects in the migration strategy, without having to edit each object.

Create New Objects Using the object edit screens, you can create new objects as part of a migration. The Template option creates a new object using an existing object as a template.

Object Security You can migrate security associated with specific objects, for all objects dependent on a primary object, or for all objects in the migration. You can mix options to match your specific needs.

Data Migration You can migrate all data, migrate a specific number of rows of data, or enter a SELECT statement. You can specify data migration options per table, for all tables related to a primary object, or for all tables in the migration. CA RC/Migrator performs any data type conversions resulting from table changes automatically as part of the unload process.

32 User Guide

Product Overview

Edit Existing Objects Sophisticated object edit screens are available for editing any of the objects involved in the migration. CA RC/Migrator automatically propagates all changes to any dependent objects. A compare mode is available for displaying the old and new versions of an object. Other sophisticated features include Space Estimation, Space Locator, and VSAM Define Facilities for tablespaces and indexspaces. The Space Estimation Facility also shows the effect of the row size and freespace parameters on the internal DB2 pages.

Object Definition Defaults Through the use of Object Definition Defaults, you can define defaults for DB2 object attributes to be used as the initial attribute values when creating new objects. You can establish object definition defaults for individuals or groups of users. You can assign defaults for groups of IDs by using a mask (valid TSO ID followed by an asterisk). The Product Authorizations facility lets you view and change the definition.

Auxiliary Implode The Auxiliary Implode option automatically includes any objects related to the migrated objects, even if they are not in the current migration structure. For example, if the storage group associated with a database is migrated, the tablespaces and indexspaces within the database might use different storage groups. Auxiliary Implode automatically includes the other storage groups as part of the migration.

Referential Integrity You can migrate referential integrity: locally and globally. The local option migrates referential integrity rules for the tables defined in the migration structure. The global option migrates all tables and rules defined within the referential structure, regardless of whether the tables are in the current migration structure. You can select one table in a referential integrity structure and CA RC/Migrator automatically includes all related tables. These options help ensure correct migration of referential integrity structures.

Group Migration Group migration allows for the migration of objects from a source subsystem to one or more target subsystems, or for the replication of objects multiple times within the target subsystem. You define the copy specifications by selecting a Copy Group set developed using the Copy Group Services option.

Chapter 1: Introduction 33

Product Overview

Copy Group Services Copy group services let you create and maintain multiple copy group sets of analysis criteria for performing group migrations. You can use these sets when analyzing migration strategies.

Quick Migration Quick migration services let you quickly select objects for migration without creating a migration strategy. After you have selected the objects on the Quick Migration Services screen, you can perform the analysis using the Quick Migration Analysis screen.

DB2 Object Alterations Alteration strategies let you change any number of DB2 objects with all changes automatically propagated to dependent objects, including views and indexes. Multiple users can alter the same object, or any number of different objects, and CA RC/Migrator consolidates and propagates all changes to dependent objects in one execution.

Edit Multiple Objects As part of one alteration strategy, you can edit any number of objects and object types. Simply choose the objects from selection lists and use the comprehensive edit screens to make your changes.

Drop Objects You can have objects dropped as part of an alteration or comparison strategy. You can also have an object dropped as part of a migration strategy by not including it in the migration.

Create New Objects You can create new objects as part of an alteration strategy. The Template option enables the creation of new objects based on existing ones.

Consolidation of Changes CA RC/Migrator consolidates and propagates all changes to all objects down to all dependent objects. A warning of any conflicting changes displays at analysis time.

34 User Guide

Product Overview

Change Validation When editing an object, you can request a summary of the changes made. CA RC/Migrator displays the old and new versions of the object so you can review changes easily.

Global Changes When you have to make extensive changes, you can make global changes that apply to all objects in the alteration strategy without having to edit each object.

Compare Facility The Compare Facility (CA RC/Compare) lets application developers and database administrators compare and synchronize DB2 structures, including dependent structures such as indexes, views, synonyms, and aliases. For example, using the you can move a test structure into production without compromising the production subsystem's structures or data with the Compare Facility. Comparison options include the following: ■

Subsystem to subsystem



Subsystem to DDL file



DDL file to subsystem



DDL file to DDL file



Automap

Note: CA RC/Migrator automatically checks for correct syntax in any DDL read. The result of the comparison can be a union, intersection, or a combination of the source and target structures. DDL file comparison options also provide an interface to CASE tools. CA RC/Migrator automatically generates all software code needed to make the target subsystem or file match the source. The Compare Facility also provides features to support one-to-many comparisons: you can map one source object to many target objects; you can specify a different Global Change set for each mapped pair; and, for automapping, you can specify more than one mask for the same object attribute.

Chapter 1: Introduction 35

Product Overview

Comparing Subsystems You can use the Compare Facility to compare DB2 object structures on the same or different subsystems, both local and remote. This option is particularly useful for moving an application from a test subsystem to the production subsystem. For example, when application programmers create a new application that uses existing objects and new objects, you have to add the new objects to the production subsystem and the existing objects might need to be changed. The Compare Facility merges the new object definitions with the existing object definitions. While you might have to move some new object attributes, such as new columns, from the test subsystem to the production subsystem, you should not move other new object attributes, such as smaller space allocations. The Compare Facility lets you specify which attributes should not be changed, enabling a comparison of the two subsystems and the ability to merge the two definitions while preserving data and security from the production subsystem.

Synchronizing Logical Designs with Physical Databases If DB2 operations are separated into application development and database administration, two DB2 subsystems might emerge: the logical design employed by application programmers using software engineering tools and the physical design managed by database administrators. Database administrators might make changes to the physical database, such as adding indexes to improve performance or changing space allocation to reflect new data expectations. When application programmers make changes to the logical database to accommodate new applications, they might not consider changes that may have been made to the physical database outside the scope of the application. To complicate matters, the logical database might exist only in the form of DDL or output from a CASE product, not as an actual DB2 database. When the logical database design varies greatly from the existing physical database, you need a tool that analyzes the differences and assists in merging the definitions and data. The Compare Facility lets you compare database structures and create a union or intersection of those structures. The Compare Facility provides a means of synchronizing the logical and physical databases and preserving dependent objects, security, and data.

Automapping Comparisons You can use the automapping option to create automatic comparisons of a logical design with a physical database. The Compare Facility takes full advantage of naming conventions and standards established in the design phase (especially in a CASE environment) and migrates them to the production system.

36 User Guide

Product Overview

This option compares all objects defined in a DDL file with objects in a subsystem, using masks to dictate matched object pairs. The comparison starts at the highest DB2 level requested, matches all possible pairs, and then moves down the DB2 hierarchy, matching dependent objects at each level. CA RC/Migrator generates the software code required to promote the changes of the logical design to the physical design with minimal input from you.

DDL File Comparison If the DDL descriptions of the subsystems to be compared are available, CA RC/Migrator can compare the DDL files directly, saving valuable computer resources. This option is particularly valuable when different development groups generate DDL for their project components and you have to merge and compare that DDL. CA RC/Migrator automatically checks the DDL file syntax before it saves the comparison strategy. It then displays incorrect DDL statements and messages that describe the nature of the error. Important! If your DDL input does not include the structure of the object from CREATE DDL, then the analysis from CA RC/Migrator will be unpredictable.

Comparison Strategies, Strategy Analysis, and Execution For migration and alteration, CA RC/Migrator first defines, then analyzes and executes comparison strategies. This process permits the separation of responsibilities into definition, approval, and execution. To create a comparison strategy, enter the strategy type C and then select the objects to compare from both the source and target subsystem. The objects display in two side-by-side scrollable lists. You can choose the objects you want compared by manually specifying the connection or by using automapping masks. The analysis step produces the necessary DDL and control cards to cause the target system's objects to match the source system objects. You can migrate or ignore data from the source system (per table). Also, as with other strategies, you can monitor the execution using the Execution Display and is fully restartable.

Chapter 1: Introduction 37

Product Overview

Additional Compare Facility Features Additional Compare Facility features are as follows: ■

Automapping Masks When creating a comparison strategy, you can use Automapping Mask Services to connect the objects to be compared. Automapping is based on name matching, which supports the use of masks. For example, the names of two identical tablespaces might be different on the test and production subsystems; one might start with T, and the other with P. However, using a name mask, you can match the two objects. You can also manually enter or delete the connection between objects.



Object Editing Object editing options allow fine-tuning of the final object definition. Any edits made to objects override the more general rules set for the strategy.



COMPARE Command By using the COMPARE command, you can view not only the final object definition, but also the source and target object definitions. You can change a final object definition to match the source or target exactly by using the SOURCE or TARGET commands. Any of the differences can be excluded as well. For example, a difference that was permitted through the rules database might not make sense for a particular object. The objects can also be edited and the compare reexecuted.



Reporting on Object Changes For any pair of objects (source and target), you can view the changes made from source to target and the changes made to dependent objects.



Excluding Objects from Comparison All unmatched dependent objects or selected dependent objects can be included or excluded. This option helps ensure that objects required only for testing are not migrated to the production environment.



Table Column Mapping Within paired tables, column definitions can be controlled by blending similar tables to include columns from both objects or by adopting only the column definitions from the source or target table.



Compare Results Rule sets permit exclusion of certain object attributes from the comparison. A default rule set that compares all object attributes is provided. (Using the object editing capabilities, the final object definition can be edited to specify the exact attributes that should be changed.)

38 User Guide

Product Overview



Compare Analysis Options The user can specify exactly what should be included in the final DDL. A recovery option lets you undo a comparison.



Batch Compare Facilities The Batch Compare Facilities merges DDL files and checks them for syntactical errors. DDL files can also be compared and executed in batch mode.

Analysis Facility The Analysis Facility processes strategies and produces a data set or managed table containing commands required to perform the migration, alteration, or comparison. The analysis function can be executed in online or batch mode, and multiple times for the same strategy. Comprehensive warning messages are displayed as part of the analysis execution. Many options are available for controlling the generated output as described in the following sections.

Performance The Analysis Facility makes extensive use of parallel processing, advanced object tree processing, and memory use to provide the fastest and most efficient analysis function available.

ICL Analysis The ICL (Incremental Change Language) option can be used to analyze an alteration or compare strategy and produce ICL instead of DDL. ICL is a syntax that documents only the changes to a particular DB2 object. The ICL can then be used to create the Data Definition Language (DDL) and Data Manipulation Language (DML) statements needed to make the changes to the objects. The DDL output can be executed through the Batch Processor to perform the actual changes.

Chapter 1: Introduction 39

Product Overview

RC/Merger RC/Merger is a DB2 object and data management tool that minimizes the DBA effort, system resources, and time needed to move or copy DB2 objects from one subsystem to another. This can be particularly helpful in creating a data sharing environment, where it is necessary to consolidate all the group members' system catalogs into one global catalog. Where the subsystems of the data sharing environment are on shared DASD, RC/Merger can combine the catalogs efficiently by renaming and updating the underlying tablespace and index data sets directly, thus avoiding the overhead of unloading and reloading data. Note: For more information, see the “RC/Merger” chapter.

Managed Output The Managed Output feature lets you control whether the analysis output is stored in a data set named by the user or in a managed table. Using the table allows the performance of multiple analyses of the same strategy without overwriting any of the previous analyses.

Analysis Options Many options are available to tailor the analysis output to each user's needs. DB2 utility execution can be controlled, as well as the setting of security, referential integrity, and data migration options. The analysis options are very powerful because they permit you to change the effects of the migration, alteration, or comparison without changing the definition of the strategy. The control options can be used to set defaults for any objects that were not given explicit options during strategy definition. The exclusive options provide five choices for limiting output: migrating data only, binding or rebinding plans only, generating SQL only (with no Batch Processor commands such as .SYNC, .AUTH, and so on included), generating statistics only, or generating AUTH and GRANT statements only. Any of these options can be selected at analysis time without changing the original migration strategy.

Impact Analysis As part of the analysis, an impact analysis can be requested that displays summary object statistics by object type. A can also be made to request data statistics that display the number of rows to be unloaded and loaded per table.

Online or Batch Analysis Execution The analysis function can be executed online or in batch mode. During online execution, the process can be interrupted.

40 User Guide

Product Overview

Global Changes Any number of global changes can be requested as part of a migration or comparison. The global changes are automatically propagated to dependent objects and consolidated with any specific edits.

Comprehensive Error Checking The analysis phase performs validation and cross-reference checking to help ensure the integrity of the resulting structure. For example, the analysis function checks for conflicting referential integrity key changes. For edited objects, the original object definition is verified to help ensure there were no changes to the object since the edit. The analysis function produces a comprehensive report that details all warnings.

Execution Facility The Execution Facility executes the output produced by the Analysis Facility by invoking the Batch Processor to execute the commands. A JCL job can be generated to execute the analysis output at a later time. All executions are fully restartable. A complete audit trail is produced, and all DDL is logged. Note: For more information about using the Execution Facility, see the “Execution Facility” chapter.

Online or Batch Execution You can execute the migration in batch or online mode. ■

For online execution, the DDL Only option must be specified.



For batch execution, the job can be written to a data set or managed table for later execution by a job scheduling system.

For an online execution, return and reason codes are shown for each statement executed.

Audit Trail Shows all executed commands and their resulting return and reason codes. For DB2 utilities, the standard SYSPRINT output is also displayed.

Logging All DDL is logged to the CA log tables. The log entry records the object name and creator, DDL function; date and time, and authorization ID.

Chapter 1: Introduction 41

Product Overview

Multiple DB2 Subsystems During execution, you can attach to and disconnect from multiple DB2 subsystems. For example, during a migration, a connection is issued first to the source DB2 subsystem for the unloads and then to the target subsystems for the DDL creation and loads.

Multiple CPU Support Different phases of a strategy can be run on different machines. For example, one site can unload the data and generate the necessary DDL. The strategy can then be executed at another site to create the objects and perform the loads.

Authorization ID Switching During execution, SET CURRENT SQLID and AUTH commands are issued to help ensure correct CREATOR and CREATEDBY authorization IDs when creating objects.

Restartable Synchronization points are taken at every logical point during execution. If the job abends for any reason, the problem can be fixed and the job resubmitted with the RESTART flag set to YES. The Batch Processor provides restartability with .SYNC commands. You can also use .CALL commands to restart at a phase. The FLOAD and RREORG model utilities include the symbolic variable %RESTART, which you can set to automate utility restartability. Note: For more information about restarting utilities at phases, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

Execution Monitor The Execution Monitor displays the progress of analysis and strategy executions and also provides a history of executions. Syncpoints and messages are displayed showing the progress of the batch execution.

Real-Time Monitoring of Activity The Execution Monitor shows the real-time progress of analysis and strategy executions. All executing jobs are highlighted for easy identification. A status code displays next to each execution. The display scrolls vertically and horizontally.

42 User Guide

Product Overview

Monitor Multiple DB2 Subsystems Using the Execution Monitor, you can view the executions on multiple DB2 subsystems at the same time.

Customizable Displays Selection criteria can be entered in the header to control the execution listing. Columns can be printed, sorted, moved, excluded, and frozen. The custom formats can be saved and automatically applied when re-entering the facility.

CYCLE Command The CYCLE command automatically updates the screen every n seconds, providing a hands-off facility for monitoring job executions. Cancel the CYCLE command by pressing the PF1 key.

Log Maintenance As more jobs are executed, the execution listing can become large. Delete old execution log entries by simply entering D next to their names. Block deletes are also supported.

Advanced Features Advanced features include the following: ■

Extended Query Facility (see page 44)



Alternate Catalog Mapping (see page 44)



Multiple DB2 subsystems (see page 44)



Distributed Data Facility (see page 45)



Double-Byte Character Set support (see page 45)



PDS catalog access (see page 45)



Model Services (see page 45)



Automatic space calculation (see page 45)



Recovery option (see page 46)



Syntax Checker (see page 46)



Space Calculator (see page 46)

Chapter 1: Introduction 43

Product Overview

Extended Query Facility The Extended Query Facility (EQF) permits customization of internal SELECT statements to control the data returned. Extended queries are used to control the data displayed on selection lists and reports. For example, if viewing a plan listing, you might want to view only valid plans that were bound within a specific time range. Using EQF, the custom selection criteria are entered and executed as part of the internal SQL statements. Extended queries can be saved, shared, and executed in online or batch mode. EQF also supports the use of symbolic variables that permit run-time customization of the search criteria. EQF is common to most of our products.

Alternate Catalog Mapping Alternate Catalog Mapping (ACM) provides a mechanism for defining shadow tables or views for the DB2 system catalog tables. Views can be used to control access to the information in the catalog. Shadow catalog tables can be used to reduce contention on the DB2 catalog. Any combination of shadow tables and views can be defined. Using ACM, the system administrator can control access to the DB2 system catalog for each user. ACM must be activated through the CA Database Management Solutions for DB2 for z/OS main menu (ACM field set to YES) before ACM can be used. If ACM is activated for a user, dynamic SQL is used because the SQL statement is dynamically prepared based on the alternate table/view names. Therefore, the user must have SELECT authority on the alternate views, tables, or both. Note: For more information about ACM, see the Value Pack Reference Guide.

Multiple DB2 Subsystems You can switch between different DB2 subsystems, even different DB2 versions, without having to exit and reallocate load libraries. To switch subsystems, enter the new subsystem ID in the DB2 subsystem ID field (SSID), which appears on most of the screens. This lets you view a report on one subsystem, change the SSID, and view the same report on the newly specified subsystem. A subsystem can even be selected from a subsystem listing, as described in the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. Note: You can also use split screen mode. However, because the DB2 Call Attach Facility does not allow simultaneous connection to two different subsystems, you might encounter unpredictable results if you change subsystems in one of the sessions. For more information, see the IBM DB2 Application Programming and SQL Guide.

44 User Guide

Product Overview

Distributed Data Facility Distributed Data Facility (DDF) allows the comparison of DB2 structures that reside on remote subsystems. A question mark (?) can be entered in the Location field on Create Compare Strategy panels to receive a listing of valid locations. When using DDF, all remote SQL is dynamic because it must be bound on the remote system. The FOR FETCH ONLY clause is automatically added to provide the most efficient data retrieval across the network.

Double-Byte Character Set Support The languages spoken in countries such as China, Japan, and Korea use writing schemes that consist of character sets so large that they cannot be represented with one-byte codes. For example, Kanji, used in Japan, and Hanzi, used in China, each contain several thousand characters. A character set, Double-Byte Character Set (DBCS), has been created to represent these characters. DBCS uses two bytes per character. Note: For more information, see the IBM DBCS Applications Primer and IBM DBCS Design Guide. Double-byte characters are supported.

PDS Catalog Access An internal structure is built every time a strategy is analyzed or created. To help avoid this overhead, a facility is provided to allow users with large DB2 systems to create a partitioned data set (PDS) that contains the needed internal structures. The partitioned data set (PDS) option can be used to supply basic DB2 system catalog information quickly and without repeated catalog access, for up to 50 percent faster strategy creation and analysis.

Model Services You use Model Services to generate calls to DB2 and our utilities. We provide default models and you can change any model to reflect site-specific information. You can use conditional logic to perform different tasks based on conditions such as data set size. Model services also permits the use of third-party utilities and user-defined jobs in the output produced by the analysis phase.

Automatic Space Calculation Space requirements for unload and utility data sets are calculated automatically.

Chapter 1: Introduction 45

Product Overview

Recovery Option The recovery option lets you undo any migration, alteration, or comparison strategy execution. Using this option, all objects in the strategy can be returned to their original versions and can be dropped. This is useful when the new versions of the objects do not suit your needs and you want to return to the previous versions. As part of the recovery process, you can also rebind plans and execute utilities as required. The recovery option is useful when part of a strategy analysis has been executed. You can undo the executed portion and return to the original object versions. The recovery options let you specify parameters to generate the recovery data set or managed table, which contains the commands necessary to recover from the migration, alteration, or comparison. This includes dropping the migrated or altered objects (and their data and dependents) and recreating the objects in their original state. Utilities requested as recovery options are executed against the newly created original-version objects during the execution of the recovery output.

Syntax Checker The Syntax Checker verifies object dependencies in the DDL to make sure it will execute on a particular DB2 subsystem. Whether there is the need to check the syntax before creating any objects, or to verify that a previously analyzed strategy will work on a current DB2 subsystem, the Syntax Checker automatically checks the DDL without interrupting any other DB2 access.

Space Calculator Component The Space Calculator facility can calculate the primary and secondary space quantities needed for your tablespaces and indexes. This eliminates timeconsuming calculations. The Space Calculator facility is especially important to users who want to calculate the space needed for segmented tablespaces and for multiple tables within one tablespace. Multiple table calculations require an average row size to calculate accurately the total space needed for non-segmented tablespaces. The average row size approximates multiple tables' row length to compensate for the rows being interleaved on one page. Note: For more information about Space Calculator, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

46 User Guide

Access the Product Options

Access the Product Options To access product options, enter the corresponding option number in the Option field: 0 (Profile) Defines variables for all product users. Note: For more information about this option, see the “Profile” chapter. 1 (Strategy Services) Creates, deletes, copies, updates, or analyzes strategies. Note: For more information, see the “Strategy Services Facility” chapter. 2 (Batch Processor) Executes strategies. Note: For more information, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide. 3 (Execution Display) Displays the status of any batch analysis or strategy executions. Note: For more information, see the “Execution Facility” chapter. 4 (Quick Migration) Allows selection of objects for migration without creating a migration strategy. Note: For more information, see the “Migration Strategies” chapter. 5 (Syntax Checker) Checks DDL files for syntactical errors. It can also optionally verify object dependencies in the DDL to help ensure execution on a specific DB2 subsystem. T (Tutorial) Provides a tutorial for new users. X (Exit) Exits the product.

Header Fields Use the Standard headers to identify the product and provide information about the screen and your location within the program. The ID in the upper left hand corner of the screen is used to identify the screen.

Chapter 1: Introduction 47

Selection Screens

Enter commands in the Command line, and press Enter to process your request. Press the Home key to return to the Command line from anywhere on the screen. Commands can also be entered using the program function (PF) keys. If scrolling is available, there is a SCROLL prompt in the upper right-hand corner. Note: For more information about using PF keys or scrolling, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Object Management Screen Headers The chapters in this guide describe the object functions available when creating or altering a strategy. These functions are similar to the RC/Objects component of CA RC/Update. The header fields are not a part of the functionality of the object management capabilities.

Selection Screens Object selection screens present a list of DB2 objects for selection. The objects are always of the same type (database, table, and so forth.). The objects listed match whatever selection criteria are entered for the Item Name and Creator prompts in the screen's header. The purpose of a selection screen is to let you select DB2 objects without having to remember their names. The Item Name and Creator prompts are active on all selection screens so you can enter different selection criteria to display a new list of objects. Selection screens support the full range of ISPF scrolling, including split screen support. There are also commands to exclude and freeze columns, print the selection list, and find data. Note: All selection screens support the standard scrolling commands. For more information about entering selection criteria and the scrolling commands, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

48 User Guide

Selection Screens

The selection screen types are: ■

Primary Object Selection Screens These screens are displayed when primary objects are selected for Migration. Primary object selection screens are also used in Alteration and Compare strategies.



Dependent Object Selection Screens These screens are displayed when dependent objects are selected for Migration strategies.

Selection Screen Header The selection screen header controls which objects are listed on the selection screen. Primary and dependent object selection screen headers differ in format. The following describes the common selection screen header fields: Item Name Defines the name of the DB2 object. The Item Name field is context sensitive, and takes on the name of the selected object type. For example, to select databases, the field will represent the database name. The Item Name field allows specification of a single DB2 object name or entry of selection criteria for retrieving multiple objects. The field accepts selection criteria. Creator Specifies the creator ID for the requested object. It accepts the same search conditions as the Item Name field (*, %, and _). The field defaults to an asterisk (*). Both the item name and creator field values are kept as the new defaults until they are changed.

Primary Object Selection Screens Use the primary object selection screens to select the primary objects for migration and comparison strategies and to select all objects for alteration strategies. For example, when you define an Object Migration Strategy, a primary selection screen opens when objects are selected for the migration. A primary object selection screen also opens when a new primary object is inserted in the strategy definition.

Chapter 1: Introduction 49

Selection Screens

The following fields are displayed on every primary object selection screen. Item Name and Creator Enter selection criteria in these fields and press Enter to generate a list. Search criteria can be changed to broaden or narrow the list of items displayed. The complete Item Name and Creator can also be entered if known. Where Access the Extended Query Facility (EQF) and designate additional SQL selection criteria to control the list of objects displayed. This field is only available on primary object selection screens. EQF lets you create extensive WHERE conditions to control the list of objects. Note: For more information about using EQF, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. Sel (Selection) Selects an object for processing. Valid values are as follows: ■

S—Select. Select the primary objects to migrate by entering S and pressing Enter. The selected objects are placed in the selection queue.



?—Enter a valid CA RC/Query option to display an CA RC/Query report. Enter a question mark to display the CA RC/Query menu for that object type.



B—Browse. Enter B or FB to browse (or fast browse) the table data, if the selection list is a table selection list. Note: For more information, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Depending on the type of objects, other fields are displayed.

Primary Commands Primary commands are those entered on the command line. The following primary commands are available on primary object selection screens. ■

A—Selects all listed objects. Objects are not queued until Enter is pressed, the S (SHRINK) command is issued, or PF3 (End) is pressed.



R—Resets all previously selected objects.



S—Views the selected object queue.

Processing Press PF3 (End) to go to the next screen. Enter CANCEL to cancel your selections and return to the previous screen.

50 User Guide

Selection Screens

Primary Object Queues and Shrink Mode When objects are selected from a primary object selection list, the object selects are queued. The object queue lets you enter new selection criteria in the header to display a new list of objects without affecting their current selections. When objects are selected and Enter is pressed, they are placed into the queue. To select an object, enter S in the Sel field next to the object name. The objects are placed into a queue and the following message displays: Selected objects have been queued

At this point, the selected objects have been queued and one of the following actions can be performed. ■

Continue to make more object selections.



Enter new selection criteria to receive a new list of objects.



Press PF3 (End) to go to the next screen.



Enter the S (Shrink) command to view the (queue) current list of selected objects.

While on the selection screen, you can continue to enter new selection criteria and select objects. All selected objects are placed into the queue. To view the selections, enter the S (shrink) command on the command line. (The S (shrink) command acts as a toggle between the selection screen and the current queue.) A Selected Object Queue screen displays listing all objects currently selected. Objects can be removed from the list by blanking out the S next to the name. To return to the selection screen, reenter the S (shrink) command on the command line. The selection screen reappears, and more selections or changes to the criteria can be made.

Dependent Object Selection Screens Dependent object selection screens apply only to migration strategies. They differ from the primary object selection screens in that they do not show as much detail information for each object and do not permit use of the EQF facility. The EQF facility is not supported because the objects displayed are dependent on the primary object and, therefore, the EQF facility is inappropriate.

Chapter 1: Introduction 51

Selection Screens

The following describes the fields on this screen: Parent Tablespace and Creator Displays the name of the primary (parent) object and its creator. Name and Creator Specifies the Name and Creator fields for the dependent object. The search criteria can be changed for the items displayed. S (Selection) Enter the option code in this field to select, unselect, edit, or clear the edits on the object. Valid values are as follows: ■

C—Clear Edits. Clear any edits made to this object in the specified strategy.



E—Edit. Calls the edit screen appropriate for that option.



T—Template. Displays the template screen for this object. If the Template option is used to create a new object, the new object name appears on the new object list. The new object list can be displayed by entering the CREATE command.



S—Select. An S displays next to objects that have already been selected.



U—Unselect. Enter U next to a previously selected object to unselect it.



?—Enter a valid CA RC/Query option to display a CA RC/Query report. Enter a question mark to display the CA RC/Query menu for that object type.

Note: See the “Migration Strategies” chapter for more information about the fields on this type of screen.

Primary Commands Primary commands are those entered in the command line. The following primary commands are available on dependent object selection screens.

52 User Guide



A—Enter A (all) in the command line to select all the objects on the selection list.



R—Enter R (reset) in the command line to unselect all listed objects.



S—Enter S (shrink) command to display only the selected objects.

Primary Commands

Dependent Objects and the Shrink Command While viewing dependent object selection screens, you might need to see only the selected items. Use the S (shrink) command to shrink the display to only those objects that have been selected or edited. This command works as a toggle. To return the selection list to displaying all objects, re-enter the SHRINK command.

Other Product Components In addition to entering S on a selection screen to select an object, any of the valid CA RC/Query options can be entered for the object type. When viewing a table selection list, you can enter the Browse or Fast Browse option to be placed into CA RC/Update browse mode on the selected table. Note: For more information about using the interproduct interface, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Primary Commands To view online help for primary commands, from the product screen, enter a question mark (?) in the command line, and press Enter. The first primary command help screen for that product screen appears. From there, help can be found for any primary command available for that screen.

Scrolling and Expanding Fields When your data values are longer than the display area, you can scroll and expand the fields and columns to view long names or input data as follows: ■

For fields that cannot be scrolled, like header fields, place your cursor in the field to be expanded and specify the EXPAND command (typically, using a PF key setting).



For scrollable fields, the greater than sign (>) is displayed for fields with truncated values when the column is not wide enough to display the long value. You can view or edit this data using scroll commands (or the EXPAND and SETWIDTH commands).

Note: For more information about these commands, enter a question mark (?) on the command line or see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Chapter 1: Introduction 53

Syntax Checking

Syntax Checking The Syntax Checker option lets you check DDL files for syntactical errors. The Syntax Checker also optionally verifies object dependencies in the DDL to make sure it will execute on a particular DB2 subsystem. Incorrect DDL statements or object dependency problems are displayed in the Syntax Checker Report, along with messages that describe the nature of the problem encountered. The report also contains warnings, which are marked WARNING. If the Syntax Checker detects no errors, the report will reflect this. If the DDL was syntax checked against a DB2 subsystem and no errors were found, it should execute on this subsystem without errors. Because the syntax checker does not put any exclusive locks on the DB2 catalog, a DDL stream can be checked for errors without interrupting any other DB2 access. When all errors have been corrected, the DDL can be executed during off-peak hours. Note: The Syntax Checker does not perform DATA TYPE validations. For example, it does not check that COL1 is a character type column in the WHERE clause of the statement CREATE VIEW... WHERE COL1 = 'AAA' The Syntax Checker checks DDL only. It does not syntax check grant statements. The Syntax Checker can be helpful when:

54 User Guide



A strategy was analyzed some time ago, and you want to make sure the output DDL will still execute on a DB2 subsystem.



Only tables and their dependents have been migrated, and you want to make sure the appropriate parent objects exist on the target subsystem.



DDL has been entered by hand and you want to check the syntax before actually creating any objects.

Syntax Checking

Access the Syntax Checker You can access the Syntax Checker, where you can: ■

Specify the DDL to check



Indicate whether to perform object dependency verification



Select online or batch execution

To access the Syntax Checker 1.

Enter 5 in the Option field on the Main Menu, and press Enter. The DDL Syntax Check Interface screen appears. Note: You can also run the Syntax Checker in batch mode. For more information, see the “Batch Compare Facility” appendix.

2.

Make your specifications, and press Enter to process. (See Syntax Checker Report.)

Execution Specifications To specify the type of job submission to perform, specify one of the following values in the Execution Mode field: ■

O—Submit the data set or managed table for online execution.



B—Submit the data set or managed table for batch execution. The Batch JCL Specification panel controls batch options. Note: For more information about the Batch JCL Specification panel, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

Input DDL Data Set Options To specify the input DDL data set, enter data in the following fields: Data Set Name Enter the name of the data set that contains the DDL to be checked. A PDS member or a sequential file can be entered. Member Enter the member name. If no member is specified, a member selection list displays. Standard ISPF member selection criteria (like, MEMB*) can also be entered to list only members that meet the criteria.

Chapter 1: Introduction 55

Syntax Checking

Volume Serial Enter the volume serial number if the data set is not cataloged. Edit Dataset Specify whether to edit the DDL data set. Valid values are as follows: ■

Y—Edit the data set member. The data set is opened in the ISPF editor. Press PF3 (End) to return to this screen.



N—Do not edit the data set member.

If a table managed by CA RC/Migrator is being used instead of a data set, the input DDL specification fields are different from those described here.

Syntax Processing Options To specify the syntax processing options, enter data in the following fields: AUTHID Specify the primary DB2 ID. It is used to set the primary ID at the start of the syntax check. If an AUTH ID is encountered, it is the primary ID and secondary ID until another .AUTH command is encountered, or until the end of the file. (The SET CURRENT ID command changes only the secondary ID.) If no value is specified, the user ID associated with the job is used. SQLID Specify the secondary ID. It is used to set the secondary ID at the start of the syntax check. If a SET CURRENT ID is encountered, this becomes the secondary ID until another SET CURRENT command is encountered, or until the end of the file. If no value is specified, the user ID associated with the job is used. OBJVER Specify whether to check the input DDL against the specified subsystem. Valid values are as follows: ■

Y—Perform an object dependency verification.



N—Do not perform object dependency.

OBJVER SSID Specify the subsystem to be used in the object dependency verification. An entry is required when performing object dependency verification.

56 User Guide

Syntax Checking

ACM Indicate whether to use Alternate Catalog Mapping instead of the DB2 System Catalog to perform the object dependency verification. If ACM is used with object verification, you can avoid performing any selects against the DB2 catalog; otherwise the Syntax Checker will use share locks on the DB2 System Catalog while performing object dependency verification. Valid values are as follows: ■

Y—Use ACM. The current user's ACM is used. A different user ID can be specified if running in batch mode. Add the user ID to the ACM parameter in the JCL written out to the data set or table managed by CA RC/Migrator that is specified on the Batch JCL Specification panel.



N—The DB2 System Catalog is accessed directly. Note: For more information about ACM, see the Value Pack Reference Guide.

PDS Indicate whether to use a partitioned data set (PDS) to access the internal structure of the DB2 subsystem instead of accessing the DB2 catalog. Valid values are as follows: ■

Y—Use a PDS for the analysis. Note: The Catalog PDS Unload program must be executed before using this option.



N—Do not use a PDS. Use the DB2 catalog. This is the default.

Syntax Checker Report When the Syntax Check is complete, the Syntax Checker Report appears and displays any syntactical errors or object dependency problems that were encountered. Use the up and down keys (PF7 and PF8) to page through the report. Note: The QPRINT command can be used to print the contents of this report. Once PF3 (End) is pressed to exit the report, the results are not saved.

Chapter 1: Introduction 57

Syntax Checking

The following shows a sample report: RMSYNO ----------- RC/M Syntax Checker Report ----------COMMAND ===> SCROLL ===> CSR RM221I: Syntax errors were found in your dataset. ------------------------------------------------------------- USER ID: USER01 mm/dd/yy

CA DDL SYNTAX CHECKER SYNTAX ERROR REPORT ACME technology, Inc.

17.10.36

SYNTAX ERROR IN STATEMENT BEGINNING ON LINE NUMBER 000000010 CREATE TABLESPACE BBBBB IN TWRONONE NUMPARTS 4 ( PART 1 USING VCAT PTI999 , PART 2 USING STOGROUP AAAAA ERASE YES PCTFREE 89 PART 3 USING VCAT PTI888 , PART 4 USING VCAT PTI111 ) ************************************************************************ DDL00002: Invalid token PART . Valid tokens are: , ) ************************************************************************ ******************************* BOTTOM OF DATA ******************************* Press UP/DOWN to scroll Press END to go back

In this example, a missing comma in the CREATE statement was found. The report highlights the token found to be in error, and displays the DDL statement in question as well as a message describing the problem. If this report is produced in batch mode, the erroneous token is surrounded by pound signs (#), as follows: CA DDL Syntax Checker Syntax Error Report CA, Inc. Syntax Error in statement beginning on line number 109 CREATE TABLESPACE KR100S00 IN EJDB NUMPARTS #99# ( PART 1 USING STOGROUP EJSG PRIQTY 12 SECQTY 4 ERASE NO FREEPAGE 0 PCTFREE 5 ) BUFFERPOOL BP0 LOCKSIZE ANY CLOSE YES ************************************************************************ DDL00061: NUMPARTS and PART must be an integer in the range 1 to 64 inclusive. ************************************************************************

In the previous example, the NUMPARTS parameter 99 generated the DDL00061 message. The report identifies the line number (109) of the erroneous statement and shows the out-of-range token 99 enclosed by pound signs (#).

58 User Guide

VSAM Read Option

VSAM Read Option Install parameter VSAMID lets you read DB2 information directly from the DB2 data sets. Using the VSAM Read option helps ensure that you are always using current DB2 information, whereas with the PDS option, the DB2 information is current only up to the point when the PDS program was last run. Note: The VSAM Read option is valid only with DB2 V8 (running in Compatibility Mode) and prior releases of DB2. VSAM access is used to build a representation of the DB2 catalog, called an object tree, when a migration strategy or a compare strategy is created or updated. It is not needed for an alteration strategy. The tree is maintained until the end of a product session. The object tree contains only relationship information. The information is used to traverse from one object to another. This means that the VSAM read is not necessarily used for every fetch during the session. During object editing and some other parts of strategy creation and update, the DB2 catalog access is still used, but in most cases the VSAM Read option makes the strategy creation and analysis faster. To activate the VSAM Read option on a subsystem, the following requirements must be met. ■

PTLTSRB must be installed correctly. Note: For more information about this option, see the CA Database Management Solutions for DB2 for z/OS Installation Guide.



ACM option must be set to OFF at the CA Database Management Solutions for DB2 for z/OS main menu. Note: For more information about ACM, see the Value Pack Reference Guide.



PDS profile option must not be in use.



The VSAMID parameter of the MIGRATOR parmlib member must be specified. If it is not specified, we cannot obtain current DB2 information from the VSAM data sets. Note: For more information about editing this parameter, see the CA Database Management Solutions for DB2 for z/OS Installation Guide.

Chapter 1: Introduction 59

FULLTREE BUILD Option

FULLTREE BUILD Option The MIGRATOR parmlib member contains the option FULLTREE(NO|YES ). Specifying FULLTREE(NO) for an alteration or migration strategy can significantly reduce the amount of processor storage and CPU used during strategy analysis. When FULLTREE(NO) is in effect, the object tree that is built is limited to only the databases that are involved in the strategy. This is called the limited tree. If the DB2 catalog contains many databases, and the strategy is limited to only a few of them, this can significantly reduce the amount of processor storage used for the object tree. A secondary effect is a reduction in the amount of CPU used, due to fewer objects being processed. Note: Specifying FULLTREE(NO) does not guarantee the use of a limited tree. This option is ignored for compare type strategies and for strategies in which a STOGROUP is being dropped. It is also ignored for view processing. For information about editing the MIGRATOR parmlib member, see the CA Database Management Solutions for DB2 for z/OS Installation Guide.

VIEWSCAN Option The MIGRATOR parmlib member contains the option VIEWSCAN (NO|YES). Specifying VIEWSCAN(YES) for an alteration or migration, or compare strategy scans all view text of included views for possible text after the semicolon of the view, which is caused by creating a view in QMF. In QMF all text after the view text is also stored in sysviews text. The default is VIEWSCAN(NO). The additional text is stripped from the view.

60 User Guide

Chapter 2: Operational Considerations This section contains the following topics: Product Authorization (see page 61) Authorization IDs (see page 65)

Product Authorization You can use the Product Authorizations Facility (described in the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide) to grant or revoke authorities for a user ID. Before running CA RC/Migrator, review the following authorization requirements: ■

To authorize the user to view and change object definition defaults, you must grant the user System Administrator or Personal Defaults authority from the RC/Update Authority screen. Note: For more information, see the CA RC/Update User Guide.



To grant the user authority to execute the Batch Processor, enter G next to the Batch Processor entry (found in the General category). Note: For more information, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Product Functions You can grant or revoke authorization to the following CA RC/Migrator functions: RC/Migrator Lets the user execute CA RC/Migrator. RCM Expert Profile Activates the CA RC/Migrator Expert Profile and provides access to the Model Services option. from the RC/Migrator Profile Menu. For specific instructions, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Chapter 2: Operational Considerations 61

Product Authorization

Activate Model Services Model Services lets you create, update, or delete the model IDs or model members used to generate Batch Processor statements for utilities. To execute the Batch Processor, you must also be granted EXECUTE authority on the Batch Processor. To activate model services for the user, specify Y in the Opt column, and press Enter. Authorities for the user ID are updated, the Opt Messages column displays the message “Expert Profile Active.” With this option activated, you can select the Model Services option from the RC/Migrator Profile Menu.

Deactivate Model Services To deactivate model services for a user, type R. The Model Services option does not appear on the RC/Migrator Profile Menu.

DB2 Security We follow the same security considerations as DB2 as summarized in the following sections. Except where noted, if the DDL statement is embedded in a program, the privilege set consists of the privileges designated by the owner of the plan. If the statement is executed dynamically, the privilege set is the union of the privileges designated by each authorization ID of the process (primary and secondary IDs).

DROP Security You can drop a DB2 table, tablespace, or index if you have the following: ■

Ownership (creator) of the object



SYSADM authority



SYSCTRL authority



DBADM authority on the database that contains the object

You can drop a DB2 storage group, alias, or view if you have the following:

62 User Guide



Ownership (created) of the object



SYSADM authority



SYSCTRL authority

Product Authorization

You can drop a database, if you have the following: ■

SYSADM authority



SYSCTRL authority



DBADM or DBCTRL authority for the database



DROP privilege on the database

You can drop a synonym, if you have the following: ■



Ownership (created) of the synonym –

If static SQL (in a plan) is being performed, the synonym must be owned by the owner of the plan.



For dynamic SQL, the synonym must be owned by the current SQL ID (which is the user's primary ID or one of their secondary IDs).

An authorization ID with SYSADM authority can drop synonyms on behalf of other users by changing the value of the CURRENT SQLID register. A SYSADM user can change the SQLID to any user ID.

ALTER Security You can ALTER an object, if one of the following conditions exists: ■

You created the object or hold the ALTER privilege.



You have SYSADM or SYSCTRL authority.



You have DBADM authority on the database that contains the object (does not apply to storage groups).

You can also alter a database, if you have DBCTRL or DROP authority. If a table is altered, by dropping the parent key, the ALTER privilege must be held on all dependent tables. If a table is altered, by dropping the foreign key, the ALTER privilege must be held on the parent tables. To alter ROSHARE, users need SYSADM or SYSCTRL authority.

Chapter 2: Operational Considerations 63

Product Authorization

CREATE and TEMPLATE Security You can create any DB2 object except for an alias or a view, if you have: ■

SYSADM or SYSCTRL authority



DBADM authority on the database that will contain the object (does not apply to storage groups because they are outside of the database)



Correct create privilege for the desired object: –

CREATEDBC or CREATEDBA privilege to create databases



CREATESG privilege to create storage groups



CREATETAB privilege on the database to create tables



CREATETS privilege on the database to create a tablespace



INDEX privilege or creator of the table to create an index on a table

You can create a view, if you have: ■

SYSADM or SYSCTRL authority



SELECT privilege on every table or view named

You can create an alias, if you have: ■

SYSADM or SYSCTRL authority



CREATEALIAS privilege on the database

No authorizations are needed to create a synonym. Note: Tables or tablespaces can be created in a database if DBMAINT or DBCTRL authority is held on the database.

Table Data COPY Security You can COPY table data, if you have: ■

SELECT authority for the table from which they are copying



INSERT authority for the table into which they are copying

Batch Processor Security To perform an alter, you might need all the authorities described in the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide because the strategy can execute commands as part of the strategy.

64 User Guide

Authorization IDs

Authorization IDs Authorization IDs determine the creator of the object. Extensive facilities are provided to help ensure correct object creators during online or batch execution.

Primary ID Whenever a connection is established between DB2 and a process (like CA RC/Migrator), DB2 uses the TSO logon ID or the USER parameter on the job statement as the authorization ID. This authorization ID is called the primary ID. Every process has only one primary ID.

Secondary ID DB2 passes the primary ID to an authorization exit. The exit can return a list of one or more authorization IDs. This list of IDs constitutes the authorization IDs of the process. However, as stated earlier, there is only one primary ID. Any other authorization IDs of the process are called secondary IDs. A primary ID can have a maximum of 255 secondary IDs.

AUTH Command The Batch Processor AUTH command dynamically changes the authorization ID of the process. Once the authorization ID has been changed by the AUTH command, DB2 considers it the new primary ID. The AUTH command requires that the Batch Processor be installed in an APF library. For a complete description of this command, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

SQL ID At any time, the SQL authorization ID is the value of a special register called CURRENT SQLID. This special register can be initialized by the authorization exit. If it is not, its initial value is the primary ID. A SET CURRENT SQLID statement is generated along with an object's creation DDL. When the generated DDL is executed through the Batch Processor, a new thread is established to DB2. The value of this new thread's authorization ID initially equals the user's primary authorization ID.

Chapter 2: Operational Considerations 65

Authorization IDs

The SET CURRENT SQLID statement is generated because the user's primary ID might not have the proper authorizations to create the object. The SET CURRENT SQLID statement is generated according to the following guidelines: ■

For objects that do not have explicit creators (database, storage group, tablespace, synonym), the SET CURRENT SQLID equals the current SQL ID value in the Creator field on the screen.



For objects with explicit creators (table, index, alias), the SET CURRENT SQLID statement equals the value of your current SQL ID. This statement is generated before any CREATE statements generated during the session.

The command SET CURRENT SQLID authid is different from the Default SQLID option that can be specified for an object's recovery (drop or alter recovery). When the SET CURRENT SQLID statement is issued, the DB2 authorizations are checked against the current SQL ID. For example, the authorizations for a user's current SQL ID are checked during the RC/Edit sessions.

Manually Changing the SQL ID The value of CURRENT SQLID can be changed by the execution of a SET CURRENT SQLID statement. Unless some authorization ID of the process has SYSADM authority, the new ID must be one of the authorization IDs of the process. Thus, CURRENT SQLID usually contains the primary ID or one of its secondary IDs. The SQLID value is saved in the ISPF Profile. A SET statement is issued each time the product is opened so that the current SQL ID equals the SQL ID saved in the last session. Use the SET CURRENT SQLID command to change the value to a different authorization ID.

Modify the SQL ID for a View Object The Default SQLID analysis option is not valid for view objects. You can modify the SQL ID individually for a view object instead. To modify the SQL ID for a view object 1.

Enter U next to the appropriate strategy on the Strategy Services panel in CA RC/Migrator. Any existing objects for that strategy are displayed in a list.

2.

Enter E next to the desired view to select it for edit. The View Alter screen appears.

66 User Guide

Authorization IDs

3.

Issue the following command on the command line: SET SQLID = your_sqlid

your_sqlid Specifies a SQL ID that you choose. This value cannot exceed 8 digits. The SQL ID is set. 4.

Press the END key until the changes to your strategy are saved. A message indicates that your changes are saved.

Note: For newly created views, the current SQL ID in effect while defining the object in the strategy is applied. This SQL ID can also be modified through the use of the SET SQLID primary command.

Authorization ID Summary This section describes how the object creator and owner are determined. The object owner is the value of the current SQL ID, and the object creator is the primary ID. The following authorization ID statements are generated for the object owner and object creator: ■

If the user is in online mode, no special statements are issued. The current user ID is the creator ID.



If the user is in batch mode, an AUTH statement is created for the current user ID. Therefore, regardless of who executes the batch data set or managed table, the correct authorization ID is used when the object is created.

In addition for the object owner, a SET CURRENT SQLID is issued for the ID entered in the creator column of the object. In both cases, DB2 stores the object creator in the CREATEDBY field of the object. The following illustrates the commands issued to create a tablespace in batch mode: .AUTH CREATEDBY Sets up the primary ID for the batch execution. SET CURRENT SQLID Is generated automatically so the correct Creator ID is used.

Chapter 2: Operational Considerations 67

Authorization IDs

CREATE OBJECT DDL Is the actual CREATE statement. .AUTH Resets authorization ID. The SET CURRENT SQLID is generated automatically because a tablespace is an object with an implicit creator. Databases, synonyms, and storage groups also have implicit creators. Objects with explicit creators (aliases, tables, and indexes) have a SET CURRENT SQLID generated based on the value of the current SQL ID.

Special Considerations Consider the following: ■

For objects that permit the object owner to be specified as part of the DDL (tables, indexes), a SET CURRENT SQLID statement equal to the value of your current SQL ID is generated.



When an object is altered, the original CREATEDBY ID is maintained.

If you generate the batch DDL for a different authorized user to execute, the AUTH statement will not switch to the other user's ID. In this case, the submitter of the job should edit the batch data set or managed table and perform a global change on the AUTH command to change it to their ID.

68 User Guide

Chapter 3: Profile This section contains the following topics: Access the Profile Menu (see page 69) Define Global Operational Parameters (see page 70) Global Change Services (see page 75) Compare Rule Database Services (see page 114) Compare Automapping Mask Services (see page 133) Managed Output Maintenance (see page 137)

Access the Profile Menu You can use the profile facility to set global and product-specific variables. To access the profile menu, do one of the following: ■

Enter 0, the profile option, from the Main Menu, and press Enter.



Enter PROFILE (or PROF) on any command line, and press Enter.

The Profile screen appears. Note: Depending on user authorizations established, the Expert Profile Menu might appear. The Expert Profile Menu contains additional options for setting profile variables. For detailed information about these options, see the “Expert Profile” chapter. To select an option from the menu, enter the option's corresponding number in the Option field and press Enter. Valid values are as follows: 1 (Global Profile Variables) Lets you define variables shared by all our DB2 products. Note: For more information about defining the global profile variables, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. 2 (RC/Migrator Profile Variables) Sets specific variables. 3 (Global Change Services) Sets global change specifications for migrations, alterations, or compares. 4 (Compare Rule Database Services) Sets rule set variables.

Chapter 3: Profile 69

Define Global Operational Parameters

5 (Compare Automapping Mask Services) Creates and maintains multiple mask sets to be used when analyzing compare strategies. M (Managed Output Maintenance) Sets maintenance defaults and specifies how (or if) maintenance should be applied to strategies. More information: Compare Automapping Mask Services (see page 133) Compare Rule Database Services (see page 114) Define Global Operational Parameters (see page 70) Global Change Services (see page 75) Managed Output Maintenance (see page 137)

Define Global Operational Parameters The Profile Variables option lets you define global defaults for CA RC/Migrator. To define global operational parameters 1.

Enter 0 on the CA RC/Migrator Main Menu. The RC/M Profile or RC/M Expert Profile Menu appears.

2.

Enter 2 (RC/Migrator Profile Variables). The first Global Operational Parameters screen appears.

3.

Enter data as applicable in the following fields: STRATEGY LIST PREFETCH Specifies whether reuse information from the previous session on the Strategy Services panel. This option is helpful to those using the same strategies most of the time. By limiting the number of strategies that appear, the time to locate strategies is reduced. Valid values are as follows:

70 User Guide



Y—Displays the Strategy Services panel using the previous values specified for the Strategy name, Creator ID, Type, and the SRC SSID. Y is the default.



N—Enables users to change search criteria (for the Strategy name, Creator ID, Type, and the SRC SSID) before DB2 access takes place.

Define Global Operational Parameters

STRATEGY LIST MODE Sets the default for the List option. This option lets you list data sets associated with strategies on the Strategy Services panel. Valid values are as follows: ■

L—List Mode. List associated data set names beneath strategy names. This is the default.



N—Non-list mode. Do not list associated data set names.

NO SET CURRENT SQLID Indicates whether to generate a SET CURRENT SQLID statement. Valid values are as follows: ■

Y—The Migration Analysis file will not contain SET CURRENT SQLID statements. .AUTH will contain the SQLID of the creator ID of the object, instead of the createdby ID. There will be no SET CURRENT SQLID = sqlid statements generated in the strategy.



N—The .AUTH command is used to preserve the createdby for an object. SET CURRENT SQLID = sqlid statements are generated to set the SQLID to the creator of the object. .AUTH will contain the Createdby ID of the object.

PARTITIONED DATASET ACCESS Specifies whether to access the internal structure of the DB2 subsystem using a PDS, which can save resources. Valid values are as follows: ■

Y—Access a partitioned data set (PDS) representation of the internal structure of the DB2 subsystem. The user must have read access to the partitioned data set.



N—Use the DB2 System Catalog to build the internal structure. This is the default.

UPDATE OUTPUT SPECIFICATIONS Specifies whether to view or update the analysis output specifications and the default managed output maintenance specifications. Valid values are as follows: ■

N—Do not display the screen to view or update the analysis output specifications or the default managed output maintenance specifications. This is the default.



Y—Display the screen to view or update the default specifications for strategy analysis, recovery, or ICL output, and the default managed output maintenance specifications. When Enter is pressed, the second Global Operational Parameters screen appears.

Chapter 3: Profile 71

Define Global Operational Parameters

4.

Save any changes you made.

More information: Access the Profile Menu (see page 69) Set Managed Output Maintenance Defaults (see page 138)

Updating Output Specifications If you enter Y in the Update Output Specifications field, the Global Operational Parameters panel appears. Specify whether to use the Managed Output feature or enter a default PDS for strategy analysis, recovery, or ICL output. You can also view and update the default specifications for managed output maintenance. The following describes the fields on this screen: ANALYSIS OUTPUT TO PDS Specify whether the strategy analysis output should default to a PDS or to a table. Valid values are as follows: ■

N—Do not send analysis output to a PDS. Send it to an CA RC/Migrator-managed output table. The table is not overwritten in a subsequent analysis, so multiple analyses can be maintained.



Y—Use the Default Analysis PDS name as the default for a strategy analysis. This is the default.

When this field is set to N, Managed Output will control all strategy analysis output, and the name in the Default Analysis PDS field is not in effect. The N setting also affects the output specification fields for all analysis screens and the Batch Processor Interface screen. Note: For more information, see the “Analysis Output” chapter. DEFAULT ANALYSIS PDS Specify a PDS name to set the default PDS for strategy analysis output. The default member name is the strategy name. This default can be overwritten at analysis time. If the Analysis Output to PDS field is set to N, this field is not active.

72 User Guide

Define Global Operational Parameters

RECOVERY OUTPUT TO PDS Specify whether the recovery output should default to a PDS or to a table. Valid values are as follows: ■

N—Do not send recovery output to a PDS. Send it to an RC/Mmanaged output table.



Y—Use the Default Analysis PDS name as the default for recovery output. This is the default.

Default Recovery PDS Specify a PDS name to set the default PDS for recovery output. The default member name is the strategy name. This default can be overwritten at analysis time. If the Recovery Output to PDS field is set to N, this field is not active. ICL OUTPUT TO PDS Specify whether ICL output should default to a PDS or to a table. Valid values are as follows: ■

N—Do not send ICL output to a PDS. Send it to a managed output table. The table is not overwritten in a subsequent analysis, so multiple analyses can be easily maintained.



Y—Use the Default Analysis PDS name as the default for ICL output. This is the default.

DEFAULT ICL PDS Specify a PDS name to set the default PDS for an ICL analysis output. The default member name is the strategy name. This default can be overwritten at analysis time. If the ICL Output to PDS field is set to N, this field is not in effect. The following explains the fields in the Default Managed Output Maintenance Specifications portion of the screen. Minimum number of analysis rows to maintain Specify the minimum number of analysis rows to be maintained for a strategy. The value specified must be less than or equal to the value specified as the maximum number of analysis rows. Valid values are as follows: ■

0-99999—The minimum number of rows to be retained.



*—Indicates there is no minimum and is equivalent to specifying 0 (zero).

Chapter 3: Profile 73

Define Global Operational Parameters

Maximum number of analysis rows to maintain Specify the maximum number of rows to be maintained for a strategy. The value specified must be greater than or equal to the value specified as the minimum number of analysis rows. Valid values are as follows: ■

1-99999—The maximum number of rows to be retained.



*—Indicates there is no maximum and is equivalent to specifying infinity.

Maximum age, in days, to maintain each row Specify the number of days for which each analysis output should be maintained. The value specified for this option is subject to the provisions of the minimum number of rows to be maintained option. Valid values are as follows: ■

1-99999—The maximum number of days for which rows are maintained for a strategy.



*—Indicates there is no maximum age and is equivalent to specifying infinity.

Apply maintenance to new strategies created Indicate whether to establish maintenance criteria for newly created strategies. Valid values are as follows: ■

N—Do not establish maintenance criteria for newly created strategies. New strategies are created with no maintenance criteria and their method of maintenance option is set to NONE. This is the default.



Y—Use the global default maintenance criteria for newly created strategies. New strategies are created with the current global default maintenance criteria and their method of maintenance option is set to GLOBAL.

Apply maintenance to old strategies analyzed Indicate whether to apply maintenance to existing strategies at the time they are analyzed. Valid values are as follows: ■

N—Do not apply maintenance to existing strategies when they are analyzed. This is the default.



Y—Indicates that maintenance should be applied to eligible strategies when they are analyzed. Strategies are eligible if their method of maintenance is set to USER or GLOBAL.

More information: Set Managed Output Maintenance Defaults (see page 138)

74 User Guide

Global Change Services

Default Considerations Consider the following when establishing defaults for managed output maintenance: ■

When you specify 0 (zero) as the minimum number of rows to maintain, all rows are deleted if they are old enough.



The minimum rows provision takes precedence over the maximum age specification.



Analysis rows are deleted only when their age exceeds the specified maximum age. This helps ensure that when 1 is specified as the maximum age, the analysis output is kept for at least 24 hours.



If the strategy's method of maintenance is set to GLOBAL and its maintenance criteria are different from the current defaults, its criteria are updated with the current defaults before maintenance is applied.



Maintenance is only applied after an analysis is completed.



No maintenance is applied if an online analysis is interrupted with the attention key.

Global Change Services During a migration, alteration, or compare process, you might want to perform certain global changes. You can use the Global Change Services option to create sets of global change specifications, including changes for plan and package attributes. The global change sets can be used repeatedly when analyzing migration, alteration, or compare strategies. The changes are automatically propagated to all dependent objects. More information: Access the Profile Menu (see page 69)

Chapter 3: Profile 75

Global Change Services

Access Global Change Services You can access global change services. To access global change services 1.

Do one of the following: ■

From the Profile or Expert Profile Menu, enter 3 (Global Change Services) in the Option line, and press Enter.



From the Compare Global Changes screen, enter S in the GC (Global Change) field, and press Enter. Selection criteria can also be specified in one or both of the Global Changes Creator and Global Changes Setname fields.



From a Strategy Analysis screen, enter S on the command line, and press Enter.

The Global Change Services screen appears. 2.

Complete the following fields: ■

Specify the subsystem ID for the DB2 subsystem where the global change sets are stored in the Set SSID field. Selection criteria are not accepted.



Enter the one- to eight-character name of the global change set in the Set Name field. Selection criteria are accepted.



Enter the creator ID in the Creator field. Selection criteria are accepted.



Enter line commands as follows in the O (line options) field: Note: Line commands (except C) are valid for existing global change sets only. –

B—Browse an existing set.



C—Create a new set.



D—Delete an existing set.



S—Select a set for analysis. This option is valid only when this screen is accessed from the Strategy Analysis screen.



T—Template (copy) an existing set.



U—Update (modify) an existing set.

When browse (B) or update (U) is selected, the Global Change screen for that set appears. Note: The ID of the user who last updated the global change set, and the date and time of the last update are shown under Last Update.

76 User Guide

Global Change Services

Press Enter. A new global change set is created or an existing global change set is updated. More information: Create Global Change Sets (see page 77) Maintain Global Change Sets (see page 78)

Create Global Change Sets You can create global change sets. To create global change sets, complete the following fields in the header area on the Global Change Services panel: ■

Enter C in the O (line options) field.



Enter the name, up to eight characters in the Set Name field. This name and the Creator ID uniquely identify a set.



(Optional) Enter a description of the set in the Description field.



Enter a user ID of the set's creator in the Creator field.



Specify whether others uses can use or update the global change set in the SO (Share Option) field. Valid values are as follows: ■

Y—Others can use, but not update, the set.



U—Others can use and update the set.



N—Other users cannot reference or copy the set (sets created by other users saved with a Share Option of N will not be displayed).

Press Enter. The Global Changes panel appears, where the global changes for that set are defined.

Chapter 3: Profile 77

Global Change Services

Maintain Global Change Sets You can maintain global change sets. To maintain global change sets 1.

Do one of the following: ■

2.

Enter one of the following line commands in the O (line option) field on the Global Change Services screen: –

B—Browse



C—Create



T—Template



U—Update



Enter U from a Strategy Analysis, Copy Group Update, or Compare Global Changes screen to update a global change set. (From the Strategy analysis screen, an existing global change set can only be updated after it is selected by entering S in the Global Changes field.)



Enter Y from a Strategy Analysis screen where a global change set has not been specified (Global Changes field is N) to display the Global Changes screen with a temporary Global Change set named TEMP, which can be modified. (TEMP is deleted after the analysis.)

Press Enter. The Global Changes screen appears. Note: The global changes for migration strategies are different than those for compare strategies. The notation (MO) next to an object means that this global change is in effect for migration strategies only, and is ignored for other strategies. The notation (NC) next to an object means that this global change is not used for compare strategies.

3.

Enter data in the following fields as applicable at your site: CODE Codes that are written to the analysis SYSIN file. The code consists of two parts: xxyy, where xx is the object type (such as, TB for table or AL for All) and yy is what should be changed (like, NM for name). The code is written to the SYSIN file along with the old and new values. Users only need to know these codes if they are reviewing the JOB ABORT message of an analysis run. CHANGE DESCRIPTION Certain global changes can be made for all objects or for all objects of a certain type.

78 User Guide

Global Change Services

FROM Enter the old (current) value to convert from the following values. ■

A specific name to convert all instances of the name.



An asterisk (*) to represent all occurrences.



A mask to represent selected occurrences.

TO Enter the new value in the form of a specific value or a mask. Operation field Enter one of the following operation codes in the field to the left of an object attribute as needed: ■

R—Replicates the line. This is useful for specifying multiple conditions on the same type.



C—Clears requested changes.



D—Deletes the line.

Press PF3. The Global Change Services panl reappears. The global changes associated with the global change set are defined. More information: Access Global Change Services (see page 76) Object Types for Global Changes (see page 82)

Chapter 3: Profile 79

Global Change Services

Masks A mask is a pattern that can match multiple items. This enables global changes to be made on multiple items with a single entry. The following are valid masking characters. ■

Percent sign (%)—Signifies that zero or more characters can occupy that position and all remaining positions to the end of the name, or to the next character. The percent sign can be used anywhere in the name. However, the source and target characters must match exactly. The percent sign will also match the absence of characters. If a character does not appear at the percent sign's position, it is considered a match. A percent sign by itself will map anything to anything. This is useful, for mapping objects together that have the same name but different creators.



Hyphen or dash (-)—Indicates that any one character can occupy that position, but a character must exist at that position, and the source and target character must match exactly. The hyphen can be repeated in several places in the name. If the same character does not appear at the hyphen's position in both the source and target names, the match will fail.

You can specify a mask in the FROM field and a specific name in the TO field. You can also specify a mask in both fields. Following are mask syntax rules:

80 User Guide



The length of the mask must not exceed the length of the attribute being changed.



From mask of “*” indicates all values match.



A blank From mask is changed to an asterisk (*) if a To mask has been specified.



The number, type, and order of masking characters must match in the From and To masks unless no masking characters are specified in the To mask.



If a From mask is specified, a To mask must also be specified unless the field can be used to delete information.



If attributes have specific values, the To mask must match one of those values and the From mask must be blank, “*”, or also match one of these values. The exception to this rule is the Bufferpool field, which accepts only the masks of BP% and BP- for the From field. The To field must be specified.

Global Change Services

The following table lists examples of mask combinations and results:

FROM

TO

STRING

RESULT

DSN%

PTI%

DSNTABLE

PTITABLE

%TEST

%PROD

SGTEST

SGPROD

TABLE-

TABLE2

TABLE1

TABLE2

ON-_TEST%

OF-_PROD%

ON3_TEST_TBL

OF3_PROD_TBL

BP-

BP0

BP2

BP0

AB%CD

%

ABXYZCD

XYZ

The !NULL value can be used for the From or To masks of the attributes listed in the following table:

Object

Attribute

Attribute Keyword

Stogroup

VSAM PASSWORD

SGVP

TABLE

EDITPROC

TBEP

TABLE

VALIDPROC

TBVP

ALIAS

LOCATION

ASLC

!NULL represents a blank attribute value. !NULL can be used to change all blank entries to a new value or any value to blanks. !NULL cannot be specified in both the From and To masks, and cannot be specified as the From mask when the To mask contains wildcards.

Using Masks to Delete Information Global changes can be used to delete attributes and DDL statements from the analysis output. By specifying a From mask and nothing in the To field, the attribute is deleted. You can use the following list of global changes for deletion: Table Column Name Deletes columns from the tables included in the analysis output. Storage Group Volume Deletes specified volumes from the storage groups included in the analysis output.

Chapter 3: Profile 81

Global Change Services

Object Grantor Excludes all GRANTs issued by specified authorization IDs for a specific object type. (This change is also valid for the ALL OBJECT TYPES Grantor.) Object Grantee Excludes all GRANTs issued to specified authorization IDs for a specific object type. (This change is also valid for the ALL OBJECT TYPES Grantee.)

Object Types for Global Changes You can view additional possible global changes by using the scroll down command (PF8) on the Global Changes panel. Use the FIND command to find a specific object type. Global changes can be made for the following objects:

82 User Guide



All object types



Storage groups



Databases



Tablespaces



Tables



Indexes



Views



Synonyms



Aliases



Plans



Packages



Triggers



Sequences



Routines

Global Change Services

Global Changes for All Object Types You can make the following global changes to all object types: Note: (MO) next to an object type indicates that the change applies to migration strategies only and is ignored for other strategies. (NC) next to an object type indicates that the change is not used for compare strategies. CREATED BY Specifies the ID of the user who created the object. CREATOR Specifies the ID of the object's owner. For authorization ID conversions, if the Old Value field contains an “*”, all objects are created under the ID entered in this field. This provides a way to convert objects created by a diverse group of users into a set of objects created by one user. This also affects referenced objects in RI relationships. DATABASE NAME Specifies the name of the database. GRANTOR (NC) Specifies the ID used to grant all authorities. GRANTEE (NC) Specifies the ID being granted authorities. STOGROUP Specifies the name of the storage group. STOGROUP TO VCAT (MO) Specifies a conversion from using STOGROUP (storage group) to using VCAT (VSAM catalog). All CREATE TABLESPACE and CREATE INDEX statements are converted to USING VCAT. Note: Users are responsible for creating the explicit VSAM data sets required for the object in the specified VSAM catalog. TABLESPACE NAME Specifies the name of the tablespace.

Chapter 3: Profile 83

Global Change Services

VCAT TO STOGROUP (MO) Specifies a conversion from using VCAT (VSAM catalog) to using STOGROUP (storage group). This change will take effect on all CREATE TABLESPACE and CREATE INDEX statements. Note: The VSAM catalog information is accessed to retrieve the current space allocations for the tablespace or index. If different space allocations are desired, you must edit the migration strategy output file. VCATNAME Specifies the name of the VSAM catalog.

Storage Group Global Changes You can make the following global changes to the storage group: CREATED BY Authorization ID of the user who created the storage group CREATOR Authorization ID of the owner of the storage group GRANTOR (NC) ID used to grant storage group authorities GRANTEE (NC) ID being granted authorities NAME Storage Group Name VCATNAME Name of the VSAM catalog used to track the DASD volumes defined by the storage group VOLUME The name of the volume You can enter a volume line for each volume in the stogroup. VSAM Password The VSAM Catalog Password

84 User Guide

Global Change Services

Database Global Changes You can make the following global changes to the database: BUFFERPOOL The database's buffer pool All tablespaces and indexspaces use this buffer pool by default unless another is specified. CCSID (Coded Character Set Identifier) The CCSID encoding scheme ■

ASCII—The data must be encoded using the ASCII CCSIDs specified during installation.



EBCDIC—The data must be encoded using the EBCDIC CCSIDs specified during installation.



DEFAULT—The CCSID argument is omitted from the generated DDL and the new object uses the default encoding scheme. The default encoding scheme that is used depends on the object type and how it is created. The rules used to determine which encoding scheme to use are set by DB2.



blanks—None. This has the same meaning as DEFAULT.

CREATED BY Authorization ID of the user who created the database CREATOR Authorization ID of the owner of the database GRANTOR (NC) ID used to grant database authorities GRANTEE (NC) ID being granted authorities INDEXBP Name of the default buffer pool for indexes NAME Database name STOGROUP The database's storage group All table and indexspaces use this storage group by default unless another is specified.

Chapter 3: Profile 85

Global Change Services

Tablespace Global Changes You can make the following global changes to tablespaces. Note: For more information, see the “Tablespace” chapter. BUFFERPOOL The tablespace's buffer pool CCSID (Coded Character Set Identifier) CCSID encoding scheme Valid values are as follows: ■

ASCII—The data must be encoded using the ASCII CCSIDs specified during installation.



EBCDIC—The data must be encoded using the EBCDIC CCSIDs specified during installation.



DEFAULT—The CCSID argument is omitted from the generated DDL and the new object uses the default encoding scheme. The default encoding scheme used depends on the object type and how it is created. The rules used in determining which encoding scheme to use are decided by DB2. For additional information about default encoding schemes, see the IBM DB2 SQL Reference Guide or DB2 Administrator Guide.



blank—This specification is the same as DEFAULT.

CLOSE RULE Denotes if the VSAM data sets allocated to the tablespace are closed when the tablespace is not in use (resource consideration) ■

Y—(Yes) Data sets are closed.



N—(No) Data sets are open.

COMPRESS Indication of whether to use ESA compression on the data rows for this tablespace or this partition of the tablespace. Valid values are as follows: ■

YES—Build the compression dictionary and compress the data rows the next time the data is loaded or reorganized.



NO—Do not compress the data rows. This is the default value.

CREATOR Primary authorization ID of the owner of the tablespace CREATED BY Authorization ID of the user who created the tablespace

86 User Guide

Global Change Services

DBNAME Name of the database that contains the tablespace DEFINE Specifies when to physically create the underlying data sets for the tablespace. YES Creates the data sets when the tablespace is created. This is the default. Note: If MAXPARTITIONS is specified, only the first partition is created at tablespace creation. Additional partitions are created as needed. NO Creates the data sets when data is inserted into the tablespace. NO applies only for DB2-managed data sets (specifying USING STOGROUP). NO is ignored for user-managed data sets (specifying USING VCAT) and LOB tablespaces. Note: Do not specify NO for a tablespace in a work file database. Additionally, if you use any tools outside of DB2 to manipulate data, we recommend not using NO, which might cause application errors when DB2 encounters unexpected data sets. DSSIZE Maximum size of a data set in KB The following are valid values: NULL, 1, 2, 4, 8, 16, 32, and 64. ERASE RULE Denotes if the tablespace data sets are erased (overwritten) when the tablespace is dropped Note: Does not apply to partitioned tablespaces. FREEPAGE The number of pages loaded before a page is left as free space GRANTEE (NC) ID being granted authorities GRANTOR (NC) ID used to grant tablespace authorities

Chapter 3: Profile 87

Global Change Services

GROUP BUFFER CACHE Group Bufferpool Cache option for the tablespace Valid values are as follows: ■

blank—Cache only changed pages in the group buffer pool.



A—(All) Cache both changed and unchanged pages in the group buffer pool.

LOCK MAX Maximum number of page or row locks that an application can hold in this tablespace before locks are escalated from the level indicated in the LOCKSIZE field Valid values are as follows: ■

0—The number of locks allowed is unlimited; no escalation.



1 to 2147483647—The specific number of locks allowed before escalation.



SYSTEM—Uses the system default value.

LOCKPART Indicates whether selective partition locking is to be used when locking a partitioned tablespace Valid values are as follows: ■

YES—If all conditions required for selective partition locking are met, only the partitions accessed are locked. If all conditions required for partition locking are not met, every partition of the tablespace is locked. Selective partition locking is not supported when the value in the LOCK SIZE field is TABLESPACE.



NO—(Default) Selective partition locking is not used. The tablespace is locked with a single lock on the last partition, which has the effect of locking all partitions on the tablespace.

Note: This option is valid only for partitioned tablespaces.

88 User Guide

Global Change Services

LOCKRULE The lock size of the tablespace This value determines how DB2 locks the pages in the tablespace. Valid values are as follows: ■

A—Any (DB2 determines the best lock size)



P—Page



R—Row



S—Tablespace



T—Table Note: LOCKRULE TABLE does not apply to universal tablespaces.

LOG Whether the changes to a tablespace are to be logged The NO option applies only to LOB tablespaces. MAXROWS Maximum number of rows that DB2 places on a data page This option adds the MAXROWS(integer) argument to the generated DDL. Enter a value from 1 to 255. The default value is 255. Notes: ■

When altering a tablespace, the change takes effect immediately for new rows added.



Rows/Page cannot be specified for a tablespace in a work file database.

MEMBER CLUSTER Specifies that data inserted by the INSERT statement is not clustered by the implicit clustering index (the first index) or the explicit clustering index. Instead, DB2 chooses where to locate the data in the tablespace based on available space. Note: Do not use MEMBER CLUSTER for a LOB tablespace, a universal tablespace, or a tablespace in a work file database. NAME Tablespace name PCTFREE Percentage of each page left as free space PRIMARY QUANTITY Primary space allocation quantity

Chapter 3: Profile 89

Global Change Services

SECONDARY QUANTITY Secondary space allocation quantity SEGSIZE The number of pages in each segment of the segmented tablespace Note: This value is zero if the tablespace is not segmented. For DB2 version 9 and later, a value other than zero causes a partitioned tablespace to be converted to a range-partitioned universal tablespace. STOGROUP The partition's storage group Note: Can be different for each partition. STOGROUP TO VCAT (MO) Specifies a conversion from using STOGROUP (storage group) to using VCAT (VSAM catalog) All CREATE TABLESPACE and CREATE INDEX statements are converted to USING VCAT. Note: Users are responsible for creating the explicit VSAM data sets required for the object in the specified VSAM catalog. TRACKMOD Whether to track the page modifications in the space map pages TYPE Indicates whether the tablespace is LARGE. Valid values are as follows: ■

YES—Specifies that a partitioned tablespace is to be identified as LARGE.



NO—Specifies that a tablespace (partitioned or non-partitioned) is not to be identified as LARGE.

VCAT The name of the VSAM catalog used to track the DASD volumes defined by the tablespace Note: Each partition can reference a different VSAM catalog.

90 User Guide

Global Change Services

VCAT TO STOGROUP (MO) Specifies a conversion from using VCAT(VSAM catalog) to using STOGROUP (storage group). This change will take effect on all CREATE TABLESPACE and CREATE INDEX statements. Note: The VSAM catalog information is accessed to retrieve the current space allocations for the tablespace or index. If different space allocations are desired, you must edit the migration strategy output file. VOLUMES If the tablespace is not in a stogroup, this is the name of the volumes in which the tablespace is defined. Note: For Primary Quantity and Secondary Quantity, use the CALC function to specify the change. The percent sign in the From field and To field represents the current amount. If the To field should be a constant, put the constant value in parentheses after CALC. For sample calculations, see the CALC description in the Conditional Automatic Symbols for All Objects section.

Table Global Changes You can specify the following global changes for tables: CCSID (Coded Character Set Identifier) Specifies the CCSID encoding scheme. ASCII Specifies that the data must be encoded using the ASCII CCSIDs specified during installation. EBCDIC Specifies that the data must be encoded using the EBCDIC CCSIDs specified during installation. DEFAULT Specifies that the CCSID argument is omitted from the generated DDL and the new object uses the default encoding scheme. The default encoding scheme used depends on the object type and how it is created. The rules used in determining which encoding scheme to use are decided by DB2. blank Specifies none (same as DEFAULT). CHECK NAME Specifies the check constraint name. COLUMN NAME (NC) Specifies the name of the column.

Chapter 3: Profile 91

Global Change Services

CREATED BY Specifies the authorization ID of the user who created the table. CREATOR Specifies the primary authorization ID of the owner of the table. Note: This option also affects referenced tables in RI relationships. DATA CAPTURE Records the value of the DATA CAPTURE option. CHANGES Specifies that data should be captured. NONE Specifies that data should not be captured. DBNAME Specifies the table's database. DELETE RULE Specifies the RI delete rule. DROP RESTRICTION Specifies whether to protect this table from being accidentally dropped. N (or blank) Specifies for CA RC/Migrator to not prevent the table from being dropped. If the value is Y and you enter N, the restriction is lifted from the table and its associated database and tablespace. Y Specifies to prevent a drop for this table. The table cannot be dropped while this option is in effect. To drop the table, it must be altered first and the setting change to N. The database and tablespace associated with the table are also restricted and cannot be dropped until the table's restriction is lifted. Note: To enable the DROP RESTRICTION option, you must enter an asterisk ( * ) in the FROM field and Y in the TO field. EDITPROC Specifies the table's edit procedure (blank if NONE). GRANTOR (NC) Specifies the ID used to grant table authorities. GRANTEE (NC) Specifies the ID being granted authorities.

92 User Guide

Global Change Services

NAME Specifies the table name. PARENT TABLE CREATOR Specifies the RI parent table creator. PARENT TABLE NAME Specifies the RI parent table name. REL NAME Specifies the name of the RI relationship. TSNAME Specifies the table's tablespace. TYPE Specifies a global temporary table. T (or TEMP) Specifies that a global temporary table is to be created. R (or REG or REGULAR) Specifies that a regular table is to be created. VALIDPROC Specifies the table's validation procedure (blank if NONE). TEXT CREATOR Specifies the referenced table creator. TEXT NAME Specifies the referenced table name.

Sequence Global Changes You can specify the following global changes for sequences: NAME Specifies the sequence name. SCHEMA Specifies the schema of the sequence.

Chapter 3: Profile 93

Global Change Services

CACHE NN/NO CACHE Specifies whether to preallocate sequence values. CACHE NN Specifies the number of values to preallocate in memory for the sequence. NO CACHE Specifies to not preallocate any values for the sequence. CYCLE/NO CYCLE Specifies how to conduct cycling. CYCLE Specifies that cycling will occur when a boundary is reached. NO CYCLE Specifies that there will be no cycling for the sequence.

Index Global Changes You can make the following global changes to indexes. Note: For more information, see the “Index” chapter. BUFFERPOOL The index's bufferpool CLOSE RULE Denotes if the VSAM data sets allocated to the indexspace are closed when the index is not in use (resource consideration) COPY Specify whether COPY YES was specified for the index Valid values are as follows: ■

Y—The index can be copied. SYSIBM.SYSLGRNX recording is enabled for the index.



N—The index cannot be copied. SYSIBM.SYSLGRNX recording is not enabled for the index.

CREATED BY Authorization ID of the user who created the index

94 User Guide

Global Change Services

CREATOR Primary authorization ID of the owner of the index and indexspace DBNAME Name of the database containing the index DEFER Specifies whether to build the index now or build it during the execution of the CREATE INDEX statement. DEFINE Specifies when to physically create the underlying data sets for the tablespace. Global changes could be from YES to NO or NO to YES. ERASE RULE Denotes whether the index data sets are erased (overwritten) when the indexspace is dropped Note: This option does not apply to partitioned indexspaces. FREEPAGE Number of pages loaded before a page is left as free space GROUP BUFFER CACHE Specifies the Group Bufferpool CACHE option for the index Valid values are as follows: ■

blank—Cache only changed pages in the group bufferpool.



A—Cache changed and unchanged pages in the group bufferpool.

NAME Index name PCTFREE Percentage of each subpage or nonleaf page left as free space

Chapter 3: Profile 95

Global Change Services

PIECESIZE Size of the data sets that make up a non-partitioned index For indexes backed by non-LARGE tablespaces, the default is 2 GB. For indexes backed by LARGE tablespaces, the default is 4 GB. Valid values are as follows: ■

256 KB



512 KB



1024 KB (1 MB)



2048 KB (2 MB)



4096 KB (4 MB)



8192 KB (8 MB)



16384 KB (16 MB)



32768 KB (32 MB)



65536 KB (64 MB)



131072 KB (128 MB)



262144 KB (256 MB)



524288 KB (512 MB)



1048576 KB (1024 MB, 1 GB)



2097152 KB (2048 MB, 2 GB)



4194304 KB (4096 MB, 4 GB)

PRIMARY QUANTITY Primary space allocation quantity Use the CALC function to specify the change. If the TO field should be a constant, place the constant value in parentheses after CALC. For sample calculations, see the CALC description in the Conditional Automatic Symbols for All Objects section. SECONDARY QUANTITY Secondary space allocation quantity Use the CALC feature to specify the change. If the TO field should be a constant, place the constant in parentheses after CALC. For sample calculations, see the CALC description in the Conditional Automatic Symbols for All Objects section. STOGROUP Index's (if not partitioned) or partition's (if partitioned) storage group Note: This option can be different for each partition.

96 User Guide

Global Change Services

STOGROUP TO VCAT (MO) For storage group to VSAM catalog conversions, enter the name of the VSAM catalog. All CREATE TABLESPACE and CREATE INDEX statements are converted to USING VCAT. The user is responsible for creating the explicit VSAM data sets required for the object in the specified VSAM catalog. The VSAM data sets can be created through the VSAM Define facility. TBCREATOR Creator of the table If a global ALCREATOR change has been specified, TBCREATOR changes accordingly if the table associated with the index is included in the strategy. TBNAME Name of the table on which the index is based TYPE Specifies TYPE 1 or TYPE 2 and lets the user set or reset the type and convert an index from type 1 to type 2. UNIQUERULE Denotes if the index was defined as UNIQUE Valid values are as follows: ■

D—(No) Not unique; duplicates are allowed



U—(Yes) Unique



P—(Primary Index) Unique

VCAT Name of the VSAM catalog used to track the DASD volumes defined by the indexspace Note: Each partition can reference a different VSAM catalog. VCAT TO STOGROUP (MO) For VSAM catalog to storage group, enter the name of an existing storage group. All CREATE TABLESPACE and CREATE INDEX statements are converted to USING STOGROUP. The VSAM catalog is accessed to retrieve the current space allocations for the tablespace or index. For different space allocations, the migration strategy output file must be edited. VOLUMES Name of the volumes in which the indexspace is defined (if the indexspace is not in a stogroup).

Chapter 3: Profile 97

Global Change Services

View Global Changes You can specify the following global changes for views: CREATED BY Specifies the authorization ID of the user who created the view. CREATOR Specifies the authorization ID of the creator of the view. GRANTEE (NC) Specifies the ID being granted view authorities. GRANTOR (NC) Specifies the ID used to grant view authorities. NAME Specifies the view name. TEXT T/V CREATOR Specifies the referenced table/view creator. TEXT T/V NAME Specifies the referenced table/view name. TEXT UDF SCHEMA Specifies the referenced user-defined function's schema. TEXT UDF NAME Specifies the referenced user-defined function's name. W/CHECK OPTION Specifies whether the CHECK OPTION was specified when the view was created. Note: The CHECK OPTION is used to help ensure that updates and inserts satisfy the view criteria specified on the SELECT.

Synonym Global Changes You can specify the following global changes for synonyms: CREATED BY Specifies the authorization ID of the user who created the synonym. CREATOR Specifies the authorization ID of the owner of the synonym.

98 User Guide

Global Change Services

NAME Specifies the name of the synonym. TBCREATOR Specifies the authorization of the owner of the table. TBNAME Specifies the name of the table the synonym represents.

Alias Global Changes You can specify the following global changes for aliases (when specified): CREATED BY Specifies the authorization ID of the user who created the alias. CREATOR Specifies the authorization ID of the owner of the alias. LOCATION Specifies the location of the alias. NAME Specifies the name of the alias. TBCREATOR Specifies the base table creator. TBNAME Specifies the base table name.

Plan Global Changes You can specify the following global changes for plans. Note: For more information about these attributes, see the IBM Command and Utility Reference for DB2. ACQUIRE Acquires resources at allocation (A) or at first use (U). BOUNDBY Specifies the primary authorization ID of the binder of the plan. CACHESIZE Specifies the cache size in bytes. Zero equals none used.

Chapter 3: Profile 99

Global Change Services

CURRENTDATA Specifies the data currency requirement for ambiguous cursors opened at remote locations. ■

YES—Data currency is required for ambiguous cursors.



NO—(Default) Data currency is not required for ambiguous cursors.

CURRENTSERVER Specifies a subsystem ID to be used in a CONNECT statement. Setting this option can affect the type of CONNECT rules used. DBPROTOCOL Specifies whether remote access for SQL with three-part names is implemented with DRDA or DB2 private protocol access. Valid values are as follows: ■

D—DRDA



P—DB2 private protocol

OPTHINT Specifies the value of the OPTHINT bind option. This value identifies rows in the authid.PLAN_TABLE that are to be used as input to the optimizer. Contains blanks if no rows in the authid.PLAN_TABLE are to be used as input. DEFER (PREPARE) Determines whether to defer preparation for dynamic SQL statements that refer to remote objects, or to prepare them immediately. Valid values are as follows: ■

YES—Defer preparation. The dynamic statement is prepared when DB2 first encounters a statement of the type EXECUTE, OPEN, or DESCRIBE that refers to the dynamic statement.



NO—Prepare the dynamic SQL statements immediately.

DEGREE Specifies the degree option used when the plan was last rebound. ■

ANY—Allow I/O parallelism for non-ambiguous cursors.



1—(Default) Disable I/O parallelism for non-ambiguous cursors.

DISCONNECT Specifies the disconnect option.

100 User Guide



E or blank—DISCONNECT(EXPLICIT)



A—DISCONNECT(AUTOMATIC)



C—DISCONNECT(CONDITIONAL)



blank—A migrated plan.

Global Change Services

DYNAMICRULES Specifies the AUTHID to use when validating dynamic SQL statements, BIND or RUN. EXPLAIN Specifies whether the plan is bound with EXPLAIN YES. ■

Y—Yes, plan was bound with EXPLAIN YES.



N—No, plan was not bound with EXPLAIN YES.

GRANTEE (MO) Specifies the ID being granted authorities. GRANTOR (MO) Specifies the ID used to grant authorities. ISOLATION Specifies the isolation level. ■

R—RR (repeatable read).



S—CS (cursor stability).

KEEPDYNAMIC Determines whether DB2 keeps dynamic SQL statements after commit points. Valid values are as follows: ■

NO—DB2 does not keep dynamic SQL statements after commit points.



YES—DB2 keeps dynamic SQL statements after commit points.

Note: If Yes is specified for this option, No must be specified for REOPT (VAR). NAME Specifies the name of the application plan. The plan name cannot be changed in the target subsystem for a migration if the REBIND option is in effect. Rebind is R on the Strategy Analysis Options panel. OWNER Specifies the authorization ID of the plan owner. QUALIFIER Specifies the implicit qualifier for the unqualified table, view, index, and alias names in static SQL statements. RELEASE Specifies when resources are released. ■

C—Release at commit.



D—Release at deallocation.

Chapter 3: Profile 101

Global Change Services

REOPT (VAR) Specifies whether DB2 determines an access path at run time based on values for host variables, parameter markers, and special registers. Valid values are as follows: ■

YES—Redetermines the access path at run time.



NO—Does not determine an access path at runtime.

Note: If Yes is specified for this option, Yes cannot be specified for the KEEPDYNAMIC option or No for the DEFER(PREPARE) option. SQLRULES Specifies the current rules register, DB2 or STD. VALIDATE Specifies whether validity checking can be deferred until run time. Valid values are as follows: ■

B—All checking must be performed during bind.



R—Checking is deferred to run time if tables, views, or privileges do not exist at bind time.

Package Global Changes The following global changes can be specified for packages. Note: For more information about these attributes, see the IBM Command and Utility Reference for DB2. COLLECTION ID Name of the package collection. The name cannot be changed in the target subsystem for a migration if the REBIND option is in effect. Rebind is R on the Strategy Analysis Options panel. CREATOR Authorization ID of the package creator. CURRENTDATA Enter the data currency requirement for ambiguous cursors opened at remote locations. Valid values are as follows:

102 User Guide



YES—Data currency is required for ambiguous cursors.



NO—(Default) Data currency is not required for ambiguous cursors.

Global Change Services

DBPROTOCOL Whether remote access for SQL with three-part names is implemented with DRDA or DB2 private protocol access. Valid values are as follows: ■

D—DRDA



P—DB2 private protocol

DEFER (PREPARE) Determines whether to defer preparation for dynamic SQL statements that refer to remote objects, or to prepare them immediately. Valid values are as follows: ■

YES—Defer preparation. The dynamic statement is prepared when DB2 first encounters a statement of the type EXECUTE, OPEN, or DESCRIBE that refers to the dynamic statement.



NO—Prepare the dynamic SQL statements immediately.

DEGREE Enter the degree option used when the package was last rebound. Valid values are as follows: ■

ANY—Allow I/O parallelism for non-ambiguous cursors.



1—(Default) Disable I/O parallelism for non-ambiguous cursors.

DYNAMICRULES The DYNAMICRULES BIND PACKAGE parameter affects dynamic SQL behavior. Valid values are as follows: ■

BIND



DEFINEBIND



DEFINERUN



INVOKEBIND



INVOKERUN



RUN

EXPLAIN Specify whether information about the package statements is to be added to the owner's PLAN_TABLE. Valid values are as follows: ■

YES—Add information about the package statements to the owner's PLAN_TABLE.



NO—Do not add information about the package statements to the owner's PLAN_TABLE.

GRANTEE (MO) ID being granted authorities.

Chapter 3: Profile 103

Global Change Services

GRANTOR (MO) ID used to grant authorities. ISOLATION Checking is deferred to run time if tables, views, or privileges do not exist at bind time. Valid values are as follows: ■

R—RR (repeatable read).



S—CS (cursor stability).



(blank)—Isolation level for the plan exec package if not specified.

KEEPDYNAMIC Determines whether DB2 keeps dynamic SQL statements after commit points. Valid values are as follows: ■

NO—DB2 does not keep dynamic SQL statements after commit points.



YES—DB2 keeps dynamic SQL statements after sync points.

Note: If Yes is specified for this option, No must be specified for REOPT (VAR). NAME Name of the package. The name cannot be changed in the target subsystem for a migration if the REBIND option is in effect. Rebind is R on the Strategy Analysis Options panel. OPTHINT Value of the OPTHINT bind option. This value identifies rows in the authid.PLAN_TABLE that are to be used as input to the optimizer. Contains blanks if no rows in the authid.PLAN_TABLE are to be used as input. Valid values are as follows: ■

S—Once per statement



R—Once per row

OWNER Authorization ID of the package owner. QUALIFER Implicit name for unqualified tables, views, aliases, and indexes. RELEASE Specify one of the following options. Valid values are as follows:

104 User Guide



C—Release at commit.



D—Release at deallocation.



(blank)—The specified point for the plan execution package if not specified.

Global Change Services

REOPT (VAR) Specifies whether DB2 determines an access path at run time based on values for host variables, parameter markers, and special registers. Valid values are as follows: ■

YES—Re-determines the access path at run time.



NO—Does not determine an access path at run time.

Note: If Yes is specified for this option, Yes cannot be specified for the KEEPDYNAMIC option and No cannot be specified for the DEFER(PREPARE) option. SQLERROR Specify the SQLERROR option to be used when the BIND/REBIND is issued. Valid values are as follows: ■

C—CONTINUE



N—NOPACKAGE

VALIDATE Specifies whether validity checking can be deferred until run time. Valid values are as follows: ■

B—All checking must be performed at bind time.



R—Checking is deferred to run time if tables, views, or privileges do not exist at bind time.

Routine Global Changes The following global changes can be specified for routines. Note: A notation of (F) indicates that the changes are applicable only to userdefined functions. A notation of (P) indicates that the changes are applicable only to stored procedures. NAME Specifies the name of the routine. SCHEMA Specifies the schema of the routine. CREATED BY Specifies the creator of the routine. SPECIFIC NAME Specifies the specific name of the routine.

Chapter 3: Profile 105

Global Change Services

COLLECTION ID Specifies the package collection name that is used when the routine is executed. EXTERNAL ACTION (F) Specifies the external action option of an SQL function or external function. N Specifies that the function has no side effects. E Specifies that the function has side effects. blank Specifies that ORIGIN is not E for a function (ROUTINETYPE=F), or it is a stored procedure (ROUTINETYPE=P). SCRATCHPAD LENGTH (F) Specifies the scratchpad length, if the ORIGIN is E for the function (ROUTINETYPE=F) and NO SCRATCHPAD is not specified. Otherwise, 0 is used as the value. FINAL CALL (F) Specifies the FINAL CALL option for an external function. Y Specifies that a final call will be made to the function. N Specifies that a final call will not be made to the function. blank Specifies that ORIGIN is not E for a function (ROUTINETYPE=F), or it is a stored procedure (ROUTINETYPE=P). PARALLEL (F) Specifies the PARALLEL option for an external function. A Specifies that this function can be invoked by parallel tasks. D Specifies that this function cannot be invoked by parallel tasks. blank Specifies that ORIGIN is not E, or ROUTINETYPE=F is specified, or a stored procedure (ROUTINETYPE=P) cannot be run.

106 User Guide

Global Change Services

PARAMETER STYLE Specifies how parameters are passed to an external function or stored procedure. D DB2SQL Specifies that parameters are passed to the external function or stored procedure according to the DB2SQL standard convention. G GENERAL Specifies that parameters are passed to the stored procedure according to the GENERAL standard convention. N GENERAL CALL WITH NULLS Specifies that parameters are passed to the stored procedure according to the GENERAL WITH NULLS convention. J JAVA Specifies that parameters are passed to the function or procedure according to the conventions for JAVA and SQLJ specifications. blank Specifies that the column is blank (if the ORIGIN is not E or LANGUAGE is SQL). SQL DATA ACCESS Specifies the SQL statements allowed in an external function, SQL function, or stored procedure. C CONTAINS SQL Specifies to allow only SQL that does not read or modify data. M MODIFIES SQL DATA Specifies to allow all SQL, including SQL that reads or modifies data. N NO SQL Specifies to not allow SQL. R READS SQL DATA Specifies to allow only SQL that reads data. blank Not applicable.

Chapter 3: Profile 107

Global Change Services

DBINFO Specifies the DBINFO option of an external function or stored procedure. N Specifies to not pass the DBINFO parameter to the external function or stored procedure. Y Specifies to pass the DBINFO parameter to the external function or stored procedure. blank Specifies that ORIGIN is not E. STAYRESIDENT Specifies the STAYRESIDENT option for the routine (determining whether the routine will be deleted from memory after a routine ends). Y Specifies that the load module is to remain in memory after the routine ends. N Specifies that the load module is to be deleted from memory after the routine ends. blank Specifies that ORIGIN is not E. WLM ENVIRONMENT Specifies the WLM environment name to be used to run this routine. If ROUTINETYPE=F and ORIGIN is not E, the value is blank. If ROUTINETYPE=P, the value might be blank. If the value is blank, the stored procedure is run in the DB2 stored procedure address space. PROGRAM TYPE Specifies whether the routine runs as a Language Environment main routine or subroutine. M Specifies that the routine will run as a main routine. S Specifies that the routine will run as a subroutine. blank Specifies that ORIGIN is not E.

108 User Guide

Global Change Services

COMMIT ON RETURN (P) For ROUTINETYPE=P, specifies whether the transaction is always committed immediately on successful return from this stored procedure. N Specifies that the unit of work is to continue. Y Specifies that the unit of work is to be committed immediately. Note: For ROUTINETYPE=F, the value is blank. RESULT SETS (P) Specifies a value as follows: ■

If ROUTINETYPE=P, RESULT SETS specifies the maximum number of ad hoc result sets that this stored procedure can return.



If no ad hoc result sets exist (or if ROUTINETYPE=F), RESULT SETS specifies a value of 0.

Trigger Global Changes You can make the following global changes for triggers. Note: For more information about these attributes, see the IBM Command and Utility Reference for DB2. COLUMNS Triggering columns for this trigger. CREATED BY The ID of the user under which the trigger was created. EVENT Operation that activates the trigger. Valid values are as follows: ■

INSERT



UPDATE



DELETE

Chapter 3: Profile 109

Global Change Services

GRANULARITY Determines when the trigger is activated for the triggering SQL statement. Valid values are as follows: ■

STATEMENT—Trigger is activated only once for the triggering SQL statement.



ROW—Trigger is activated once for every row that the SQL statement modifies.

NAME Name of the trigger and trigger package. OWNER Authorization ID of the owner of the trigger. SCHEMA Name of the schema of the trigger and collection ID of the trigger package. TBNAME Name of the table to which this trigger applies. TBOWNER Qualifier of the name of the table to which this trigger applies. TEXT T/V CREATOR Referenced table/view creator in the triggered action of the CREATE TRIGGER statement. TEXT T/V NAME Referenced table/view name in the triggered action of the CREATE TRIGGER statement. TEXT UDF/SP SCHEMA Referenced user-defined function and stored procedure schema. TEXT UDF/SP NAME Referenced user-defined function and stored procedure name. TEXT SQ SCHEMA Referenced sequence schema. TEXT SQ NAME Referenced sequence name.

110 User Guide

Global Change Services

TIME Time when triggered actions are applied to the base table, relative to the event that activated the trigger. Valid values are as follows: ■

BEFORE—Trigger is applied before the event.



AFTER—Trigger is applied after the event.

Example: Apply Global Changes to a Trigger This example SQL shows how you can apply global changes to a trigger. Note: Attributes that you can change (using global changes) are shown in bold. Within the trigger body text, you can update the name, creator, and schema of the trigger parents. .AUTH CREATEDBY SET CURRENT SQLID = OWNER; SET CURRENT PATH "SYSIBM" , "SYSFUN" , "SYSPROC" , SCHEMA; CREATE TRIGGER SCHEMA.NAME TIME(BEFORE | AFTER)

EVENT(INSERT | UPDATE | DELETE)

OF COLUMNS ON TBOWNER.TBNAME REFERENCING NEW AS NEW OLD AS OLD FOR EACH GRANULARITY(ROW | STATEMENT) MODE DB2SQL WHEN (condition) BEGIN ATOMIC trigger_body END;

Global Changes and Edits The Object Edit option lets you exclude a specific object field from global changes. Note: Object edits always override global changes. If a global change is specified for an object higher in the DB2 hierarchy than an object to which a specific change has been made, the specific edit still overrides the global change. Problems can result if global changes are specified and a dependent object's definition is then changed.

Chapter 3: Profile 111

Global Change Services

Priority of Global Changes CA RC/Migrator has specific methods of prioritizing global changes, including the following situations: ■

Multiple changes to a specific object (see page 112)



Changes to specific objects versus changes to all objects (see page 112)

Multiple Changes to a Specific Object If multiple changes are specified for a given object, the first change takes precedence and cannot be overwritten. For example, a table might have column names of A, B, and C. You can specify two global changes (first change requiring changing column A to C and second change requiring changing column C to XYZ). The resulting table will have columns of C, B, and XYZ.

Changes to Specific Objects Versus Changes to All Objects Even though global changes can be specified for all objects and for specific objects, the changes to specific object types override the all-object changes (when changes occur). However, if the specific-level change does not change the attribute, the all-object change is processed. Indexes pose a particular complication because changes can be made to the table name and creator fields in many different ways for both tables and indexes, causing conflicting changes. The following list documents the possible ways that the table name and creator values can be changed and the hierarchy of those changes. The first item on the list is the highest in the hierarchy (overrides all others).

112 User Guide



The index is edited to change the tbname and tbcreator.



The table is edited to change the name and c. (Changes are propagated down to the tbname and tbcreator fields for dependent indexes.)



Global changes to the index tbname and tbcreator are specified.



Global changes to the table name and creator are specified. (Changes are propagated down to the tbname and tbcreator fields for dependent indexes.)



Global changes are specified to all creator IDs.

Global Change Services

Validation Information that is entered in the From and To fields is validated to help ensure that it is correct. Some of the validation checks include: ■

Data type



Number of characters

Note: For fields that require specific information, checks are made to see whether the values entered are valid for the attribute type. If an incorrect value is entered, an error message is generated and attempts to correct the invalid entries are made.

CHANGE Command You can use the CHANGE command to search for character strings and change their values globally in a global change set instead of manually change each entry that must be modified. Specifically, the CHANGE command changes the value of a character string using the From and To columns of a global change set. It searches for all occurrences of the From string and changes each to the To string. The From and To operands specify the source and target strings, respectively. Both operands are required. The From and To operands must be specified as unquoted strings, must not be more than 18 characters in length, and cannot contain blanks. If a string is longer than the maximum width of the column (18 characters), the change will not be made. The column name and object type operands can be used concurrently or separately, and their positions are interchangeable. The optional column name operand is used to limit the search for From strings to the From or To column. ■

From—Search this column only.



To—Search this column only.



*—Search the From and To columns. This is the default.

Note: If the column name operand is omitted, both the From and To columns are searched. The optional object type operand is used to limit the search for from strings to only those attributes under a specific object type. Valid values are as follows: ■

ALL—Search all object types (default)



AL—AL types only



SG—Storage Group



DB—Database

Chapter 3: Profile 113

Compare Rule Database Services



TS—Tablespace



TB—Table



IX—Index



VW—View



SY—Synonym



AS—Alias



PL—Plan



PK—Package

Note: If the object type operand is omitted, all object types are searched. When a column on a line is changed, the characters =CHG> display next to the column. If the change cannot be made, the columns on which the error occurred are highlighted and the characters =ERR> next to the column. The following shows the change command syntax: CHANGE from to



Compare Rule Database Services Rule sets are used to specify which object types or attributes, such as space allocations, should not be compared when using compare services. With Compare Rule Database Services, you can specify object attributes that should not be compared. You can perform the following tasks:

.



Create new rule sets



Template existing rule sets to create new rule sets



Update existing rule sets



Browse existing rule sets



Delete rule sets



Select a rule set for a compare strategy

More information: Access the Profile Menu (see page 69)

114 User Guide

Compare Rule Database Services

Considerations When Working with Rule Sets Consider the following: ■

Some attributes have dependent attributes. To refrain from comparing any of the dependent attributes, set the primary attribute and all of its dependent attributes to N. If the primary attribute is set to N and any of the dependent attributes are set to Y, the primary attribute is reset to Y.



For all objects, if the Creator attribute is set to N, the creator from the target DB2 catalog in the analysis is used; if it is set to Y, the creator from the source object is used.



For database, if stogroup and buffer pool are specified, all table and indexspaces will use this storage group or buffer pool by default unless they specify their own.



For tablespace, the parted attribute is used by compare strategies only when a partitioned tablespace is being compared to a non-partitioned tablespace. The attributes listed below partitions are subordinate. To refrain from comparing partitions, set this attribute and the subordinate attributes to N.



The Stogroup should not be changed, because different space allocations are required to handle the larger amount of data in the production subsystem.



The creator ID should not be changed, because distinct creator IDs are used in the test and production environments.

Create a Rule Set You can create a rule set as follows. To create a rule set 1.

Select Compare Rule Database Services from the Profile Menu. Note: The user must have authorization to use Compare Rule Database Services through the Product Authorizations facility or it will not appear on the menu. For more information about using the Product Authorizations facility, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. The Rule Database Services panel appears.

2.

Complete the following fields to create a new rule set: Rulename Specifies the rule set name. Description (Optional) Specifies a description of the rule set.

Chapter 3: Profile 115

Compare Rule Database Services

Creator Specifies the user ID of the creator. SO (Share Option) Specifies the authorization for others to use or update the rule set. Trg SSID Specifies the target subsystem ID for the compare strategy. Press Enter. A list of rule set attributes appears. 3.

Enter N next to each attribute that should not be compared. By default all attributes are compared. Therefore, to create a rule set, at least one attribute must be set to N (do not compare). Note: A value of Y next to an attribute indicates that the source value of the attribute should be used. A value of N next to an attribute indicates that the target value of the attribute should be used.

View and Update Existing Rule Set Attributes You can view an existing rule set, as well as make updates to a rule set's attributes. To view and update existing rule set attributes 1.

Select Compare Rule Database Services from the Profile Menu. Note: The user must have authorization to use Compare Rule Database Services through the Product Authorizations facility or it will not appear on the menu. For more information about using the Product Authorizations facility, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. The Rule Database Services panel appears.

2.

Enter U in the O field next to an existing rule set. A list of rule set attributes appears.

3.

Enter N next to each attribute that should not be compared. By default, all attributes are compared. Therefore a rule set must have at least one attribute that is set to N (do not compare). Note: A value of Y next to an attribute indicates that the source value of the attribute should be used. A value of N next to an attribute indicates that the target value of the attribute should be used.

116 User Guide

Compare Rule Database Services

Common Object Attributes for a Rule Set The following attributes apply to all objects: CREATEDBY Specifies the authorization ID of the user who created the object. CREATOR Specifies the authorization ID of the owner of the object. Note: If CREATOR is set to N, CA RC/Migrator uses the creator from the target DB2 catalog in the analysis; if CREATOR is set to Y, CA RC/Migrator uses the creator from the source object. NAME Specifies the name of the object.

Storage Group Object Attributes for a Rule Set The following attributes can be specified for storage groups: VCAT Specifies the name of the VSAM catalog that is used to track the DASD volumes defined by the storage group. PASSWORD Specifies the VSAM data set password. VOLUMES Specifies any volumes (if explicitly defined).

Database Object Attributes for a Rule Set The following attributes can be specified for databases: STOGROUP Specifies the database's storage group. All tablespaces and indexspaces will use this storage group by default unless they specify their own storage group. BUFFERPOOL Specifies the database's buffer pool. All tablespaces and indexspaces will use this buffer pool by default unless they specify their own buffer pool.

Chapter 3: Profile 117

Compare Rule Database Services

ROSHARE Specifies the data attribute of a read-only database that is shared across subsystems. TYPE Specifies database type: ■

WORKFILE or TEMP



TEMP and WORKFILE

CCSID (Coded Character Set Identifier) Specifies the CCSID encoding scheme. INDEXBP Specifies the name of the default buffer pool for indexes.

Tablespace Object Attributes for a Rule Set The following attributes can be specified for tablespaces: DATABASE Specifies the name of the database that contains the tablespace. BUFFERPOOL Specifies the tablespace's buffer pool. LOCKSIZE Specifies the lock size of the tablespace. This setting determines how DB2 locks the pages in the tablespace. CLOSE Specifies whether the VSAM data sets that are allocated to the tablespace are closed when the tablespace is not in use. PASSWORD Specifies the VSAM data set password. PARTED Specifies whether the tablespace is partitioned. This attribute is used by compare strategies when a partitioned tablespace is being compared to a non-partitioned tablespace. SEGSIZE Specifies the number of pages in each segment of the segmented tablespace. The tablespace does not have any pages if it is not segmented.

118 User Guide

Compare Rule Database Services

LOCKMAX Specifies the maximum number of page or row locks that an application can hold in the tablespace before locks are escalated from the level indicated in the LOCKSIZE field. CCSID (Coded Character Set Identifier) Specifies the CCSID encoding scheme. TYPE Specifies the tablespace type. MAXROWS Specifies the maximum number of rows that DB2 will place on a data page. LOCKPART Specifies whether selective partition locking is to be used when locking a partitioned tablespace. DSSIZE Specifies the maximum size of a data set (in kilobytes). LOG Specifies whether changes to the tablespace are to be logged. Y Specifies that changes are to be logged. N Specifies that changes are not to be logged (only applies to LOB tablespaces). DEFINE Specifies when the underlying data sets for the tablespace are physically created. PARTITIONS Specifies the number of partitions. Note: To refrain from comparing partitions, specify N for this attribute and the remaining attributes described in this section. VCAT Specifies the name of the VSAM catalog that is used to track the DASD volumes defined by the tablespace. Each partition can reference a different VSAM catalog. STOGROUP Specifies the storage group for the partition. The storage group can be different for each partition.

Chapter 3: Profile 119

Compare Rule Database Services

PRIMARY Specifies the primary space allocation. SECONDARY Specifies the secondary space allocation. ERASE Specifies whether the tablespace data sets are overwritten when the tablespace is dropped. Note: This attribute does not apply to partitioned tablespaces. FREEPAGE Specifies the number of pages that are loaded before a page is left as free space. PCTFREE Specifies the percentage of each page left as free space. COMPRESS Specifies whether to compare the COMPRESS option setting for the tablespaces to be compared. GBPCACHE Specifies the group buffer pool cache option for tablespace partitions. TRACKMOD Specifies whether DB2 tracks modified pages in the space map pages of the tablespace or partition. VSAM_TYPE Specifies the VSAM data set type. VSAM_UNIT Specifies the VSAM space allocation unit. VSAM_PRIM Specifies the VSAM primary space allocation. VSAM_SEC Specifies the VSAM secondary space allocation. VSAM_VOLS Specifies the VSAM volumes. VSAM_MPSW Specifies the VSAM master password.

120 User Guide

Compare Rule Database Services

VSAM_CPSW Specifies the VSAM control password. VSAM_ERASE Specifies the VSAM erase rule.

Table Object Attributes for a Rule Set The following attributes can be specified for tables. Note: The table attributes regarding constraints and foreign keys are designed to prevent unnecessary activity on the target during a comparison. For example, when the PAIR_FOREIGN_KEYS rule is active, foreign keys that are the same on the source and target are paired. FOREIGN_KEY_NAME is then used to pick the foreign key name that gets used in the output. DATABASE Specifies the name of the table's database. TABLESPACE Specifies the name of the table's tablespace. EDITPROC Specifies the table's edit procedure. This attribute is blank if there is no procedure. VALIDPROC Specifies the table's validation procedure. This attribute is blank if there is no procedure. AUDIT Specifies the value of the audit option (AUDIT ALL, AUDIT CHANGE, AUDIT NONE). This option is regarding the types of access to this table that will cause auditing to be performed. DATACAPTURE Specifies the value of the data capture option (NONE, CHANGES). This option is regarding whether SQL changes to the table should be written to the log. LABEL Specifies the table label. COMMENT Specifies the table comments.

Chapter 3: Profile 121

Compare Rule Database Services

RESDROP Specifies a value of the Restrict (on drop) option (N or Y). This option is regarding whether to protect the table from being accidentally dropped. CHECK_CONSTRAINT Specifies the constraint of a column definition. CCSID (Coded Character Set Identifier) Specifies the CCSID encoding scheme. TYPE Specifies the table object type. PART Specifies the partition number of the base tablespace of an auxiliary table. BASETBCREATOR Specifies the base table creator for the auxiliary table. BASETBNAME Specifies the base table name for the auxiliary table. BASECOLNAME Specifies the LOB column name in the base table. VOLATILE Specifies a volatile table. COLUMNS Specifies all column information. All the COL attributes are subordinate to COLUMNS. To refrain from comparing column information, set the COLUMNS attribute and all COL attributes to N. COL_NAME Specifies column names. COL_TYPENAME Specifies the data type of the column. COL_SIZE Specifies column size (length or precision for decimal). COL_SCALE Specifies column scale (for decimal types only). COL_NULL Specifies a column null indicator.

122 User Guide

Compare Rule Database Services

COL_BITDATA Specifies that a column has bitdata (FOREIGNKEY in syscolumn). COL_LABEL Specifies the column label. COL_NUMBER Specifies the column's numerical position in the table. COL_FIELDPROC Specifies whether the column has a field procedure, which is an edit routine that transforms or translates a field to or from its stored condition. COL_FIELDPARM Specifies a parameter list for the field procedure specified by COL_FIELDPROC. COL_COMMENT Specifies column comments provided by the user (using COMMENT ON statement). DELETE_UNPAIRED_TARGET Specifies to delete target columns that are not mapped to a source column. MOVE_UNPAIRED_SOURCE Specifies to take all source columns not mapped to the target and add them to the target. COLUMN_DEFAULT Specifies the type of default value for the column. TYPESCHEMA Specifies a values as follows: ■

Specifies name of distinct type (if coltype is distinct).



Specifies SYSIBM in all other situations.

START Specifies the starting value for the identity column. INCREMENT Specifies the incremental value for the identity column. CACHE Specifies to keep preallocated value in memory.

Chapter 3: Profile 123

Compare Rule Database Services

MAXVALUE Specifies the maximum value for the identity column. MINVALUE Specifies the minimum value for the identity column. CYCLE Specifies whether the identity column should generate values after reaching the MAX or MIN values. RESTARTWITH Specifies whether to compare the RESTART status of an identity column. A Y setting specifies to do the comparison. If the source is different from the target, the target is set to the source’s status. An N setting specifies to not do the comparison, in which case the RESTART status of the identity column is left as is on the target. ORDER Specifies whether to compare an identity column’s ORDER attribute. Note: When ORDER is specified for an identity column, the values generated for the column are distributed in numeric order. If NO ORDER is specified, the values may not be given out in strict numeric order. PAIR_FOREIGN_KEYS Specifies whether foreign keys are paired if the constraints they depend on are paired. The subordinate rule attributes apply if foreign keys are paired. FOREIGN_KEY_NAME Specifies whether to compare the names of the paired foreign key. If compared names are different, the name from the source is used. FOREIGN_KEY_TBCREATOR Specifies whether to compare the referenced table creators of paired foreign keys. If compared table creators are different, the referenced table creator from the source is used. FOREIGN_KEY_TBNAME Specifies whether to compare the referenced table names of paired foreign keys. If the compared table names are different, the referenced table name from the source is used. FOREIGN_KEY_DELRULE Specifies whether to compare the delete rules of paired foreign keys. If compared delete rules are different, the delete rule from the source is used.

124 User Guide

Compare Rule Database Services

MOVE_UNPAIRED_SRC_FKS Specifies whether unpaired foreign keys on the source are added to the target (regardless of the PAIR_FOREIGN_KEYS rule) and generated in the resultant DDL. DROP_UNPAIRED_TRG_FKS Specifies whether to delete unpaired foreign keys on the target (regardless of the PAIR_FOREIGN_KEYS rule). PAIR_CONSTRAINTS Specifies whether unique constraints (including primary keys) are paired, based on their key columns. The subordinate rule attributes apply if constraints are paired. CONSTRAINT_NAME Specifies whether to compare the names of paired constraints. If compared names are different, the name from the source is used. CONSTRAINT_TYPE Specifies whether to compare the types of paired constraints. If compared types are different, the type from the source is used. MOVE_UNPAIRED_SRC_CONSTS Specifies whether unpaired constraints on the source will be added to the target (regardless of the PAIR_CONSTRAINTS rule) and generated in the resultant DDL. DROP_UNPAIRED_TRG_CONSTS Specifies whether to delete unpaired constraints on the target (regardless of the PAIR_CONSTRAINTS rule). PARTITIONING Specifies table-controlled partitioning (TCP). LIMITKEY_VALUES Specifies limit key values for table-controlled partitioning. MATERIALIZED Specifies that MQT information should be compared. All MQT attributes are subordinate to MATERIALIZED. To avoid comparing MQT information, set MATERIALIZED to N, and set all MQT subordinate attributes to N. REFRESH Specifies the refresh mode of the MQT. ENABLE Specifies whether query optimization is enabled for the MQT.

Chapter 3: Profile 125

Compare Rule Database Services

MAINTENANCE Specifies whether the MQT is maintained by system or user. ISOLATION Specifies isolation level when the MQT is created or altered from a base table. TEXT Specifies the text of the CREATE table statement.

Index Object Attributes for a Rule Set The following attributes can be specified for indexes: TBCREATOR Specifies the creator of the table. If a global ALCREATOR change has been specified, TBCREATOR changes accordingly. TBNAME Specifies the name of the table upon which the index is based. UNIQUE Specifies whether the index was defined as UNIQUE. BUFFERPOOL Specifies the index's buffer pool. SUBPAGES Specifies the number of subpages for each physical page. CLOSE Specifies whether the VSAM data sets allocated to the indexspace are closed when the index is not in use (resource consideration). PASSWORD Specifies the VSAM data set password. CLUSTER Specifies whether the index is a clustering index. PARTED Specifies whether the index is partitioned. This attribute is used by compare strategies when a partitioned index is being compared to a nonpartitioned index.

126 User Guide

Compare Rule Database Services

TYPE Specifies the index type: ■

D (data partitioning secondary index)



P (partitioning Index)

PIECESIZE Specifies the size of the data sets that make up a non-partitioning index. COPY Specifies copy index. DEFINE Specifies when the underlying data sets for the index are physically created. DEFER Specifies whether to build the index now or build it during the execution of the CREATE INDEX statement. PADDED Specifies whether keys within the index are padded or not padded. COMMENT Specifies INDEX comments provided by the user (using COMMENT ON statement). PARTITIONS Specifies the number of partitions (if the index is partitioned). To refrain from comparing PARTITIONS, set this attribute and the following attributes (up to COLUMNS) to N. VCAT Specifies the name of the VSAM catalog used to track the DASD volumes defined by the indexspace. Each partition can reference a different VSAM catalog. STOGROUP Specifies the storage group for the index or partition. This attribute can be different for each partition. PRIMARY Specifies the primary space allocation. SECONDARY Specifies the secondary space allocation.

Chapter 3: Profile 127

Compare Rule Database Services

ERASE Specifies whether the index data sets are overwritten when the indexspace is dropped. Note: This attribute does not apply to partitioned indexspaces. FREEPAGE Specifies the number of pages that are loaded before a page is left as free space. PCTFREE Specifies the percentage of each subpage or nonleaf page that is left as free space. VALUES Specifies the limit key values. GBPCACHE Specifies the group buffer pool cache option for the index partition, indicating what pages to cache in the group buffer pool. VSAM_TYPE Specifies the VSAM data set type. VSAM_UNIT Specifies the VSAM space allocation unit. VSAM_PRIM Specifies the VSAM primary space allocation. VSAM_SEC Specifies the VSAM secondary space allocation. VSAM_VOLS Specifies the VSAM volumes. VSAM_MPSW Specifies the VSAM master password. VSAM_CPSW Specifies the VSAM control password. VSAM_ERASE Specifies the VSAM erase rule.

128 User Guide

Compare Rule Database Services

COLUMNS Specifies the numerical position of the column in the key. To refrain from comparing column information, set COLUMNS and the remaining attributes in this section to N. COLNAME Specifies the column name. COLORDER Specifies the order of the column in the key (A for ascending, D for descending).

Synonym Object Attributes for a Rule Set The following attributes can be specified for synonyms: TBCREATOR Specifies the authorization of the owner of the table. TBNAME Specifies the name of the table that the synonym represents.

View Object Attributes for a Rule Set The following attributes can be specified for views: LABEL Specifies label text provided by the user (using LABEL ON statement). COMMENT Specifies view comments provided by the user (using COMMENT ON statement). CHECK Specifies whether the CHECK OPTION was specified when the view was created. The CHECK OPTION is used to ensure that updates and inserts satisfy the view criteria specified on the SELECT.

Chapter 3: Profile 129

Compare Rule Database Services

TEXT Specifies whether to select the next three subordinate (indented) attributes, which represent subsets of view text. Note: If N is entered, none of the view attributes will be compared, because N overrides any settings for the three subordinate attribute fields. OBJECT_CREATOR Specifies whether to compare the creators of the objects referenced by the view. OBJECT_NAME Specifies whether to compare the names of the objects referenced by the view. REMAINING_TEXT Specifies whether to compare the rest of the view text (column names, where clause, and so on).

Alias Object Attributes for a Rule Set The following attributes can be specified for aliases: LABEL Specifies label text provided by the user (using LABEL ON statement). COMMENT Specifies alias comments provided by the user (using COMMENT ON statement). LOCATION Specifies the location of the alias. TBCREATOR Specifies the base table creator. TBNAME Specifies the reference table name or view name.

130 User Guide

Compare Rule Database Services

Trigger Object Attributes for a Rule Set The following attributes can be specified for triggers: SCHEMA Specifies the schema of the trigger. OWNER Specifies the authorization ID of the owner of the trigger. TBOWNER Specifies the qualifier of the name of the table to which this trigger applies. TBNAME Specifies the name of the table to which this trigger applies. TRIGTIME Specifies the time when trigger actions are applied to the base table. TRIGEVENT Specifies the operation that activates the trigger. GRANULARITY Specifies whether the trigger is executed once per statement or row. REMARKS Specifies trigger comments provided by the user (using COMMENT ON statement). COLUMNS Specifies the triggered column name of the subject table. CORRELATIONS Specifies a correlation name, which identifies a column of a specific row. ACTION_TEXT Specifies the action to be performed when the trigger is activated. PATHSCHEMAS Specifies the trigger pathschema.

Chapter 3: Profile 131

Compare Rule Database Services

Sequence Object Attributes for a Rule Set The following attributes can be specified for sequences: SCHEMA Specifies the SQL short identifier used to explicitly qualify the sequence. OWNER Specifies the authorization ID of the owner of the sequence. INCREMENT Specifies the interval between consecutive values of the sequence. START Specifies the starting value of the sequence. MAXVALUE Specifies the maximum value that is generated for the sequence. MINVALUE Specifies the minimum value that is generated for the sequence. CYCLE Specifies whether the sequence should continue to generate values after reaching the minimum or maximum value of the sequence. CACHE Specifies whether to keep some preallocated values in memory. ORDER Specifies whether the sequence values must be generated in order of request. PRECISION Specifies the precision for the sequence. RESTARTWITH Specifies whether the sequence should be restarted when it is time to generate the next sequence and specifies the value to use when the sequence is restarted. TYPENAME Specifies the data type of the sequence. The data type can be any exact numeric data type (SMALLINT, BIGINT, INTEGER, or DECIMAL) or can be a user-defined distinct type. TYPESCHEMA Specifies the high-level qualifier of the data type for the sequence.

132 User Guide

Compare Automapping Mask Services

Compare Automapping Mask Services The Automap Mask Services screen, together with the Compare Automapping Masks screen, can be used to create and maintain multiple mask sets to be used with the AUTOMAP command and with automapped compare strategies (type 5). These Automapping Mask sets can be used repeatedly when analyzing compare strategies. These masks are also used by the Compare Facility to automatically map dependent objects and are used by the automap data set compares to map all objects. More information: Access the Profile Menu (see page 69)

Accessing Automapping Mask Services There are three methods for accessing Automapping Mask Services. ■

From the Expert Profile menu, select option 5, Compare Automapping Mask Services, to display the Automap Mask Services screen.



The Create Compare Strategy panel allows specification of an Automapping set. A wildcard set name specified in the Mask Set Specification field will display the Automap Mask Services screen.



From the Compare Explode Services screen, use the MASKSET command (available only at the Compare Explode Services screen).

Automap Mask Services Screen The Automap Mask Services screen is used to create and maintain one or more automapping mask sets, which are stored in a DB2 table in the current subsystem. SET SSID Enter the SSID of the DB2 subsystem where the automapping mask sets are stored. Selection criteria are not accepted. SET NAME Enter the name of the automapping mask set, up to eight characters. Selection criteria are accepted.

Chapter 3: Profile 133

Compare Automapping Mask Services

Creator Enter the ID of the mask set's creator. Selection criteria are accepted. O (Line Options) The Line Options field for entering line commands. Line commands (except C) are valid only for existing sets. ■

B—Browse an existing set.



C—Create a new set.



D—Delete an existing set.



T—Template (copy) an existing set.



U—Update (modify) an existing set.

SETNAME The name of the automapping mask set. DESCRIPTION The description of the automapping mask set (optional). Creator The set owner's ID. SO (Share Option) The Share Option designation of the authorization for others to use or update the set. ■

Y—Others can use, but not update, the set.



U—Others can use and update the set.



N—Other users cannot reference or copy the set (sets created by other users saved with a Share Option of N will not be displayed).

LAST UPDATE Information The ID of the user who last updated the set, and the date and time of the last update. If you choose to browse, create, template, or update a mask set, the Compare Automapping Masks screen appears.

Compare Automapping Masks Screen The Compare Automapping Masks screen lets you define masks. A mask is a pattern used to match multiple items. These masks are used with the AUTOMAP command to map objects whose name or creator IDs match the masks. To facilitate one-to-many comparisons, more than one mask can be created for the same object attribute.

134 User Guide

Compare Automapping Mask Services

When creating or updating the automapping mask set, the mask fields can be modified. The Compare Automapping Masks screen displays when choice is made to browse, create, template, or update (B, C, T, or U) an automapping mask set from the Automap Mask Services screen. The following describes the files on this screen: Set Name The name of the automapping mask set, up to eight characters. Selection criteria are accepted. Creator The creator ID. Selection criteria are accepted. Description The description of the automapping mask set. Creator The set owner's ID. Share Option The Share Option designation of the authorization for others to use or update the set. ■

Y—Others can use, but not update, the set.



U—Others can use and update the set.



N—Other users cannot reference or copy the set (sets created by other users saved with a Share Option of N will not be displayed).

Valid Commands The following line commands can be entered to the left of each mask line. Use these commands to specify more than one mask for the same object attribute. ■

D—Delete the current attribute set. The first line within each object type cannot be deleted.



I—Insert a blank attribute set below the current set.



R—Insert a new attribute set below the current set and repeat the text of the current set.

OBJECT For each object type, masks can be specified for the name and creator. (For tablespaces, a mask can be specified for the name and database.) SOURCE Enter the mask for the source object or creator.

Chapter 3: Profile 135

Compare Automapping Mask Services

TARGET Enter the mask for the target object or creator. The following are valid masking characters. ■

% (percent sign)—The percent sign is the wildcard character. It signifies that zero or more characters can occupy that position and all remaining positions to the end of the name, or to the next character. The percent sign can be used at any location in the name. If a percent sign is used in both the source mask and the target mask, the characters that occupy that position on the source must be the same as the characters that occupy the position on the target. The percent sign will also match the absence of characters. If a character does not appear at the percent sign's position, it is considered a match. A percent sign by itself will map anything to anything. This is useful to map together objects that have the same name but different creators.



- (hyphen)—The hyphen indicates that any character can occupy the position, but a character must exist at that position. If a hyphen is used in both the source mask and the target mask, the character that occupies that position must be the same on the source as on the target. The hyphen can be repeated in several places in the name. (Similar to the underscore character used for DB2 selection criteria.) If a character does not appear at the hyphen's position, the match will fail.



=*(blank)—An equal sign (=), an asterisk (*), and a blank ( ) are all like-named masking characters. If you specify a pair of any of these characters for the Source and Target of an object, it means that the two names must be the same.

The following table lists examples of mask combinations and mapped results:

Source Mask

Target Mask

Source Name

Target Name

DSN%

PTI%

DSNTABLE

PTITABLE

%TEST

%PROD

SGTEST

SGPROD

TABLE1

TABLE-

TABLE1

TABLE2

ON-_TEST%

OF-_PROD%

ON3_TEST_TBL

OF3_PROD_TBL

*

*

ABC

ABC

Note: Unpaired masking characters can exist in the target mask only. Multiple target objects can be mapped to a single source object; however, multiple source objects cannot be mapped to a single target object.

136 User Guide

Managed Output Maintenance

The following table lists examples of invalid uses of masking combinations.

Source Mask

Target Mask

TABLE-

TABLE2

B-XXX

BXX-X

Exiting the Screen When PF3 (End) is pressed, the changes to the automapping mask set are saved, and the screen from which automapping mask services was called reappears. If the CANCEL command is entered, the changes made to the automapping mask set will not be saved, and the screen from which automapping mask services was called reappears.

Managed Output Maintenance Each strategy that has been analyzed, at least once, has analysis output rows. Analysis output rows can be defined as each line that displays on the Strategy Services panel under each analyzed strategy in the list when the Analysis Output List (L) option is enabled. Each analysis output row includes one strategy analysis, and optionally, one recovery analysis. When the output is managed output (output to a DB2 table managed by CA RC/Migrator), the Managed Output Maintenance facility can be used to maintain those rows. The Managed Output Maintenance facility lets you set maintenance defaults and specify how (or if) maintenance should be applied to strategies when they are created (new strategies) or analyzed (old strategies). More information: Access the Profile Menu (see page 69)

Chapter 3: Profile 137

Managed Output Maintenance

Access the Managed Output Maintenance Facility You can access the managed output maintenance facility as described in this section. To access the managed output maintenance facility 1.

Enter 0 on the Main Menu, and press Enter. The Profile or Expert Profile Menu appears.

2.

Enter M (Managed Output Maintenance), and press Enter. The Managed Output Maintenance Services screen appears.

Set Managed Output Maintenance Defaults You can set defaults for the Managed Output Facility. To set defaults for the Managed Output Facility 1.

Access the Global Operational Parameters screen (from the Expert Profile screen).

2.

Enter Y (Yes) in the Update Output Specifications field and press Enter to process. The RC/M Global Operational Parameters screen appears. The Default Managed Output Maintenance Specifications fields lets you view, set, and change the defaults for managed output maintenance.

3.

To apply maintenance to multiple strategies, enter S (Select) next to the strategies to which maintenance should be applied.

4.

Press Enter to process. The Managed Output Maintenance Services screen redisplays, allowing selection of additional strategies.

5.

Do one of the following: ■

Press PF3 (End) to process.



Enter APPLYM in the command line and press Enter to process.

The Managed Output Maintenance Apply screen appears.

138 User Guide

6.

In the Execution Mode field, indicate whether processing should be completed online or in batch.

7.

Enter Y (Yes) in the Apply Maintenance field.

Managed Output Maintenance

8.

Complete the Output Maintenance Report field.

9.

Press Enter to process. Maintenance is applied and any requested maintenance report displays.

More information: Define Global Operational Parameters (see page 70) Updating Output Specifications (see page 72)

Apply Output Maintenance to a Single Strategy You can apply maintenance to a single strategy. To apply maintenance to a single strategy 1.

On the Managed Output Maintenance Services screen, enter A (Apply) next to the strategy to which maintenance should be applied.

2.

Press Enter to process. The Managed Output Maintenance Apply screen displays.

3.

In the Execution Mode field, indicate whether processing should be completed online or in batch.

4.

Enter Y (Yes) in the Apply Maintenance field.

5.

Complete the Output Maintenance Report field.

6.

Press Enter to process. Maintenance is applied and any requested maintenance report displays.

Applying Managed Output Maintenance Managed output maintenance is applied based on the global operational parameters (when “Apply maintenance to old strategies analyzed” is set to Y) or when you determine that maintenance is required do one of the following: ■

Apply it on a strategy-to-strategy basis.



Edit the JCL based on selection criteria from the SELECT parm card.

Begin by selecting the strategy or strategies to which maintenance should be applied. Do this on the Managed Output Maintenance Services screen.

Chapter 3: Profile 139

Managed Output Maintenance

Selecting Strategies for Maintenance Use the Managed Output Maintenance Services screen to select one or more strategies for maintenance. The screen shows the existing default maintenance criteria for all strategies and the existing method of maintenance for each strategy displayed. The first six header fields on the Managed Output Maintenance Services screen (DB2 ssid, strategy, creator, type, share opt, src ssid) are the standard header fields and are used to filter the display of strategies. Global Default Criteria (Display only) The global defaults for managed output maintenance criteria. These are the values specified on the Global Operational Parameters screen and the ones currently in effect for your ID. ■

Min Retention—The minimum number of analysis rows to be maintained for a strategy.



Max Retention—The maximum number of rows to be maintained for a strategy.



Max Age (days)—The number of days for which each analysis output should be maintained.

STRATEGY (Display only) The name of the strategy. Creator (Display only) The creator of the strategy. TYPE (Display only) The type of strategy. SHARE OPT (Display only) The share option of the strategy. SRC SSID (Display only) The share option of the strategy. LAST UPDATE (Display only) The ID of the user who last updated this strategy and the date and time that update was done.

140 User Guide



USER—The ID of the user that last updated this strategy.



DATE—The date this strategy was last updated.



TIME—The time the strategy was last updated.

Managed Output Maintenance

MIN RET The minimum number of rows to be maintained. When METHOD is set to USER, this field can be updated on this screen (providing the share option gives you update access). ■

0-99999—Indicates the minimum number of rows that are maintained.



(blank)—Indicates that no maintenance is applied; blank displays when the METHOD is set to NONE.



*—Indicates there is no minimum.

MAX RET The maximum number of rows to be maintained. When METHOD is set to USER, this field can be updated on this screen (providing the share option gives you update access). ■

1-99999—Indicates the maximum number of rows that are maintained.



(blank)—Indicates that no maintenance is applied; blank displays when the METHOD is set to NONE.



*—Indicates there is no maximum.

MAX AGE The age that must be exceeded before rows are deleted. When METHOD is set to USER, this field can be updated on this screen (providing the share option gives you update access). ■

1-99999—Indicates the age that must be exceeded before rows are deleted.



(blank)—Indicates that no maintenance is applied; blank displays when the METHOD is set to NONE.



*—Indicates there is no maximum.

METHOD (Display only) Indicates the method used to set the managed output maintenance defaults. This is also referred to as the “method of maintenance.” Use the line commands (described in the next section) to change the METHOD. ■

GLOBAL—Defaults were set by the global defaults and is automatically replaced when global defaults change.



USER—Defaults were set by a user and can never be replaced by global settings.



NONE—There are no maintenance defaults set for this strategy. Maintenance will not be applied to this strategy at all.



DISABLE—Maintenance is disabled for this strategy. This strategy will not be eligible for maintenance until after it is re-enabled with the G (GLOBAL) or U (USER) line commands.

Chapter 3: Profile 141

Managed Output Maintenance

Line Commands Use the following line commands in the O (Option) field to work with strategies on the Managed Output Maintenance Services screen.

142 User Guide



A—Immediately apply output maintenance to the specified strategy. Only strategies whose method of maintenance is set to GLOBAL or USER can be selected for maintenance.



D—Disable output maintenance for the specified strategy. Maintenance for the strategy is disabled until re-enabled with the G (GLOBAL) or U (USER) line commands. This setting is similar to NONE (the N line command), except that the strategy's current settings for MIN RET, MAX RET and MAX AGE are saved.



G—Set the strategy's method of maintenance to GLOBAL. The current default settings (as displayed in the header under “Global Default Criteria” in the upper right portion of the screen) are used for MIN RET, MAX RET and MAX AGE. These are default setting as specified on the RC/M Global Operational Parameters panel. When GLOBAL maintenance is in effect and the “Global Default Criteria” is subsequently changed such that it is different than the strategy's MIN RET, MAX RET and MAX AGE do not match the current “Global Default Criteria” settings will appear highlighted in the scrollable list.



N—Set the strategy's method of maintenance to NONE. When NONE is in effect, no maintenance is applied to the strategy. This setting is similar to DISABLE (the D line command), except that the strategy's current settings for MIN RET, MAX RET and MAX AGE are not remembered.



S—Selects the specified strategy for later output maintenance or reporting. Only strategies whose method of maintenance is set to GLOBAL or USER may be selected for maintenance. To deselect a strategy, simply clear the S or use the Reset command. (See the APPLYMaint command in Primary Commands for additional information about how to apply maintenance to strategies selected in this manner.)



U—Set the strategy's method of maintenance to USER. When USER maintenance is in effect, the MIN RET, MAX RET, and MAX AGE fields can be directly updated from this screen. The current default settings (as displayed in the header under “Global Default Criteria” in the upper right portion of the screen) for MIN RET, MAX RET and MAX AGE are used by default if no values previously existed for this strategy. However, once set, the strategy's MIN RET, MAX RET and MAX AGE fields will remain unaffected by any subsequent changes to the “Global Default Criteria” settings.



!—Toggles the display of the strategy's description.

Managed Output Maintenance

Primary Commands Following is a list of available primary commands for the Managed Output Maintenance Services screen. For more information about primary commands, enter a question mark (?) in the command line. ■

All—Select all eligible strategies in the scrollable list. Eligible strategies are those that have their method of maintenance set to GLOBAL or USER. Strategies that have their method of maintenance set to DISABLE or NONE will not be selected. (Use the S line command to select individual strategies.)



APPLYMaint—Apply maintenance to all selected strategies. (See the primary command ALL and the line command S for additional information about how to select strategies for maintenance.)



Desc—Toggle the display of strategy descriptions. When description list mode is enabled, there is one indented entry for each strategy that has a non-blank description associated with it. These descriptions are highlighted and show the description that was entered for the strategy when it was originally created or last updated.



Header—Toggle the display of the top portion of the screen.



Reset—Unselect all of the strategies in the scrollable list. Strategies that were not previously selected with the S line command are not affected.

Maintenance Considerations Consider the following information about maintenance methods: ■

Use USER to keep the maintenance defaults static; changing global defaults has no effect on output rows set to USER maintenance.



When the method is set to USER, and you choose not to apply maintenance in a particular instance, the rows can be set to DISABLE and still retain the original USER settings. The method can then be set back to USER without having to re-enter the defaults.



When the method is set to GLOBAL, the defaults for a strategy are updated to the current global default settings whenever maintenance is applied.



Use DISABLE to disable maintenance for all analyses associated with the strategy and still retain the maintenance criteria established.



NONE displays for strategies that have never had maintenance criteria established for them. If any strategies are never manually set to NONE, the old strategies are distinguishable from the others with which you are working.



If a strategy is manually set to NONE, any defaults (USER or GLOBAL) that had been used for that strategy are discarded and cannot be recaptured.

Chapter 3: Profile 143

Managed Output Maintenance

After the strategy or strategies to which maintenance should be applied has been selected and the maintenance criteria that should be applied has been indicated, the application process can be started by using the A (Apply) line command or the APPLYMaint (Apply Maintenance) primary command. The Managed Output Maintenance Apply screen then appears.

Specifying Maintenance Execution Parameters Use the Managed Output Maintenance Apply screen to indicate preferences for maintenance execution and report generation. The Managed Output Maintenance Apply screen appears when the maintenance application process is begun by using the A (Apply) line command or the APPLYMaint primary command on the Managed Output Maintenance Services screen. The first sentence in the Managed Output Maintenance Apply screen indicates the number of strategies (out of the total number available) being processed. The header fields on the Managed Output Maintenance Apply screen identify the selection criteria used to select the strategy (or strategies) that have been chosen. These fields are for display only. Execution Mode Specify the mode to use for processing. ■

O—Online



B—Batch

Apply Maintenance Specify maintenance preferences. ■

Y—Apply output maintenance.



N—Do not apply any output maintenance.



O—Override. Apply output maintenance (ignoring certain conditions that would otherwise prevent maintenance from being applied) to all analysis output rows for a strategy.

Output Maintenance Report Specify output maintenance report generation.

144 User Guide



Y—Default report. Build the default report. (The summary report is included at the end of this report.)



X—Extra detailed report. Build the most detailed report possible. (The summary report is included at the end of this report.)



D—Delete report. Report on only analysis output rows that are dropped from the system. (The summary report is included at the end of this report.)



S—Summary report only. Generate the summary report only.



N—None. Do not generate any reports.

Managed Output Maintenance

The Audit Options fields at the bottom of the screen are the standard fields used for all Batch Processor input screens.

Apply Maintenance Field Considerations Take the following points into consideration when choosing Apply Maintenance field options. ■

If Apply Maintenance N (No)is chosen, the job will execute, but the maintenance that would otherwise have been applied will not be applied permanently. This option is useful for obtaining reports or executing test runs to see what maintenance would have been applied had the job been executed with this option set to Y (Yes).



If Apply Maintenance O (Override) is chosen, maintenance criteria for incomplete and aborted executions of strategy analysis DDL and recovery analysis DDL are overridden. This option will not override insufficient authorizations, protected analysis rows, or analysis rows or output that are in use by other users.

Important! This option should be used with caution because it lets you override maintenance criteria specifications for incomplete executions that, if deleted, cannot be restarted.

X and L Share Option Considerations Consider the following information about the X and L share options when using managed output maintenance. ■

When maintenance is applied to strategies whose share option is X or L, the maintenance is applied in groups delineated by the IDs of the users who performed analyses on that strategy.



When maintenance is applied to strategies whose share option is X or L, and the user doing the analysis is not the creator of the strategy, only analysis rows that have been created by the user performing the analysis will have maintenance applied to them. All other analysis rows are ignored.

After completing the Managed Output Maintenance Apply screen, press Enter to process. If online processing was requested, the Batch Processor Wait screen displays while the request is in progress and the output displays followed by any requested report. If batch processing was requested, the Batch JCL Specification panel displays so the rest of the information necessary for batch processing can be provided. Note: PARM record specifications are provided in Managed Output Maintenance PARM Records for reference if you need to edit the JCL.

Chapter 3: Profile 145

Managed Output Maintenance

Managed Output Maintenance Reports The Managed Output Maintenance facility provides four reports. Use the Output Maintenance Report field on the Managed Output Maintenance Apply screen to indicate a preference. The Default, Extra Detailed, and Delete reports all include the Summary report. Additionally, all reports can be bypassed. The four reports and their option codes are: ■

Default report (option Y)



Extra Detailed report (option X)



Delete report (option D)



Summary report (option S).

In the following example, the Default and Extra Detailed reports have been run against the same strategy to make it easier to compare the output. The Delete and Summary reports were run against different strategies to point out differences. Note: The report output is grouped by user ID; this indicates the share option assigned to the strategy is X or L.

Default Report The following four screens show the Default report. The Default report can be broken down into the following sections:

146 User Guide



PARM records (shown in screen 1 of 4)



MOM Messages (shown in screen 1 of 4)



Report core (shown in screen 2 of 4)



Summary section (shown in screen 3 of 4)



Batch Processor completion section (shown in screen 4 of 4)

Managed Output Maintenance

These report sections are described after all reports are shown. BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 .LIST SYSOUT(A,,RMT1) RETCODE = 0 .CONNECT D81A RETCODE = 0 .CALL MOM .DATA STRTSSID RETMIN RETMAX RETAGE REPORT SELECT .ENDDATA

D81A 10 30 * YES MAINT1

USER3

MOM001I OUTPUT MAINTENANCE BEGINNING MOM008I MOM009I

1 STRATEGIES HAVE BEEN SELECTED FOR MAINTENANCE PROCESSING 10 ANALYSIS ROWS HAVE BEEN SELECTED FOR MAINTENANCE PROCESSING

MOM019I APPLY INHIBITED VIA OPTIONS - NO MAINTENANCE WILL BE APPLIED PF7/8: Scroll Up/Down

PF3/15: End

Chapter 3: Profile 147

Managed Output Maintenance

Default Report (Screen 2 of 4) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 ============================================================================ = VP512AA CA RC/Migrator OUTPUT MAINTENANCE REPORT 09/01/99 12:16 ============================================================================ +-- STRATEGY ---+ +------- ANALYSIS NAME CREATOR USER DATE -------- -------- -------- -------MAINT1 USER3 USER3 USER3 19990930 USER3 19990915 *** ROWS-> KEPT:2 USER3A USER3A

-------+ TIME ACTION -------- -------LOG INFO LOG INFO 07570753 DELETED 07360400 BYPASSED DELETED:1

COMMENT ---------------* PROCESSING STRATEGY * - PROCESSING GROUP MAX ROW LIMIT PROTECTED BYPASSED:2

LOG INFO - PROCESSING GROUP 19990922 08225882 KEPT DDL EXECUTION

INCOMPLETE *** ROWS-> KEPT:3

DELETED:0

USER3B *** ROWS-> KEPT:2

LOG INFO - PROCESSING GROUP DELETED:0 BYPASSED:0 ***

PF7/8: Scroll Up/Down

BYPASSED:0

***

PF3/15: End

Default Report (Screen 3 of 4) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 +++++++++++++++++++++++++ OUTPUT MAINTENANCE SUMMARY ++++++++++++++++++++++++++ TOTAL STRATEGIES PROCESSED: TOTAL STRATEGIES BYPASSED: TOTAL ANALYSIS ROWS PROCESSED: TOTAL ANALYSIS ROWS KEPT: TOTAL ANALYSIS ROWS DELETED: TOTAL ANALYSIS ROWS BYPASSED: ====================== END OF OUTPUT PF7/8: Scroll Up/Down

148 User Guide

1 0 10 7 1 2 MAINTENANCE REPORT ====================== PF3/15: End

Managed Output Maintenance

Default Report (Screen 4 of 4) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 MOM002I OUTPUT MAINTENANCE COMPLETE RETCODE = 0 CONTROL PROCESS CARD: BATCH PROCESSOR PLAN ===> RBPT030S BATCH PROCESSOR ID ===> (NONE) STRATEGY NAME ===> (NONE) DEVICE ALLOCATION UNIT => SYSDA ***** BATCH PROCESSOR COMPLETE ***** PF7/8: Scroll Up/Down

PF3/15: End

Extra Detailed Report The following four screens show the Extra Detailed report. This report can be broken down into the following sections. ■

PARM records (shown in screen 1 of 4)



MOM Messages (shown in screen 1 of 4)



Report core (shown in screen 2 of 4)



Summary section (shown in screen 3 of 4)



Batch Processor completion section (shown in screen 4 of 4)

These report sections are described after all the reports are shown.

Chapter 3: Profile 149

Managed Output Maintenance

Extra Detailed Report (Screen 1 of 4) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 .LIST SYSOUT(A,,RMT1) RETCODE = 0 .CONNECT D81A RETCODE = 0 .CALL MOM .DATA STRTSSID RETMIN RETMAX RETAGE REPORT SELECT .ENDDATA

D81A 10 30 * XDETAIL MAINT1

USER3

MOM001I OUTPUT MAINTENANCE BEGINNING MOM008I MOM009I

1 STRATEGIES HAVE BEEN SELECTED FOR MAINTENANCE PROCESSING 10 ANALYSIS ROWS HAVE BEEN SELECTED FOR MAINTENANCE PROCESSING

MOM019I APPLY INHIBITED VIA OPTIONS - NO MAINTENANCE WILL BE APPLIED PF7/8: Scroll Up/Down

150 User Guide

PF3/15: End

Managed Output Maintenance

Extra Detailed Report (Screen 2 of 4) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 ============================================================================= = VP512AA CA RC/Migrator OUTPUT MAINTENANCE REPORT 09/01/99 12:18 = ============================================================================= ++++++++++++++++++ OUTPUT MAINTENANCE EXTRA DETAILED REPORT ++++++++++ +-- STRATEGY ---+ +------- ANALYSIS NAME CREATOR USER DATE -------- -------- -------- -------MAINT1 USER3 USER3 USER3 19990913 USER3 19990913 USER3 19990930 USER3 19990919 USER3 19990915 *** ROWS-> KEPT:2 USER3A USER3A USER3A USER3A

-------+ TIME ACTION -------- -------LOG INFO LOG INFO 12143518 KEPT 12091180 KEPT 07570753 DELETED 13265291 BYPASSED 07360400 BYPASSED DELETED:1

LOG INFO 19990913 12114013 KEPT 19990929 11030352 KEPT 19990922 08225882 KEPT

COMMENT ----------------------* PROCESSING STRATEGY * - PROCESSING GROUP MIN ROW REQUIREMENT WITHIN LIMITS MAX ROW LIMIT NO MANAGED OUTPUT PROTECTED BYPASSED:2 *** - PROCESSING GROUP MIN ROW REQUIREMENT WITHIN LIMITS DDL EXECUTION

INCOMPLETE *** ROWS-> KEPT:3

DELETED:0

BYPASSED:0

***

USER3B LOG INFO - PROCESSING GROUP USER3B 19990929 12352609 KEPT MIN ROW REQUIREMENT USER3B 19990929 12334722 KEPT WITHIN LIMITS *** ROWS-> KEPT:2 DELETED:0 BYPASSED:0 *** PF7/8: Scroll Up/Down

PF3/15: End

Chapter 3: Profile 151

Managed Output Maintenance

Extra Detailed Report (Screen 3 of 4) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 +++++++++++++++++++++++++ OUTPUT MAINTENANCE SUMMARY ++++++++++++++++++++++++++ TOTAL STRATEGIES PROCESSED: TOTAL STRATEGIES BYPASSED:

1 0

TOTAL TOTAL TOTAL TOTAL

10 7 1 2

ANALYSIS ANALYSIS ANALYSIS ANALYSIS

ROWS ROWS ROWS ROWS

PROCESSED: KEPT: DELETED: BYPASSED:

====================== END OF OUTPUT MAINTENANCE REPORT =======================

PF7/8: Scroll Up/Down

PF3/15: End

Extra Detailed Report (Screen 4 of 4) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 MOM002I OUTPUT MAINTENANCE COMPLETE RETCODE = 0 CONTROL PROCESS CARD: BATCH PROCESSOR PLAN ===> RBPT030S BATCH PROCESSOR ID ===> (NONE) STRATEGY NAME ===> (NONE) DEVICE ALLOCATION UNIT => SYSDA ***** BATCH PROCESSOR COMPLETE *****

PF7/8: Scroll Up/Down

PF3/15: End

Delete Report The following three screens show the Delete report. This report can be broken down into the following sections.

152 User Guide



PARM records (shown in screen 1 of 3)



MOM Messages (shown in screen 1 of 3)



Report core (shown in screen 2 of 3)

Managed Output Maintenance



Summary section (shown in screen 2 of 3)



Batch Processor completion section (shown in screen 3 of 3)

These report sections are described after all the reports are shown. Delete Report (Screen 1 of 3) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 .LIST SYSOUT(A,,RMT1) RETCODE = 0 .CONNECT D81A RETCODE = 0 .CALL MOM .DATA STRTSSID RETMIN RETMAX RETAGE REPORT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT .ENDDATA

D81A 10 30 * DELETE ALTER1 ITEM#3A ITEM#3A1 MAINT1 MAINT10 MAINT11 MAINT12 MAINT16 MAINT3 MAINT5 MAINT6 MAINT8 MAINT9 P222462E P223201X P243751A P243751T P245258A XXX123

USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3A USER3 USER3 USER3

MOM001I OUTPUT MAINTENANCE BEGINNING MOM008I MOM009I

19 STRATEGIES HAVE BEEN SELECTED FOR MAINTENANCE PROCESS 194 ANALYSIS ROWS HAVE BEEN SELECTED FOR MAINTENANCE PROC

MOM019I APPLY INHIBITED VIA OPTIONS - NO MAINTENANCE WILL BE APPLIED PF7/8: Scroll Up/Down

PF3/15: End

Chapter 3: Profile 153

Managed Output Maintenance

Delete Report (Screen 2 of 3) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 ====================================================================== = VP512AA CA RC/Migrator OUTPUT MAINTENANCE REPORT 09/01/99 12:18 = ====================================================================== ++++++++++++++++++++++ OUTPUT MAINTENANCE DELETE REPORT ++++++++++++++ +-- STRATEGY ---+ NAME CREATOR -------- -------ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3 ITEM#3A USER3

+------USER -------USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3

ANALYSIS DATE -------19990815 19990815 19990815 19990815 19990815 19990815 19990815 19990815 19990815 19990814 19990814 19990814

MAINT1

USER3

19990430 07570753 DELETED

MAX ROW LIMIT

USER3A

19990321 16492178 DELETED

MAX ROW LIMIT

USER3

P243751A USER3A

-------+ TIME -------15035465 14510518 12291761 12192116 12100518 10151454 08304287 08205433 08064687 16464429 11005770 10291147

ACTION -------DELETED DELETED DELETED DELETED DELETED DELETED DELETED DELETED DELETED DELETED DELETED DELETED

COMMENT ---------------MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT MAX AGE LIMIT

+++++++++++++++++++++++++ OUTPUT MAINTENANCE SUMMARY +++++++++++++++++ TOTAL STRATEGIES PROCESSED: TOTAL STRATEGIES BYPASSED:

19 0

TOTAL TOTAL TOTAL TOTAL

194 136 14 44

ANALYSIS ANALYSIS ANALYSIS ANALYSIS

ROWS ROWS ROWS ROWS

PROCESSED: KEPT: DELETED: BYPASSED:

====================== END OF OUTPUT MAINTENANCE REPORT ============== PF7/8: Scroll Up/Down

154 User Guide

PF3/15: End

Managed Output Maintenance

Delete Report (Screen 3 of 3) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 MOM002I OUTPUT MAINTENANCE COMPLETE RETCODE = 0 CONTROL PROCESS CARD: BATCH PROCESSOR PLAN ===> RBPT030S BATCH PROCESSOR ID ===> (NONE) STRATEGY NAME ===> (NONE) DEVICE ALLOCATION UNIT => SYSDA ***** BATCH PROCESSOR COMPLETE ***** **************************** Bottom of Data **************************** PF7/8: Scroll Up/Down

PF3/15: End

Summary Report The following three screens show the Summary report. This report can be broken down into the following sections. ■

PARM records (shown in screen 1 of 3)



MOM messages (shown in screen 1 of 3)



Report core (shown in screen 2 of 3)



Summary section (shown in screen 2 of 3)



Batch Processor completion section (shown in screen 3 of 3)

These report sections are described after all the reports are shown.

Chapter 3: Profile 155

Managed Output Maintenance

Summary Report (Screen 1 of 3) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 .LIST SYSOUT(A,,RMT1) RETCODE = 0 .CONNECT D81A RETCODE = 0 .CALL MOM .DATA STRTSSID RETMIN RETMAX RETAGE REPORT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT .ENDDATA

D81A 10 30 * SUMMARY ALTER1 ITEM#3A ITEM#3A1 MAINT1 MAINT10 MAINT11 MAINT12 MAINT16 MAINT3 MAINT5 MAINT6 MAINT8 MAINT9 P222462E P223201X P243751A P243751T P245258A XXX123

USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3 USER3A USER3 USER3 USER3

MOM001I OUTPUT MAINTENANCE BEGINNING MOM008I MOM009I

19 STRATEGIES HAVE BEEN SELECTED FOR MAINTENANCE PROCESSING 194 ANALYSIS ROWS HAVE BEEN SELECTED FOR MAINTENANCE PROCESSING

MOM019I APPLY INHIBITED VIA OPTIONS - NO MAINTENANCE WILL BE APPLIED PF7/8: Scroll Up/Down

156 User Guide

PF3/15: End

Managed Output Maintenance

Summary Report (Screen 2 of 3) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 ============================================================================= = VP512AA CA RC/Migrator OUTPUT MAINTENANCE REPORT 09/01/99 12:22 = ============================================================================= +++++++++++++++++++++++++ OUTPUT MAINTENANCE SUMMARY ++++++++++++++++++++++++ TOTAL STRATEGIES PROCESSED: TOTAL STRATEGIES BYPASSED:

19 0

TOTAL TOTAL TOTAL TOTAL

194 136 14 44

ANALYSIS ANALYSIS ANALYSIS ANALYSIS

ROWS ROWS ROWS ROWS

PROCESSED: KEPT: DELETED: BYPASSED:

====================== END OF OUTPUT MAINTENANCE REPORT ===================== PF7/8: Scroll Up/Down

PF3/15: End

Summary Report (Screen 3 of 3) BPA.AUDT COMMAND ===>

-------------- AUDIT Message File ------------SCROLL ==> CSR

------------------------------------------------------------- USER ID: USER02 MOM002I OUTPUT MAINTENANCE COMPLETE RETCODE = 0 CONTROL PROCESS CARD: BATCH PROCESSOR PLAN ===> RBPT030S BATCH PROCESSOR ID ===> (NONE) STRATEGY NAME ===> (NONE) DEVICE ALLOCATION UNIT => SYSDA ***** BATCH PROCESSOR COMPLETE ***** **************************** Bottom of Data *********************************** PF7/8: Scroll Up/Down

PF3/15: End

Chapter 3: Profile 157

Managed Output Maintenance

Report Sections The following describes the sections and fields on the Managed Output Maintenance facility reports. ■

PARM Records—Shows the PARM records used to create this maintenance job. All PARM records are shown in Managed Output Maintenance PARM Records.



MOM Messages—Shows various messages pertinent to this maintenance application.



Report Core—Displays the main contents (detailed output maintenance) of the report. Note: This information does not appear in the report when a Summary report is requested.



Summary Section—Provides a summary of the maintenance performed.



Batch Processor Completion Section—Provides standard batch processing information.

Report Fields The following explains the header fields found in the report core section of the reports. Name The name of the strategy against which the maintenance is performed. Creator The user ID of the creator of the strategy. USER The User ID of the user who created the analysis output or performed the analysis. DATE The date on which the analysis was performed. TIME The time at which the analysis was performed.

158 User Guide

Managed Output Maintenance

ACTION Describes the action, if any, that has been taken against the analysis output during maintenance processing. If no maintenance is being applied, this field describes the action that would have occurred had maintenance actually been applied. ■

BYPASSED—The strategy or analysis row has been bypassed and no maintenance was applied.



DELETED—The analysis row has been deleted. All associated analysis output that is managed by CA RC/Migrator has also been deleted.



KEPT—The analysis row has been kept.



LOG INFO—Log information entry. This is a descriptive entry only.



N/A—Not applicable. No action taken. The COMMENT field should contain an explanation or more detailed description.

COMMENT See Report Comments for further information.

Report Comments The following lists the comments that can potentially appear on the Managed Output Maintenance reports. ANALYSIS DDL IS IN USE The strategy analysis output is currently being used by another user. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Try again later when the strategy is not in use. ANALYSIS ROW IS IN USE The analysis row is currently in use by another user. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Try again later when the strategy analysis row is not in use. DDL IS CURRENTLY EXECUTING The strategy analysis output is currently executing. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Try again later when the strategy analysis is not being executed. DDL EXECUTION ABORTED The strategy analysis output aborted during its last execution. This is usually due to a system problem. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Correct the problem or apply maintenance with the Apply Maintenance Override option.

Chapter 3: Profile 159

Managed Output Maintenance

DDL EXECUTION INCOMPLETE The strategy analysis did not complete successfully during its last execution. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Correct the problem or apply maintenance with the Apply Maintenance Override option. GLOBAL CRITERIA UPDATED The strategy's global maintenance criteria has been successfully updated to correspond with the current global default settings. This appears on the Detail Report only. INSUFFICIENT AUTH Sufficient authorization to apply maintenance to the strategy or the current analysis row is not held. Maintenance is aborted on the strategy. No maintenance is applied. MAINTENANCE IS DISABLED The strategy is being bypassed because maintenance is disabled for the strategy. No maintenance is applied. MAX AGE LIMIT The analysis row is being deleted because its age exceeds the specified age limit criteria for this strategy. MAX ROW LIMIT The analysis row is being deleted because the maximum number of rows to be maintained for the strategy has already been satisfied. MIN ROW REQUIREMENT The analysis row is being kept because, although it exceeds the specified age limit, the specified minimum row requirement criteria for this strategy prevents it from being deleted. This appears on the Detail Report only. NO LIMITS The maintenance criteria for this strategy contains * (asterisk) for all criteria fields. All rows will always be kept. NO MAINTENANCE CRITERIA The strategy is being bypassed because it contains no maintenance criteria. No maintenance is applied.

160 User Guide

Managed Output Maintenance

NO MANAGED OUTPUT The analysis row contains no associated output managed by CA RC/Migrator for strategy analysis or for snapshot recovery analysis (only data set output was found). The row is bypassed and output maintenance continues with the next row. This row is not included in any of the calculations used to determine how maintenance is to be applied to previous or subsequent rows. The row is essentially ignored. This appears on the Detail Report only. PROCESSING GROUP (Informational) Processing of a new group has been started under the current strategy. This is only applicable to strategies with a share option of X or L. PROCESSING STRATEGY (Informational) Processing of a new strategy has been started. RECOVERY DDL IS IN USE The snapshot recovery analysis output is currently in use. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Try again later when the snapshot recovery analysis is not in use. RCVR CURRENTLY EXECUTING The snapshot recovery analysis output is currently executing. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Try again later when the snapshot recovery analysis is not being executed. RCVR EXECUTION ABORTED The snapshot recovery analysis output aborted during its last execution. This is usually due to a system problem. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Correct the problem or apply maintenance with the Apply Maintenance Override option. RCVR EXEC INCOMPLETE The snapshot recovery analysis output did not complete successfully during its last execution. All maintenance (if any) up to this point has been applied. Maintenance is aborted for the remainder of the strategy. Correct the problem or apply maintenance with the Apply Maintenance Override option.

Chapter 3: Profile 161

Managed Output Maintenance

PROTECTED The analysis row is protected. The row is bypassed and output maintenance continues with the next row. The protected row is not included in any of the calculations used to determine how maintenance is to be applied to previous or subsequent rows. The row is essentially ignored. SHARE OPTION X/L The analysis row is being bypassed because the strategy's share option is X or L and you are not the creator of the strategy or the user who performed the analysis. This appears on the Detail Report only. STRATEGY NOT FOUND The specified strategy could not be found or no longer exists. STRATEGY ROW IS IN USE The strategy row is currently in use. No maintenance is applied to this strategy. Try again later when the strategy row is not in use. WITHIN LIMITS The analysis row is being kept because it falls within the maintenance criteria for its parent strategy. This appears on the Detail Report only.

Managed Output Maintenance PARM Records The following table describes the PARM records used by the Managed Output Maintenance facility:

Keyword

Parameter

Description

STRTSSID (Required)

ssid (1-4 characters)

Strategy subsystem ID. Specifies the ID of the system on which output maintenance is performed.

RETMIN (Required)

nnnnn (0-99999 or *)

Retention minimum. Specifies the minimum number of analysis rows to keep. nnnnn must be less than or equal to the value specified for RETMAX. 0-99999—Indicates the minimum number of rows. *—Indicates there is no minimum.

162 User Guide

Managed Output Maintenance

Keyword

Parameter

Description

RETMAX (Required)

nnnnn (1-99999 or *)

Retention maximum. Specifies the maximum number of analysis rows to keep. nnnnn must be greater than or equal to the value specified for RETMIN. 1-99999—Indicates the maximum number of rows. *—Indicates there is no maximum.

RETAGE (Required)

nnnnn (1-99999 or *)

Retention age. Specifies the maximum number of days analysis rows should be kept. nnnnn is subject to the value specified for RETMIN. 1-99999—Indicates the maximum age in days. *—Indicates there is no maximum age.

APPLY (Optional)

option (YES, OVERRIDE, or blank)

Apply option. Specifies whether output maintenance should be applied to the strategies selected with the SELECT keyword. Output maintenance is not applied if this PARM record is omitted. YES—Apply output maintenance to selected strategies. OVERRIDE—Apply maintenance to selected strategies including analysis rows whose DDL has not executed successfully and are flagged as INCOMPLETE or ABORTED in the Batch Processor log. This option does not affect rows flagged as PROTECTED or rows whose DDL is currently executing or in use. (blank)—Defaults to YES.

Chapter 3: Profile 163

Managed Output Maintenance

Keyword

Parameter

Description

REPORT (Optional)

option (YES, XDETAIL, DELETE, SUMMARY, NONE, or NO)

Report option. Specifies the type of report to build for the maintenance applied. No report is built when this card is omitted. (blank)—Defaults to YES. YES—Standard (default) report. XDETAIL—Detail report. DELETE—Delete report. SUMMARY—Summary report only. NONE or NO—Bypass all reports.

SELECT (Required)

sssssss ccccccc x y zzzz (strategy, creator, type, share option, SSID)

Selected strategy. Specifies the strategy selected for maintenance. Multiple records (cards) and selection criteria are supported. sssssss—(Required) Name of the strategy selected. ccccccc—(Required) ID of the creator of the strategy. x—(Optional) Type of strategy selected. Valid values are as follows: A, C, I, M, Q, *, %, _, or a space. y—(Optional) Share option of the strategy selected. Valid values are as follows: N, Y, U, X, L, *, %, _, or a space. zzzz—(Optional) SRCSSID of the strategy selected.

164 User Guide

Chapter 4: Expert Profile This section contains the following topics: Access the Expert Profile Menu (see page 165) Utility Model Services (see page 166) Model Services Frequently Asked Questions (see page 199) Copy Group Services (see page 203) Catalog PDS Unload (see page 208) Importing ICL (see page 211)

Access the Expert Profile Menu Using the expert profile options, you can specify values for utility model services, copy group services, catalog PDS unload, and import ICL. To access the Expert Profile menu 1.

Select the Profile option from the Main Menu or enter PROFILE in any command line. Assuming appropriate user authorizations have been established, the Expert Profile menu appears. Note: For more information about establishing the appropriate user authorizations, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

2.

Select an option from this screen by entering the option's corresponding number in the Option field. Options 1-5 and M are described in the “Profile” chapter.

Chapter 4: Expert Profile 165

Utility Model Services

Utility Model Services Model IDs are used to generate Batch Processor statements for utilities. These model IDs contain symbolic variables. Using Utility Model Services, you can: ■

Change the values of these symbols.



Create new model IDs to routinely perform the following tasks:





Allocate disk space proportionately based on object size.



Allocate files to disk or tape, depending on the size of the object.



Use a third party utility to perform a function. For example, the primary choice of CA Rapid Reorg can be substituted for a third party alternative.



Specify various utility options.

Alter the contents of the models, and thereby automatically include customized changes.

Note: Model JCL is used to prepare JCL for batch execution. The model JCL member names begin with MJ and reside in highlvl.MODEL. These members are not used by the Batch Processor. If the generated Batch Processor statements meet your needs, there is no need to use Utility Model Services. Utility Model Services should only be used when there is a need to automatically customize the output. Batch Processor, CA RC/Migrator, and RC/Alter are completely functional without making changes through Utility Model Services.

Model IDs Model IDs are created, updated, and deleted through the Utility Model Services option. Model IDs are selected from the Analysis Options panel. Note: For more information about how to specify models, see the “Analysis” chapter. Model IDs allow the specification of a set of utility names, and to generate Batch Processor statements for those utilities. (Model JCL members, such as member MJBPMFL, used by the Batch Processor, are not included in model IDs.) Model IDs can be browsed, templated, updated, or deleted. Default model IDs are provided, and can be customized. Multiple model IDs can exist for a single site. Each model ID also contains replacement values for any userdefined symbolic variables. Note: When a new version is installed, it optionally updates the @DEFAULT model ID. It does not change any user model libraries.

166 User Guide

Utility Model Services

Default Model ID @DEFAULT is the default model ID. This model ID works without changes and can be used as a template for new model IDs. A list of model utility names referenced by the @DEFAULT model ID is provided in Utilities Referenced by @DEFAULT. Note: We recommend keeping an unchanged version of the @DEFAULT model for every release with SHARE OPTION Y so it cannot be modified. You can compare this version to the previous release version to identify changes that have been made. If you have a previously customized version of this model that you want to maintain, you can then apply the differences to the customized model to bring it up to date with the new release.

How You Can Identify @DEFAULT Model Changes If you upgrade to a new release and have a previously customized version of the @DEFAULT model that you want to maintain, you can use the following process to identify changes that have been made to the @DEFAULT model in the new release and apply the differences to your customized model to bring it up to date with the new release without manually comparing every utility in the new model. Note: This process assumes you have executed the RCM Load and Customize the Model Services task to load and refresh the model services table for the new release. For more information, see the CA Database Management Solutions for DB2 for z/OS Implementation Guide. The following steps describe how to identify changes between the new and previous release's @DEFAULT model: 1.

Always keep an unchanged version of the @DEFAULT model for every release you install with SHARE OPTION Y so it cannot be modified.

2.

Use the SYMBOLS command in the @DEFAULT model from the new release to generate a display of all symbolic variables and sample syntax for every utility in the model.

3.

Use the QFILE command to write the SYMBOLS display to a data set.

4.

Use the SYMBOLS command in the @DEFAULT model from the previous release and use the QFILE command to write the SYMBOLS display to a second data set.

5.

Do an ISPF 3.13 SuperCE comparing the QFILES data sets to identify differences between the new and previous release @DEFAULT models.

6.

Apply the differences to your customized model to bring it up to date with the new release.

Chapter 4: Expert Profile 167

Utility Model Services

Utility Model Services Privilege You must be authorized through the Product Authorizations facility to use the Utility Model Services option. Note: For information about using the Product Authorizations facility, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Maintain General Model Services You can maintain general model services as described in this section. To maintain general model services 1.

Select Utility Model Services from the profile screen, and press Enter. The General Model Services screen appears. The header information displays the following information about the model IDs. All fields can be updated to change the model IDs listed.

2.

3.

Enter one of the following line commands in the CMD field: ■

B—Browse the model ID. The model ID displays, but changes are not saved. The S (Symbols) and B (Browse) line commands can be used.



T—Template (create) the model ID. To create a new model ID, an existing model ID is copied, assigned a new name, and edited.



U—Update an existing model ID.



D—Delete a model ID.

Press Enter. The General Model Utilities screen appears, where you can create or update model IDs.

Note: If you specified the D command, the model ID is deleted, and the General Model Utilities screen does not appear. You can only delete model IDs that you created or for which you have a shared option value of U.

168 User Guide

Utility Model Services

Create Model IDs You can create a model ID as described in this section. To create model IDs 1.

On the General Model Services screen, use the T (template) line command to template an existing model ID. The General Model Utilities screen appears.

2.

On the General Model Utilities screen, specify the following information about the model ID.

3.



Enter a new name and description on the General Model Utilities screen.



Add or delete the utilities in the model ID.



Specify the source of space statistics (optional).



Specify symbolic variable information (optional).

Press PF3 (End) to save the model ID.

Update Model IDs You can update an existing model ID as described in this section To update existing model IDs 1.

On the General Model Services screen, use the U (update) line command next to the model ID to update. The General Model Utilities screen displays.

2.

Make any necessary changes.

3.

Press PF3 (End) to return to the General Model Services screen.

Maintaining Model IDs You specify information about the model ID—including the Model ID name, creator, description, and share option—and the utilities you want included in the model ID on the General Model Utilities screen. You can enter the SYMBOLS command to display the symbolic variables for all the utilities. The General Model Symbols screen appears.

Chapter 4: Expert Profile 169

Utility Model Services

The header information displays the following information about the model IDs. All fields can be updated to change the model IDs listed. MODEL ID The model ID name. If templating a model ID, a new name must be entered. CREATOR The model ID creator ID. This field is not updateable. DESCRIPTION The model ID description. If templating a model ID, the default description is Template of oldmodel, where oldmodel is the old model ID name. SHAREOPTION The Share Option. Valid values are as follows: ■

Y—Others can use the model ID, but only its creator can update it.



U—Others can use and update the model ID.



N—Only the creator can use the model ID.

SSID The DB2 subsystem where the model ID is stored. This will also be the subsystem where the alteration or batch copy takes place, and where the strategy is stored. SYM Indication of whether the model utility contains symbolic variables, and if so, what type. Valid values are as follows:

170 User Guide



N—No symbols. The model utility does not contain any symbolic variables.



D—(Default) The model utility contains only default (automatic) symbolic variables.



Y—User Symbolics. The utility references user-defined symbolic variables.



I—Invalid. An error occurred during substitution. The model utility or the symbolic itself could be in error.



X—Excluded. This optional utility will not be used for analysis.

Utility Model Services

UTILITY The Utility name. OB The object type. Valid values are as follows: ■

SG—Storage Group



DB—Database



TS—Tablespace



T—Table



I—Index



V—View



A—Alias



S—Synonym



P—Plan

DESCRIPTION A description of the utility. SIZE Designation of the source that should be used for space statistics. Valid values are as follows: ■

P—CA Database Analyzer statistics. CA Database Analyzer must be installed on the specified subsystem.



R—RUNSTATS.



I—IDCAMS.

The default order is RPI. For users with CA Database Analyzer, we recommend you specify PRI for the search order. Note: If you have CA Database Analyzer installed but are not actively using it, remove the P option. LAST UPDATE Information ID of the user who last updated the line, and the date and time of the last update.

Chapter 4: Expert Profile 171

Utility Model Services

CMD Use the following line commands to maintain third party utility model JCL. ■

I—Insert a blank line. This enables users to add their own utility model to the model ID.



D—Delete a line. This deletes the utility from the model ID. It does not delete the actual utility. Not valid for utilities defined by CA.



R—Repeat a line. This option makes it easy to create a new line based on a current line.



X—Exclude/Unexclude. This option functions as a toggle. When a model utility is excluded, it will not be used during analysis to generate utility jobs.



S—Symbols. This option displays the Model Symbolics screen, which enables users to update the symbolic variables. The SYMBOLS command can also be used to list the symbolics for all utilities.



B—Browse the model utility.



E—Edit the model utility. Valid only for those that reside in the user library.

More information: Model Symbols Screen (see page 187)

Excluding Utilities The General Model Utilities screen can be used to exclude any utility, but certain combinations of exclusions are prohibited as follows: ■

172 User Guide

The following pairs of utilities cannot be excluded: –

CA Fast Unload (FUNLD) and Unload Table (UNLOAD)



CA Fast Unload - Recovery (FUNLD_R) and Unload Table - Recovery (UNLOAD_R)



CA Fast Load (FLOAD) and Load Table (LOAD)



CA Fast Load - Recovery (FLOAD_R) and Load Table - Recovery (LOAD_R)



If CA Fast Load (FLOAD) is used, CA Fast Unload (FUNLD) must also be used.



If neither IBM Reorg (REORG) nor CA Rapid Reorg (RREORG) are excluded, CA Rapid Reorg is used in the analysis.



If neither IBM Image Copy (COPY) nor CA Quick Copy (QCOPY) are excluded, CA Quick Copy is used in the analysis.

Utility Model Services

For any of the previously listed paired utilities, if both programs in the pair are excluded, a message is issued that no utilities are included, but the analysis completes successfully. The message also appears if one of the non-paired utilities is excluded. When an index reorganization is generated, the sequence for determining which unexcluded utility to use is: ■

CA Rapid Reorg if an index (RREORGI)



IBM REORG of an index (REORGI)



CA Rapid Reorg (RREORG)



IBM REORG (REORG)

When a tablespace reorganization is generated, the sequence for determining which unexcluded utility to use is: ■

CA Rapid Reorg (RREORG)



IBM REORG (REORG)

If all four utilities are excluded, a message is issued that no utilities are included, but the analysis completes successfully.

Example Model Utility An example of model utility LOAD can be found in the General Model Symbols screen. This is the utility referenced by @DEFAULT to load tables.

Utility Information The utility name (Load), object type (Table), description (Load Table), and size source (PRI) are displayed at the beginning of the utility example in the General Model Symbols screen.

Column Headings The following columns are displayed on the General Model Symbols screen below the utility information. CMD Command field. From the Model Symbols screen, lines can be inserted, repeated, and deleted. SYMBOL Symbolic variable names, in alphabetical order.

Chapter 4: Expert Profile 173

Utility Model Services

ERR Error. This field displays a value if an error is flagged for the symbolic. REPLACEMENT VALUE The value of the symbolic variable can be specified. For automatic symbolics, AUTOMATIC VARIABLE displays.

Symbols Area The symbols areas of the General Model Symbols screen are described below. %CALC %CALC tells the Space Symbol Processor that an arithmetic formula follows. The value of DISCSP1 is calculated using an equation that incorporates the value of the automatic variables %ROWLEN, %NROWS, and %BYTETRK. Automatic Variables Automatic symbolic variables are displayed after the user-defined symbols. Automatic symbolics are not displayed unless you use the AUTOSYMS command. #CM #CM is a comment in the model utility that will not be put into the generated JCL. Batch Processor Statements These are actual Batch Processor statements. The first line instructs the Batch Processor to call the load utility using the value of %TOSSID as the parameter. This is the same as issuing the command LOAD(value of TOSSID). More information: %CALC Function (see page 189)

Conditional Logic Model utilities can contain conditional logic (IF, ELSEIF, ELSE, ENDIF). Therefore, a single model utility can be used to generate different Batch Processor and utility control statements based on the conditions being checked. The sample LOAD utility has an IF keyword that compares the value of the automatic symbolic variable REORGP to the user symbolic variable LARGE. If the value of REORGP is greater than the value of LARGE, the input data set from the UNLOAD utility is on tape; otherwise, it is on DASD.

174 User Guide

Utility Model Services

Syntax Rules The following syntax rules apply: ■

A # must precede each keyword (IF, ELSEIF, ELSE, and ENDIF).



Symbolic tests and conditional logic must be contained within parentheses.



No blanks can be placed between keywords and conditional tests. #IF(%SQLPOSA) is valid #IF (%SQLPOSA) is invalid



All automatic and conditional symbolics must be prefixed with %.



An operator must be separated from its operands by commas: (operand,operator,operand)



The following conditional compare symbols can be used.

Symbol

Meaning

= or EQ

Equal

< or LT

Less than

> or GT

Greater than

¬= or NE

Not equal



The following statements are valid: #IF(%SQLPOSA) #IF(%REORGP,

SCROLL ===> PAGE

MODEL ID ===> @DEFAULT DESCRIPTION ===> CUSTOM SYBSYSTEM DEFAULTS CREATOR ===> RP99AIBM SSID ===> D81A ---------------------------------------------------------------------- USER02 ********************************* TOP OF DATA ********************************* UTILITY OBJ DESCRIPTIONC SIZE COPY TS IMAGE COPY RPI CMD _ _ _ _ _ _ _ _ _ _

SYMBOL COPYDSN COPYDUNT COPYDVOL COPYSP1 COPYSP2 COPYSP3 COPYTUNT DATACLAS DISK DSN

ERR

REPLACEMENT VALUE %DSN..COPY______________________________________________ %DISK___________________________________________________ ________________________________________________________ %CALC(%REORGP*050/100+1)________________________________ %CALC(%REORGP*030/100+1)________________________________ BLK(4096)_______________________________________________ %TAPE___________________________________________________ ________________________________________________________ SYSDA___________________________________________________ %USERID..%DSNQUAL2..%DSNQUAL3___________________________

CMD: I=Insert, R=Repeat, D=Delete

PF7/8

: Scroll Up/Down

The symbol information fields are: CMD Enter one of these line commands to insert, repeat, or delete a line. ■

I—Insert a line.



R—Repeat a line.



D—Delete a line.

SYMBOL The symbolic variable name, displayed in alphabetical order. Automatic symbolics are not displayed unless the AUTOSYMS command is used.

Chapter 4: Expert Profile 187

Utility Model Services

ERR Error. This field displays a value if an error is flagged for the symbolic. ■

N—Name. The symbolic name is invalid.



V—Value. The symbolic replacement value is invalid.



M—Missing. A symbolic is used within the model, but is not defined for the model.



X—Extra. The symbolic is defined for the model, but is not used. This flag is informational only and does not indicate an error.



R—Recursive. The symbolic uses itself as part of its definition.

REPLACEMENT VALUE Specify the value of the symbolic variable as needed. In this example, SYSDA has replaced the DISK symbolic. For automatic symbolics, AUTOMATIC VARIABLE displays. ANALYSIS MODEL The model name and model text. Use the PF7 and PF8 (up and down) keys to scroll the symbolics list and analysis model text. Press Enter on the General Model Utilities screen with no line commands. This will perform a model substitution, and the changes are saved. Once a value has been specified for all user-defined symbolics, press PF3 (End) to return to the General Model Utilities screen. More information: Maintaining Model IDs (see page 169)

Automatic Symbolics Automatic symbolics are not displayed on the General Model Symbols screen. To display a list of automatic symbolics, enter the AUTOSYMS (AS) command in the command line. A list of automatic symbolics is placed after the list of user symbolics. To toggle off the automatic symbolics display, use the AUTOSYMS command.

188 User Guide

Utility Model Services

Edit the Model Utility Text You can display model utility in an edit session from the General Model Utilities screen. To edit the model utility text 1.

Enter an E next to the model utility to edit.

2.

Perform one of the following: ■

Use the CANCEL command to return to the General Model Utilities screen without saving changes.



Press PF3 (End) to save the changes and return to the General Model Utilities screen.

%CALC Function You can use the %CALC function to calculate values based on the formula given. Values in the formula can be numeric literals or references to user or automatic symbolic variables that have numeric values. The %CALC function is commonly used on model utility definitions to calculate utility data set space requirements based on automatic symbolic variables. More information: Symbols Area (see page 174)

%CALC Syntax Rules Math is performed from left to right, and operations within parentheses are performed first. Examples are as follows: (10+5*10) = 150 (10+(5*10)) = 60

Available operators are as follows: ( Serves as the left delimiter. + Indicates addition. Indicates subtraction. * Indicates multiplication.

Chapter 4: Expert Profile 189

Utility Model Services

/ Indicates division. ) Serves as the right delimiter. The following rules apply: ■

All equations must begin with a left delimiter and end with a right delimiter.



All equations must have a matching number of left and right delimiters. The equation (10+10(5*4)) is valid. The equation (10+10(5*4) is invalid.



All numbers must be integers from 0 to 999999. Leading zeros are allowed.



Blanks are not allowed. The equation (10+10) is valid. The equation (10 + 10) is invalid.



In division, all remainders are dropped.

%SUBSTR Function When you edit a model utility from the General Model Symbols screen, you can derive substrings of symbolics by using the %SUBSTR function. %SUBSTR has three operands: start, length, and value. The following conditions apply when using substrings. ■

The operands can contain symbolics, calculations, or literals.



If the start operand has a value of 0, it is changed to 1.



The %SUBSTR( ) function is terminated when the closing parenthesis or a blank is found.



The value after all other substitutions has a maximum length of 128 bytes. The resulting value has its trailing blanks removed.

Utilities Referenced by @DEFAULT The following table lists utilities referenced by the @DEFAULT model ID:

190 User Guide

Utility

Definition

BIND

BIND Control Statements

CHECK

IBM Check Data Utility Control Statements

CHECK_R

IBM Check Data Utility Control Statements with Recovery

Utility Model Services

Utility

Definition

COPY

IBM Image Copy Utility Control Statements

COPY_PC

IBM Image Copy Utility Control Statements Generated Pre-SQL (example of optional user utility)

COPY_R

IBM Image Copy Utility Control Statements with Recovery

FCHECK

CA Fast Check Data Utility Control Statements

FLOAD

CA Fast Load Control Statements

FLOAD_R

CA Fast Load Control Statement with Recovery

FRECIXAL

CA Fast Recovery Index All

FRECOVIX

CA Fast Recovery Index

FUNLD

CA Fast Unload Control Statements

FUNLD_R

CA Fast Unload Control Statements with Recovery

LOAD

IBM Load Utility Control Statements

LOAD_R

IBM Load Utility Control Statements with Recovery

PDASTATS

CA Database Analyzer Statistics Collection

QCOPY

CA Quick Copy Utility Control Statements

QCOPY_R

CA Quick Copy Utility Control Statements with Recovery

REBIND

REBIND Control Statements

RECIXALL

Recover Index All

RECOVIX

IBM Recover Index Utility Control Statements

REORG

IBM Reorg Utility Control for Tablespaces

REORG_R

IBM Reorg Utility Control for Tablespaces with Recovery

REORGI

IBM Reorg Utility Control Statements for Indexes

REORGI_R

IBM Reorg Utility Control Statements for Indexes with Recovery

RREORG

CA Rapid Reorg Control Statements for Tablespaces

RREORG_R

CA Rapid Reorg Control Statements for Tablespaces with Recovery

RREORGI

CA Rapid Reorg Control Statements for Indexes

RREORGI_R

CA Rapid Reorg Control Statements for Indexes with Recovery

RUNSTATS

IBM RUNSTATS Utility Control Statements

UNLOAD

Batch Processor Unload Control Statements

Chapter 4: Expert Profile 191

Utility Model Services

Utility

Definition

UNLOAD_R

Batch Processor Unload with Recovery

XUNLD

Excluded Optional CA Internal Unload Model Note: This utility is used automatically by unload processing when CA Fast Unload has been selected, but it does not support a data type conversion being requested in the unload. A Batch Processor unload is done, and the output is written in a format that CA Fast Load can use to load the table.

XUNLD_R

Excluded Optional CA Internal Unload Model with Recovery Note: This utility is used automatically by unload processing when CA Fast Unload has been selected, but it does not support a data type conversion being requested in the unload. A Batch Processor unload is done, and the output is written in a format that CA Fast Load can use to load the table.

Model Utility Control Statements The utility control statements are basic default utility models. They can be customized to create your site's standards. Note: For information about the IBM utility syntax, see the IBM DB2 Command and Utility Reference. For information about CA utility syntax, see the utility user guides. For example, you could make a change to the SORTWK allocation for the IBM LOAD processing. There are two methods of allocating SORTWKs; one is to use dynamic allocations (this is the default), and the other is to use SORTWK DDs in the JCL.

Dynamic Allocation Processing Currently, the LOAD, CHECK, and REORG models are defined using SORTDEVT, which causes the load utility to dynamically allocate SORTWKs. The amount of SORTWKs is determined by the SORTNUM parameter, which defaults to 0. The value of 0 tells the SORT package to use the SORT default allocations. At most sites, these allocations are small, and cannot handle LOAD processing with large numbers of records. This can cause the LOAD to fail with ABENDSB37, or insufficient core storage abends. These abends can be alleviated by increasing the SORTNUM value in the LOAD control cards. The SORTNUM value is a symbolic variable that can be updated using Model Services.

192 User Guide

Utility Model Services

To change the SORTNUM value: 1.

Access the Model Services screen using the Profile option.

2.

You can edit utilities only in a model you have the authority to update. If the @DEFAULT model has been in use, it must be templated before a new model ID can be added. ■

Enter T (for template) next to @DEFAULT.



Provide a new model ID for the templated model.

3.

Edit the symbolics in the load utility. Enter S in the CMD field next to the load utility. The General Model Symbols screen appears, displaying the symbolics for the load utility.

4.

Change the replacement value for SORTNUM to a value from 0 to 9. This tells the number of temporary data sets to be dynamically allocated.

5.

At analysis time, specify Y for Update Options, and specify the newly templated model to be used for analysis processing. The analysis output will now have LOAD Utility Control Cards that include the SORTNUM parameter.

SORTWK DD JCL Allocations The second method of allocating SORTWKs is to update the model, delete the SORTDEVT value, and define SORTWK DDs in the model JCL. This causes the SORT package to use the specified SORTWK DDs defined in the execution JCL, and not to use dynamic allocations. To define SORTWK DDs in the model JCL: 1.

Edit the model JCL. The member to edit is called MJBPMDL in highlvl.MODEL. Add applicable SORTWK DDs according to the standards at your site.

2.

Access the Model Services screen using the Profile option.

3.

Utility models can only be edited in a model ID for which authority is held. If you have been using the @DEFAULT model, it must be templated before adding a new model ID. ■

Enter T (for template) next to @DEFAULT.



Provide a new model ID for the templated model.

4.

Edit the utility model and delete the SORTDEVT %SORTDEVT reference.

5.

At analysis time, enter Y for Update Options, and specify the newly templated model to be used for analysis processing. The analysis output will now have LOAD Utility control cards without the SORTDEVT variable. When the JCL is generated to run the output, the appropriate SORTWK DDs are added because of the edits to the model JCL.

Chapter 4: Expert Profile 193

Utility Model Services

Important Considerations Many other changes similar to these can be made in any of the utility models for CA or other vendors' utilities. Remember the following important points: ■

You must template and create your own model when changing symbolics. Only the owner of @DEFAULT can update this model ID. This model ID also gets reinstalled with each new release, and any changes are lost.



At analysis time, specify that you want to use the model ID.

The current DB2 SSID is now displayed on all CA RC/Migrator screens where appropriate. This lets you know the subsystem being accessed.

Model Utilities Work Data Sets All CA and IBM utilities require special data sets for the various phases of their processing. The data sets are the same as those required for a stand-alone utility execution, but there are two differences. ■

When executed through the CA Batch Processor, dynamic allocations are used (that is, .ALLOC FI(DDNAME) instead of //DDNAME DD....).



There are optional keywords that allow the default data set names to be different.

Utility Data Sets The following table shows how the DDs correspond to each of the utilities:

DDNAME

Used By

Utility Name

PTIOUT=SORTOUT

IBM Check Data

CHECK CHECK_R

IBM Load

LOAD LOAD_R

IBM Reorg

REORG REORGI

CA Fast Load

FLOAD FLOAD_R

CA Rapid Reorg

RREORG RREORGI

IBM Check Data

CHEC CHECK_R

IBM Load

LOAD LOAD_R

PTIUT1=SYSUT1

194 User Guide

Utility Model Services

DDNAME

Used By

Utility Name

IBM Reorg

REORG REORGI

IBM Recover Index

RECOVIX

CA Fast Load

FLOAD FLOAD_R*

CA Rapid Reorg

RREORG RREORGI

IBM Check Data

CHECK CHECK_R

IBM Load

LOAD LOAD_R

CA Fast Load

FLOAD FLOAD_R

CA Rapid Reorg

RREORG RREORGI

IBM Load

LOAD LOAD_R

CA Fast Load

FLOAD FLOAD_R*

IBM Load

LOAD LOAD_R

CA Fast Load

FLOAD FLOAD_R*

IBM Copy

COPY COPY_R COPY_PC

CA Quick Copy

QCOPY COPY_R

PTILOAD=SYSREC

IBM Load

LOAD LOAD_R

ROUNLDDN=SYSREC

IBM Reorg

REORG REORGI

PTIREC=SYSREC

CA Fast Load

FLOAD FLOAD_R*

RRUNLD=SYSREC

CA Rapid Reorg

RREORG RREORGI

SYSREC01=SYSREC

CA Fast Unload

FUNLD FUNLD_R

SYSERR=SYSERR

SYSDISC=SYSDISC

SYSMAP=SYSMAP

SYSCOPY=SYSCOPY

Chapter 4: Expert Profile 195

Utility Model Services

* These DD Statements are not allocated for BUILD-type Fast Loads Data set names for CA utilities and their correlation to the IBM utility data set names are further documented in the user guide for each utility.

Model Utility Data Set Calculations The space needed for utility data sets is calculated using the %CALC function. To perform space calculations, the following symbolics are used: ■

%REORGP



%ROSORT



%ROSYSREC



%ROSYSUT1



%ROSORTWK



%NROWS



%ROWLEN



%BYTETRK

For the specific calculation used for a data set, use Model Services to review the symbolic replacement value for the symbolic. Note: For %CALC syntax rules, see %CALC Function. The following table lists DDs used for the allocation type, primary allocation, and secondary allocations for the utility data sets:

DD

Use

SYSERR

ERRSP1 = Primary Allocation ERRSP2 = Secondary Allocation ERRSP3 = BLK(4096) allocations for IBM utilities and hard coded value of TRACKS for CA utilities.

PTIOUT

OUTSP1 = Primary Allocation OUTSP2 = Secondary Allocation OUTSP3 = CYL

PTIUTI

UT1SP1 = Primary Allocation UT1SP2 = Secondary Allocation UT1SP3 = CYL

196 User Guide

Utility Model Services

DD

Use

PTIREC

RECSP1 = Primary Allocation RECSP2 = Secondary Allocation

SYSDISC

DISCSP1 = Primary Allocation DISCSP2 = Secondary Allocation DISCSP3 = Tracks

SYSMAP

MAPSP1 = Primary Allocation MAPSP2 = Secondary Allocation MAPSP3 = BLK(4096) for IBM utilities and hard-coded value of TRACKS for CA utilities

COPYSP1

COPYSP1 = Primary Allocation COPYSP2 = Secondary Allocation COPYSP3 = BLK(4096)

RRUNLD RRUNLDDN

ROSP1 = Primary Allocation ROSP2 = Secondary Allocation ROSP3 = CYL

SYSREC01

ALLOC1 = Primary Allocation ALLOC2 = Secondary Allocation

Model Utility Partition Level Support The COPY and REORG models support processing per partition level. You can optionally use the #SEG and #ENDSEG keywords to help ensure that the copy model utility partition level processing better supports user customizations. Note: The #SEG and #ENDSEG keywords are required when processing partitioned tablespaces or when using %TINCR for a COPY or REORG model. If the keywords are omitted when using %TINCR for one of these models, %TINCR will not increase for each object.

Chapter 4: Expert Profile 197

Utility Model Services

The #SEG and #ENDSEG keywords should surround each statement that would be repeated for each partition in the tablespace or index (.ALLOC, COPY, and .FREE). The #SEG command must precede the statement and the #ENDSEG must proceed the statement. Important! Allocation of multiple tape labels within a single utility call will result in a failure to allocate the second data set and subsequent data sets. .CALL UTIL COPY PARM(%TOSSID) #SEG .ALLOC FI(%SYSCOPY) + #IF(%PART,EQ,ALL) DA('%COPYDSN') + #ELSE DA('%PARTDSN') + #ENDIF #IF(%REORGP,

---------- RC/M Dependent Object Mapping --------SCROLL ===> CSR

STRATEGY ===> COMP CREATOR ===> USER7 --------------------------------------------------------------------- USER7 SOURCE SSID ===> PTI2 | TARGET SSID ===> PTI2 DATABASE ===> ATEST > | DATABASE ===> APROD > CREATOR ===> USER5 > | CREATOR ===> A0625SC > | S OBJ# TP NAME CREATOR | MAP# C TP NAME CREATOR _ 11 T TEST3 USER5 | _ 12 S TEST3_S USER5 | _ 13 A TEST3_A USER5 | _ 14 I TEST3_I USER5 | _ 15 V1 TEST3_V USER5 | _ 16 S TEST3_S2 USER5 | _ 17 A TEST3_A2 USER5 | _ 18 V2 TEST3_V2 USER5 | _ 19 T TEST4 USER5 | 19 T PROD4 USER5 _ 20 S TEST4_S USER5 | 20 S PROD4_S USER5 _ 21 A TEST4_A USER5 | 21 A PROD4_A USER5 Valid S Commands: E, R, U, C, Z (S or X) Valid MAP# Commands: OBJ# Press ENTER to process command Press END to go back

In this example, the table TEST4 is mapped to PROD4; synonym TEST4_S is mapped to PROD4_S; and alias TEST4_A is mapped to PROD4A. The masks entered on the Automapping screen were as follows. TABLE NAME TABLE CREATOR INDEX NAME INDEX CREATOR VIEW NAME VIEW CREATOR SYNONYM NAME SYNONYM CREATOR ALIAS NAME ALIAS CREATOR

===> ===> ===> ===> ===> ===> ===> ===> ===> ===>

TEST% % TEST% % TEST% % TEST% % TEST% %

===> ===> ===> ===> ===> ===> ===> ===> ===> ===>

PROD% % PROD% % PROD% % PROD% % PROD% %

The masks specified on the Automapping Masks screen control the automatic mapping of dependent objects. All matched pairs are included in the strategy. Note: Automapping masks of % indicate that there must be an exact match between source and target.

336 User Guide

Dependent Object Mapping

Re-Pairing Dependents Dependents can be re-paired by entering new masks numbers. All mapped target object definitions are changed to the source object definition. RMC61 COMMAND ===>

---------- RC/M Dependent Object Mapping --------SCROLL ===> CSR

STRATEGY ===> COMP CREATOR ===> USER7 --------------------------------------------------------------------- USER7 SOURCE SSID ===> PTI2 | TARGET SSID ===> PTI2 DATABASE ===> ATEST > | DATABASE ===> APROD > CREATOR ===> USER5 > | CREATOR ===> A0625SC > | S OBJ# TP NAME CREATOR | MAP# C TP NAME CREATOR _ 19 T TEST4 USER5 | _ 20 S TEST4_S USER5 | _ 21 A TEST4_A USER5 | _ 22 I TEST4_I USER5 | _ 23 V1 TEST4_V USER5 | _ 24 S TEST4_S2 USER5 | _ 25 A TEST4_A2 USER5 | _ 26 V2 TEST4_V2 USER5 | ----------------------------------------+-------------------------------------_ | ____ TS PRODB APROD _ | 19__ T PROD4 A0625SC _ | 20__ S PROD4_S A0625SC _ | 21__ A PROD4_A A0625SC _ | ____ I PROD4_I A0625SC

Source Objects Source object numbers 19, 20, and 21 are not automatically mapped to dependent objects because no matching masks were found. Target Objects Source objects 19, 20, and 21 are mapped to target objects by entering their numbers in the target objects' Map# field. Important! Use this option cautiously because only the selected dependent objects are included in the strategy. Any objects that are not selected are dropped. If the parent of an excluded or unselected target object needs to be dropped or re-created, then the unselected or excluded object is dropped on the target side. More information: Dependent Object Mapping Screen (see page 333)

Chapter 8: Compare Strategies 337

Dependent Object Mapping

Choosing All Dependents When you chose to include all (A) dependent objects, the dependent object list is built at analysis time. All objects dependent on the primary objects, including all unpaired or non-mapped target and source objects, included in the strategy are compared and created. ALL, a primary command, is available from the Compare Explode Services screen. This command automatically changes the Explode option of all source objects that currently have an Explode option of O (original) to A (all). In the following example, the Explode options of source objects QATBAC1, QATBCC3, and QATBDC4 would be changed to A after the ALL command was entered. RMC5A1 COMMAND ===>

---------- RC/M Compare Explode Services --------SCROLL ===> CSR

STRATEGY ===> QACTEST1 CREATOR ===> TSRFL

DESCRIPTION ===> COMPARE TEST SHARE OPTION ===> U (U,Y,N) CREATE/DROP OBJECTS ===> N (U,Y,N) --------------------------------------------------------------------- USER01 SOURCE SSID ===> D81A TARGET SSID ===> D81A SOURCE LOC ===> LOCAL TARGET LOC ===> LOCAL S EXPL TYPE NAME _ O T QATBAC1 _ S T QATBBC2 _ O T QATBCC3 _ O T QATBDC4 _ S T QATBEC5 *******************************

Obj Dep CREATOR CH CH NAME CREATOR PDRFL QATBRCM TSRFLA PDRFL QATBRCM TSRFLB PDRFL QATBRCM TSRFLC PDRFL QATBRCM TSRFLD PDRFL QATBRCM TSRFLE BOTTOM OF DATA ********************************

Valid S Commands: B, C, D, E, I, R Press ENTER to process command

Valid EXPL Commands: A, S, O, X Press END to save strategy

To enter the command, type ALL on the command line and press Enter.

Excluding Unmapped Dependents The Exclude Options screen appears when X is entered in the Explode field of the Compare Explode Services screen. The Exclude Options screen lets you exclude unmatched dependent objects from the comparison. This screen varies depending on the primary object type. Primary Object Pair The names and creators of the primary object pair.

338 User Guide

Dependent Object Mapping

Source Dependent Objects Select an option for each source dependent object type. Each selection option permits users to specify whether all or selected unmatched dependent source objects should be excluded. ■

A—Exclude all unmatched dependent objects.



S—Exclude only selected unmatched dependent objects. The Exclude Source Object screen appears, enabling selection of dependent objects to exclude.

Target Objects Specify which unmatched target objects should be excluded. This option works like the source objects option. Excluded unmatched target objects are dropped. Display Dependent Objects Enter Y to display a list of all dependents (matched and unmatched) of the primary object pair. The Dependent Object Mapping screen appears, displaying all dependent objects (matched and unmatched) of the specified primary object pair. Note: The All Type Exclude Options screen applies only to unmatched dependent objects. All matched (paired) dependent objects are included. A screen to exclude source or target objects displays a list of unmatched dependent objects. The screen varies slightly depending on the object type and whether the objects are source or target objects. However, the screen functions the same for all types. Source Database, Source Creator The source primary object name and creator ID. X (Exclude) Indicate which unmatched dependent objects to exclude or unexclude. ■

X—Exclude. Exclude this unmatched dependent object from the strategy. All other unmatched dependent objects and all matched dependent objects are included in the strategy.



U—Unexclude this excluded unmatched dependent object (excluded objects have a status of X). If the parent object is excluded, the dependent object cannot be unexcluded.

Chapter 8: Compare Strategies 339

Dependent Object Mapping

ST (Status) If the object has been excluded, the status is set to X. For each dependent object, the name, creator, parent object name and creator, and the PARENT_X (parent object status) are displayed. PARENT_X Parent status of each object. If the parent object has been excluded, X displays in this field. If the parent object is excluded, the dependent object is automatically excluded and cannot be unexcluded. Press PF3 (End) to return to the All Type Exclude Options screen.

Keeping Original Target Dependent Objects (O) If you change the Explode option from S, A, or X back to O, then CA RC/Migrator re-creates the target objects as they exist. No further action is required.

Edit Dependent Objects You can edit a dependent source object as described in this section. To edit a dependent source object 1.

Enter S (Select) next to the primary object whose dependent you want to edit on the Compare Explode Services screen. The Dependent Object Mapping screen appears. The Dependent Object Mapping screen can also be accessed by entering S (select) on the All Type Exclude Options screen.

2.

Enter E (Edit) next to the dependent source object you want to edit. The appropriate object Alter screen appears.

For more information about editing objects, see the IBM Object Guide.

340 User Guide

Compare Report Output

Compare Report Output When the COMPARE command is entered from the Compare Explode Services screen, the Compare Report Output screen displays information about the source, target, and new objects. It reports on object changes that will cause DDL to be generated at analysis time. If the C (Compare) line command is entered in the S (Select) field next to an object pair, the report includes only that object. If COMPARE (or COMP) is entered in the command line, the report includes results for all the object pairs in the strategy. After displaying the Compare Report Output screen and returning to the Compare Explode Services screen, the Object Changes and Dependent Object Changes fields for each object pair display Y or N. This indicates whether DDL is generated at analysis time due to changes to the object or its dependents. If N displays in both fields, no DDL is generated. If Y displays in either field, DDL is generated. The Compare Report Output screen contains the following information: Primary Object Lists the primary object pair and any changes made to the target object. New Objects Lists all newly created objects and objects on the source but not the target system. Also lists any changes to these objects. Deleted Objects Lists any object deleted from the target. Paired Object Changes Lists all paired dependent objects, and any changes. These are source dependent objects that were excluded. More information: COMPARE Command (see page 326)

Table Column Mapping Table column mapping provides more precise control over table compares. The Table Column Mapping screen appears when you enter the MAP command from the Compare Table Alter screen. CA RC/Migrator does not recognize any changes to the rule sets Table Column attributes after accessing the Table Column Mapping screen. Mapping columns is like mapping objects. Enter the column's SRC# in the Map# field to map a target column to a source column.

Chapter 8: Compare Strategies 341

Table Column Mapping

The following options are also available for resetting the result columns' attributes: SOURCE, TARGET The names of the source and target tables being mapped. S (Selection) The Selection field provides several options. ■

D—Delete the column from the result table.



S—Use the source column attributes in the result table.



T—Use the target column attributes in the result table.



Z—Sever the source and target columns. This has the effect of including both the source column and the target column of a previously matched pair of columns in the result table.

Note: If the source and target columns had the same name, one of the resulting columns must be renamed. SRC# (Source Number) Source column number. This number is used when mapping target columns to source columns. SOURCE COLNAME The name of the source column. The column data type displays below the name if TYPE is on. (COL NOT IN SRC) indicates the target column in that row is not currently mapped to any source column. The target column attributes are used in the result column. NL Null indicator for the source columns. It has the same values as the other Null indicator fields. MAP# The number of the source column to which this target column should be mapped. Enter the SRC# in the target column's Map# field. The target column name is moved next to the source column name, and the result column has the source's column attributes. TARGET COLNAME The name of the target column. The column data type displays below the name if TYPE is on. (COL NOT IN TRG) indicates the source column in that row is not currently mapped to any target column. The source column attributes are used in the result column.

342 User Guide

Saving the Strategy

NL Null indicator for the target columns. It has the same values as the other Null Indicator fields. RESULT COLNAME The column name of the resulting column. The column data type displays below the name if TYPE is on. The column name or null indicator can be changed. The data type cannot be changed. NL Null indicator for the result table. ■

Y—Null values allowed.



N—Null values not allowed.



U—Null values not allowed, and value must be unique.



D—Null values not allowed and a default value is set based on the data type in the column.

If D (not null with default) is used, DB2 inserts a default value. The following table describes the value inserted for each column type.

Column Type

Value

Numeric

0

Character

Spaces

DATE

Current date

TIME

Current time

TIMESTAMP

Current timestamp

Use the T (Type) command to remove or display the column data types below each column name. The Table Column Mapping screen defaults to Type on. The command is a toggle, so if T is entered once, the column data types are removed from the display. If T is entered again, the data types are displayed again.

Saving the Strategy To save the strategy and return to the Strategy Services panel, press PF3 (End) from the Compare Explode Services screen. Use the CANCEL command to cancel changes made to the current strategy and return to the Strategy Services panel.

Chapter 8: Compare Strategies 343

Saving the Strategy

344 User Guide

Chapter 9: CA RC/Extract Strategies This section contains the following topics: What Is CA RC/Extract? (see page 345) Overview of CA RC/Extract Strategies (see page 347) Create a CA RC/Extract Strategy Type (see page 347) Analyze a CA RC/Extract Strategy (see page 348)

What Is CA RC/Extract? CA RC/Extract is a powerful, comprehensive DB2 tool that can be used by database administrators, application developers, and system programmers to extract referentially-intact data from one set of DB2 objects and load the data into another set of objects. Using CA RC/Extract, you can perform the following: ■

Migrate referentially complete sets of data to another DB2 subsystem or to another set of tables within the same subsystem. CA RC/Extract supports both system-defined and user-defined RI.



Dynamically determine the best approach for extracting the data, using SQL with a WHERE clause. The extraction engine also has built-in x-37 abend handling. An x-37 abend occurs when the extraction stops because the data set that was allocated for the Extract Object is full. The advanced overflow processing features of CA RC/Extract prevent this from happening.



Navigate easily through the product using the menu-driven interface. CA RC/Extract also provides a command-driven interface for advanced users.

Chapter 9: CA RC/Extract Strategies 345

What Is CA RC/Extract?

Basic Process Flow The following diagram provides a process flow of the steps you take and the objects that are created when extracting and loading data using CA RC/Extract:

The CA RC/Extract process flow consists of the following steps: 1.

Define extract In this step, you create a source definition, which defines the objects to extract data and the rules for extracting the data. The source definition is stored in the CA RC/Extract Registry.

2.

Perform extract This step initiates the extraction process.

346 User Guide



The inputs to the extraction process consisting of a Source Definition and the name of a data set to contain the Extract Object.



The output of the Extract Process is the Extract Object, which contains control information and the extracted data.

Overview of CA RC/Extract Strategies

3.

Define targets In this step, you create a target definition, which defines the target subsystem and the objects in which the data is loaded. The target definition maps each object from the source to an object on the target subsystem. Target definitions are stored in the CA RC/Extract Registry.

4.

Perform load This step initiates the load process. ■

The inputs to the Load process are an extract object and a target definition.



The extract object contains the data to be loaded.



The target definition defines the target subsystem and the objects to load the data into.

Overview of CA RC/Extract Strategies The CA RC/Extract strategy type lets you integrate CA RC/Migrator with CA RC/Extract. Using the CA RC/Extract strategy type, you can perform powerful analysis on the source definition. The tables you designate, the associated databases, tablespaces, and any dependent indexes, views, and aliases will all be created. CA RC/Migrator migrates the objects, and CA RC/Extract handles the data. All the powerful features of CA RC/Migrator are available, such as the Global Change Facility and Extended Query Facility. Note: You must be a licensed CA RC/Extract user to use CA RC/Extract strategy types within CA RC/Migrator.

Create a CA RC/Extract Strategy Type You can create a CA RC/Extract strategy type as described in this section. To create a CA RC/Extract strategy type 1.

From the Strategy Services main screen, enter C and other applicable information to create a CA RC/Extract Strategy Type (or R). You are creating a CA RC/Extract Source Definition. See Strategy Services in the “Strategy Services Facility” for additional information about the fields within this screen.

2.

Press Enter. The Start Object Selection screen appears, where you are prompted to specify the table where the extraction process is to begin. For additional information, see the CA RC/Extract User Guide.

Chapter 9: CA RC/Extract Strategies 347

Analyze a CA RC/Extract Strategy

3.

Press Enter. The Source Definition screen appears.

4.

Specify the related tables to include and the parameters for the extraction data are specified.

5.

Press PF3. The Source Definition is embedded in the RC/Migrator strategy. You are returned to the RC/M Strategy Services main screen with a message indicating that the current strategy was saved.

Analyze a CA RC/Extract Strategy You can analyze a CA RC/Extract strategy as described in this section. To analyze a CA RC/Extract strategy 1.

From the Strategy Services main screen, enter A (for Analysis) before the desired CA RC/Extract Strategy type.

2.

Press Enter. The Strategy Analysis screen appears. All of the functionality associated with a migration is available. Note: For additional information about these screens and the Analysis functionality, see the “Analysis” chapter.

3.

Specify the strategy analysis options you want. Note: You can use the default analysis options for most basic extractions. However, you can update the analysis options.

4.

If you specify O (online) for Execution Mode and press enter, the analysis process begins. After a brief message indicating the analysis is being performed, the analysis output appears. ■

The analysis output contains all the created DDL and utility statements. However, the unloads for a migration strategy are replaced by a call to the extraction engine.



CA RC/Migrator migrates the objects, and CA RC/Extract migrates the data.



The LOAD statements are generated by CA RC/Extract. Note: CA RC/Extract does not use model services. Alternatively, you could have specified the CA RC/Extract SQL engine to load the targets from the Extract Object using SQL.

For additional information about the analysis output, see the “Analysis Output” chapter.

348 User Guide

Analyze a CA RC/Extract Strategy

Update Extraction Analysis Options You can update the extraction options as described in this section. To update the extraction analysis options 1.

Access the Migration Strategy Analysis screen.

2.

Enter Y in the Update Options field and press Enter. The RC/M Strategy Analysis Options panel appears. Because CA RC/Extract takes care of the data, the Data Unload Options that appear on the default screen are replaced by the RC/Extract Options.

3.

If needed, specify Y in the Update RC/X Options and press Enter. The Update Extract/Load Options screen appears. The strategy behaves like a Migration type strategy with a primary object type of table. CA RC/Extract specifies the tables to be included to the RC/Migrator Analysis Engine.

Specify the implode/explode options as well as other extract and load options. See the CA RC/Extract documentation for more information.

Chapter 9: CA RC/Extract Strategies 349

Chapter 10: Analysis This section contains the following topics: Overview of Analysis (see page 351) RCMTOLR Data Set Usage During Analysis (see page 352) Analysis Options (see page 352) Processing Flow (see page 354) Analysis Screens (see page 354) Analysis Options Panels (see page 367) Recovery Option (see page 391) Valid PARMFILE DD Analysis Parameters for Any Strategy (see page 397)

Overview of Analysis After a strategy has been created for migration, alteration, or comparison, the next phase is strategy analysis. When a strategy is analyzed, an executable output data set or table is generated to perform the operations that the strategy describes. The analysis output contains the DDL and JCL to perform the operations. The output can be reviewed and edited before it is executed. When the output is executed with the Batch Processor, the actual changes are made to the DB2 objects. As a part of the analysis, you can also create DDL and JCL to reverse the operations defined in the analysis DDL, so that you can recover from an executed strategy. This chapter describes how to use the analysis screens, the Analysis Options panels, and the recovery options screens to create an analysis based on a strategy and a reanalysis based on the output of a previous analysis.

Chapter 10: Analysis 351

RCMTOLR Data Set Usage During Analysis

RCMTOLR Data Set Usage During Analysis During every strategy analysis, CA RC/Migrator checks for DB2 features that are not currently supported. If the product detects an attempt to operate on objects that exploit unsupported features, warning messages are directed to an output data set named RCMTOLR. If you do not want to use RCMTOLR, you can disable RCMTOLR data set creation by customizing the MIGRATOR parmlib member. However, we strongly recommend using RCMTOLR and checking for warning messages generated by the analysis before executing the strategy. Note: RCMTOLR will report what CA RC/Migrator is able to detect. However, RCMTOLR is unable to detect every unsupported feature. For complete information about customizing the MIGRATOR member, see the Implementation Guide.

Analysis Options Following are descriptions of some of the options available from the analysis, analysis options, and recovery options screens used to prepare an analysis: Global changes Create and maintain sets of global changes for all DB2 objects and associate a global change set with a strategy. For almost all objects, the name, the creator ID, the name of objects on which it is dependent, and so forth can be changed. Data only Migrate data only. Drop objects Drop existing objects in the target subsystem. Global conditions Set global conditions for auxiliary implode, referential integrity, and security. DDL only Generate DDL only, with no Batch Processor (RBP) commands. This option is useful because DDL without the RBP commands can be executed through SPUFI. A DDL only output data set or table can also serve as a backup of the DB2 objects. BIND or REBIND BIND or REBIND any plans affected by the strategy, without performing any object migrations.

352 User Guide

Analysis Options

Security DB2 uses an exit point when processing security requests through an external security system, such as RACF or eTrust CA-ACF2. If this exit point has been activated, you cannot successfully migrate all security definitions, as they might not be stored in the DB2 system catalog. (The security support is limited to those authorities defined in the DB2 system catalog.) RI Only Generate only foreign key alters for table objects that are associated with the referential integrity structure. You must specify the RI control option 'L' (Local) or 'G' (Global), or select 'RI' for at least one table on the Implode/Explode Services panel. The following selections on the Strategy Analysis Options panel are ignored: Drop Objects; Image Copy; Bind; Recover Index, and all data unload, data set delete, and VSAM options. Data unload options Unload or reload no data, some data, or all data into migrated tables. Utility options As part of an object migration, utilities can be executed. These options are sometimes essential for completing a migration task. Data set deletion options Data sets are allocated to hold unloaded data and for utility execution. Specify whether to keep these data sets after strategy execution. Analysis listing options These options affect the information that is included in the output. This information includes a header that explains the strategy and analysis options selected, a list of included objects, and statistics on affected data. You can customize the output to include only necessary information. Recovery Use the Recover option to recover from any migration. Model options Allow specification of model IDs to generate the Batch Processor statements. This enables automation of customized changes to the analysis. Group migration Allows one-to-many migrations. Objects can be migrated from one source subsystem to one or more target subsystems, or replicate objects one or more times within the same subsystem. The copies are defined using the Copy Group Services option.

Chapter 10: Analysis 353

Processing Flow

Different analyses can be used with a single strategy to create many different operations.

Processing Flow The Strategy Analysis screen offers many options, some of which were briefly introduced previously in the Analysis Options section. CA RC/Migrator saves analysis options for each strategy, so that you have to specify options only if they are to be changed. CA RC/Migrator presents options affecting the analysis process on the Strategy Analysis screen. It presents options affecting the commands generated on the Global Changes, Analysis Options, and Recovery Options screens. The following diagram shows the various options screens available:

If you want to update options, the Strategy Analysis Options panel appears. You make global changes on the Global Change Services screen. Specify recovery options on the Recovery Options screen. Batch analysis requires that you specify additional information on the Batch Analysis screen. The Strategy Analysis, Strategy Analysis Options, and Recovery Options screens are described in this chapter.

Analysis Screens The analysis screen, which is slightly different for each type of analysis, let you specify analysis options for strategies and provides analysis performance control and execution in online or batch mode. The analysis screens include fields for entering the following types of information about the analysis:

354 User Guide



Execution specifications



Option specifications

Analysis Screens



Output specifications



Output analysis specifications



Access specifications



DB2 SSID specifications (Migration strategies only)



Rule set specifications (Compare strategies only)



Copy group specifications (Group Migration strategies only)

Accessing Analysis Screens To access the appropriate analysis screen, select one of the following based on the kind of analysis to be performed: ■

Migration, alteration, or compare strategy analysis—On the Strategy Services panel, enter A next to the strategy name and press Enter.



Reanalysis of a previous analysis output—On the Strategy Services panel, enter A next to an analysis output name (indented under the strategy name), and then press Enter. The analysis options are initially set to those used for the analysis that produced the output, but they can be changed.



Group migration strategy analysis—On the Strategy Services panel, enter G next to the strategy name and press Enter.



Quick migration analysis—On the Quick Migration Services screen, make the appropriate object selections, and then press PF3 (End) to display the Quick Migration Analysis screen.



Incremental Change Language (ICL) analysis—On the Strategy Services panel, enter I next to the strategy name, and press Enter.



ICL-to-DDL analysis—On the Strategy Services panel, enter A next to the ICL (Incremental Change Language) analysis output to analyze, and press Enter. The prefix ICL identifies an analysis that contains ICL syntax. The ICL output is indented under the strategy name.



RC/Merger analysis—On the Strategy Services panel, enter M next to the strategy name, and press Enter.

Analysis Screen Layout This section describes the fields that can appear on an analysis screen. A screen for a particular type displays only the fields appropriate to that type. The strategy name, creator, description, and share option identify the strategy being analyzed. These fields are for display only.

Chapter 10: Analysis 355

Analysis Screens

Execution Specifications Enter data in the following fields to specify execution specifications: Execution Mode Indicates how to execute the migration. Valid values are as follows: Note: The execution mode should be the last value entered before beginning the analysis. This field remains blank after entering the execution mode to start analysis. ■

O—Perform the analysis online. Note: Online analysis can take a long time for complex or large strategies. Once the analysis is started, a screen appears to indicate that the analysis is in progress. At completion, the migration commands are written to the specified output data set or managed table. See Output Analysis Specifications Fields after Analysis for more information. To stop the analysis process, press the ATTN key or the equivalent keystrokes. If you interrupt an analysis, an error message is written to the analysis data set or table. After analysis is complete, the analysis message file automatically appears so that analysis messages can be reviewed.



B—Performs the analysis in batch. The Batch JCL Specification panel appears, where you can enter information for the batch job. See Batch Analysis in the “Execution Facility” chapter for more information about the Batch JCL Specification panel.

Override Indicate whether to reuse an existing data set analysis output. This field is not applicable for managed output. Valid values are as follows: ■

Y—Reuse a data set analysis output. Important! Reusing an output with an incomplete status prevents you from restarting the previous execution of that output.



N—Do not reuse a data set analysis output. The default is N.

The analysis and execution of strategies (data sets or managed tables) is tracked in the BPLOG table as described in the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide. If an output name is entered that is listed in the BPLOG table as incomplete (a status code other than NC or FC), a warning message displays to the analysis message file, and the analysis process is terminated. The data set check prevents you from accidentally reusing an output that needs to be restarted to finish a strategy execution. If output is reused, an incomplete migration, alteration, or comparison can result, with no easy way to recover.

356 User Guide

Analysis Screens

Recovery Indicate whether the operation should be recoverable. This option generates the information necessary for recovery and saves it in a data set or a DB2 table managed by CA RC/Migrator when DDL is executed, not when the analysis is performed. Valid values are as follows: ■

Y—Make the existing definition of the objects included in the strategy recoverable. This option adds the commands necessary to generate the recovery data set or table to the analysis output. The recovery data set or table contains all the commands necessary to drop the new version of the objects (and their data and dependents) and re-create the original version of the objects. If Y is entered and Enter is pressed, the Recovery Options screen appears. For more information, see Recovery Option.



N—Do not make the object recoverable.



U—Update the existing recovery option values from the Recovery Options screen. This can be useful before beginning analysis.

Access Specifications Enter data in the following fields to specify access specifications: ACM ANALYSIS Specify whether alternate catalog tables should be used to perform the analysis. Note: For more information about ACM, see the Value Pack Reference Guide. Valid values are as follows: ■

Y—Use the alternate catalog tables.



N—(Default) Do not use the alternate catalog tables.

If you use ACM for analysis, CA RC/Migrator uses the alternate catalog tables. If the tables are out of synchronization with the catalog, the output might be incorrect. To use ACM during analysis, it must be set to Y, regardless of the value of ACM on the CA Database Management Solutions for DB2 for z/OS main menu. PDS ANALYSIS Indicate whether to use a PDS to access the product internal structure of the DB2 subsystem. Valid values are as follows: ■

Y—Use a partitioned data set (PDS) to access the internal structure of the DB2 subsystem. Read access must be held for the partitioned data set.



N—Do not use PDS access. N is the default.

Chapter 10: Analysis 357

Analysis Screens

Option Specifications The following explains the Option Specification fields of the analysis screen. Update Options Indicate whether to display the Analysis Options panel (described in Analysis Options). Valid values are as follows: ■

Y—Display the Analysis Options panel to view or update the options.



N—Do not display the Analysis Options panel. This is the default.

Global Changes Indicate whether to incorporate global changes in this analysis. Valid values are as follows: ■

Y—Display the Global Changes screen with a temporary global change set named TEMP or, if a valid global change set is entered, select that global change set. Note: If a wildcard is used in the name or creator, or if the global change set does not exist, the Global Change Services screen appears, where you can select a global change set.



S—Display the Global Change Services screen to select a global change set. See the “Profile” chapter for more information about selecting a set. U—Display the Global Changes screen to update the global change set that is specified in the Set Name and Set Creator fields.



N—Do not use global changes. This is the default.

Set Name The name of the global change set. Selection criteria are acceptable. Set Creator The user ID of the creator of the global change set. Selection criteria are acceptable.

358 User Guide

Analysis Screens

DB2 SSID Specifications The following explains the DB2 SSID Specification fields of the analysis screen for migration strategies. Source SSID Displays the ID of the source DB2 subsystem. This is the subsystem specified when the strategy was created. Target SSID Indicates the ID of the DB2 subsystem to which the objects are to be migrated. A valid DB2 SSID must be entered. If the specified target DB2 SSID does not exist in the parmlib, a popup window appears, letting you specify the version of DB2 for which the DDL is written. For a list of all valid SSIDs and their locations, enter a question mark (?). Note: For more information about the SSID selection screen, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Output Analysis Specifications Depending on the options defined on the Global Parameters screen, one of two sets of input and output specification fields can appear on an analysis screen. Note: To toggle the analysis output fields from managed output to a data set, and vice versa, you can enter the primary command O (or OUTPUT). On the ICL to DDL analysis screens, you can enter the primary command I (or INPUT) to toggle the input specification fields. For more information about managed output, see Managed Output in the “Analysis Output” chapter. Output Analysis Specifications When these fields appear, the analysis output goes to a managed table: Edit Output Indicate whether to edit the managed output described in the other output specifications fields. Use this field after returning from an analysis. Valid values are as follows: ■

Y—Open an ISPF edit session containing the analysis output. Use standard ISPF commands for editing and navigation. When exit (PF3) is pressed from the edit session, the analysis output table is updated.



N—Do not edit the output table. This is the default.

When the Update Date and Update Time fields contain N/A, there is no current output available to edit. An analysis must be run against this strategy; then the Update Date and Update Time fields are filled, and new output can be edited from this screen. Prior analysis output must be edited from the Strategy Services panel.

Chapter 10: Analysis 359

Analysis Screens

Strategy The name of the strategy associated with this output table. Creator The user ID of the strategy's creator. Comment Enter a comment (up to 55 characters) to help identify the output. The comment appears indented under the appropriate output line on the Strategy Services panel. To toggle the comment display on this screen: ■

Enter C or COMMENTS as a primary command for all comments.



Enter an exclamation point (!) next to the appropriate strategy name or next to the appropriate analysis line. If the analysis is a Group ICL to DDL analysis, the comment entered here appears with the output for each analysis in the group.

Analysis User The user ID of the strategy's analyzer. Analysis Date The date the analysis was run, in the format YYYYMMDD. Displays N/A until the analysis is complete. Analysis Time The time the analysis was run, to hundredths of seconds, in the format HHMMSSss. Displays N/A until the analysis is complete. Output Data Set Specifications When these fields appear, the analysis output goes to a data set: Edit Dataset Indicate whether to edit a data set, immediately or after online analysis has finished. The default is N. Valid only for online mode. To edit a data set immediately, enter the data set name in the Dataset Name field, enter Y in the Edit Dataset field, and press Enter. The DDL data set can also be edited after online analysis has finished.

360 User Guide

Analysis Screens

Dataset Name Enter the fully qualified name of the data set to contain all commands necessary to perform the migration. A PDS or sequential file can be used. If the data set entered in this field does not already exist or cannot be found, it can be allocated from the Output Dataset Allocation screen. See Output Dataset Allocation Screen next for more information. Note: To use a default PDS name, specify a default PDS through the Profile Variables. For more information, see the “Profile” chapter. Volume Serial Specify a volume serial ID. This is required if the data set is not cataloged. Output Dataset Allocation Screen If the data set specified on the analysis screen does not already exist or cannot be found, the Output Dataset Allocation screen appears. When this screen appears, values may already be entered in some of the fields. These values might be carried over from a previous analysis or they might be generated based on the type of analysis you are performing. The following describes the new analysis output data set specification fields on this screen: Dataset Name The name of the output data set. This information is carried over from the analysis screen. Volume Serial Optionally, enter the volume serial of the direct access volume that will contain the data set. Leave this field blank to allow ISPF to select an eligible volume. Unit Optionally, enter the generic unit address for the direct access volume that will contain the data set. Space Units Specify whether data set size is expressed in tracks or cylinders. Valid values are as follows: ■

TRK, TRKS, TRACK, TRACKS—Express data set size in tracks.



CYL, CYLS, CYLINDER, CYLINDERS—Express data set size in cylinders.

Primary Quantity Specify the primary allocation quantity in tracks or cylinders, as indicated in the Space Units field. This field must be set to a numeric value greater than zero.

Chapter 10: Analysis 361

Analysis Screens

Secondary Quantity Specify the secondary allocation quantity in tracks or cylinders, as indicated in the Space Units field. If blanks are entered in this field, it will default to zero. Directory Blocks Specify the number of directory blocks to allocate to a PDS. For a PDS, this value must be one or greater. For a sequential data set, this value must be zero. If this field is left blank, it defaults to zero. Record Format Specify the format of the records. Valid values are as follows: ■

F—Fixed length records



FB—Fixed blocked records

Record length Displays the logical record length, in bytes, of the records to be stored in the data set. This field always displays 80. Block Size Specify the block size (physical record length), in bytes, of the blocks to be stored in the data set. Dataset Type Enter the type of data set to allocate. ■

PDS—Allocate a partitioned data set.



(blank)—Allocate a partitioned or sequential data set based on the data set characteristics entered.

Press PF3 (End) to process the output data set allocation. The Strategy Analysis screen reappears, where strategy analysis can continue. A message indicates that the new output data set has been cataloged. Use the CANCEL command to cancel the data set allocation and return to the Strategy Analysis screen.

ICL Analysis Screens Input and Output Specifications The Input and Output Specification fields, found on the Compare Strategy ICL Analysis screen, the Alteration Strategy ICL Analysis screen, and the ICL to DDL Analysis screen, can differ according to default options you have set up on the Global Operational Parameters screen. They operate as described previously in Output Analysis Specifications.

362 User Guide

Analysis Screens

Group Migration Analysis Considerations When analyzing a group migration strategy, after the analysis there are multiple output data sets or tables—one for each copy-ID in the copy group set used for the analysis—instead of only one, as in other analysis types. For more information about RC/M-managed output, see Managed Output in the “Analysis Output” chapter.

Dataset Name Field for Output to a Data Set On the regular analysis screen, enter the fully qualified name of the output data set to contain the DDL and Batch Processor commands necessary for the operations in the Dataset Name field. For the strategy analysis screen for group migration, the data set name cannot include a member name. This is because the output data set for a group migration contains multiple members, and the member names are generated. A separate member is generated for each target subsystem involved in the migration. There is a member for each Copy-ID item from the Copy Group set entered in the Copy Group Specifications fields. The Copy-ID uniquely identifies each target copy that is to be migrated. The member names are generated based on the strategy name and the Copy-IDs. The first four characters of a member name are the first four characters of the strategy name, and the last four characters are the four-character Copy-ID.

Output Analysis Specifications Fields After Analysis When analyzing a group migration strategy using RC/M-managed output, the analysis produces multiple output tables—one for each Copy-ID in the Copy Group set used. Therefore, after the analysis, the RC/M Managed Output Selection screen appears, displaying all the output tables that were produced by the group migration analysis. This lets you select the table to appear in the Output Analysis Specification fields when the analysis screen returns.

OUTPUT Command The output commands lets you temporarily toggle the destination of the analysis output data for the current analysis without altering the default RC/M Global Operational Parameters. The analysis output data can be directed to a data set or a DB2 table managed by CA RC/Migrator.

Chapter 10: Analysis 363

Analysis Screens

INPUT Command The INPUT command lets you temporarily toggle the ICL input specification fields for the current analysis without altering the default RC/M global operational parameters. The analysis input data can be from a data set or a DB2 table managed by CA RC/Migrator. You can specify I (or INPUT) only from the ICL to DDL Analysis screen or the ICL to DDL Group Analysis screen.

Access Specifications The following explains the Access Specification fields of the analysis screen. ACM Analysis Specify whether alternate catalog tables should be used to perform the analysis. Valid values are as follows: ■

Y—Use the alternate catalog tables. Note: To use ACM during analysis, you must set it to Y here, regardless of the value of the ACM option on the CA Database Management Solutions for DB2 for z/OS main menu.



N—Do not use the alternate catalog tables. This is the default.

If you use ACM for analysis, CA RC/Migrator uses the alternate catalog tables. If the tables are out of sync with the catalog, the output might be incorrect. Note: For more information about ACM, see the Value Pack Reference Guide. PDS Analysis Indicate whether to use a PDS to access the internal structure of the DB2 subsystem. Valid values are as follows: ■

Y—Use a partitioned data set (PDS) to access the internal structure of the DB2 subsystem. You must have read access to the partitioned data set.



N—Do not use PDS access. This is the default.

Note: If both Access Specification fields are set to N (NO), the DB2 catalog is used and CATALOG is specified as the access method in the analysis output data set.

364 User Guide

Analysis Screens

Target Specifications The following explains the Target Specifications fields of the ICL to DDL analysis screen. Target SSID Enter the ID of the DB2 subsystem containing the objects to compare or alter. This SSID will precede the name of the data set containing the output of the ICL to DDL analysis. A valid DB2 SSID must be entered. To see a list of all valid SSIDs and their locations, enter a question mark (?) in the field. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about the SSID selection screen. Note: When a strategy is analyzed with the Exclusive Option on the Analysis Options panel set for an SQL-only analysis, no Batch Processor commands (such as .SYNC, .AUTH, and so on) are included in the analysis output. No CONNECT to the target SSID is generated, because when SQL-only is specified, syntax is generated that can be run through SPUFI. Location Enter the location of the DB2 subsystem selected previously. To see a list of all valid locations, enter a question mark (?) in this field.

Copy Group Specifications These fields identify the copy group set to be used in the analysis and appear only on the strategy analysis screen for a group migration or on the ICL to DDL Group Analysis screen. Copy Group Select an existing Copy Group set to be used with the strategy. Valid values are as follows: ■

Y—Yes. After a Copy Group set has been specified, Y displays in this field. If no Copy Group set has been specified (the field contains N), enter Y and press Enter to display the Copy Group Services screen and make a selection or develop a new set. Note: At analysis time, an option set to Y on the Strategy Analysis Options panel overrides the corresponding option setting at the Copy Analysis Options panel. Conversely, an option set to N (the default) allows the Copy Analysis Options panel setting to be in effect.



S—Select. To select a Copy Group set, enter S. The Copy Group Services screen appears. When a set has been selected, press PF3 (End) to return to the Strategy Analysis screen. The Group Name and Group Creator fields show the selection, and this field is Y. Use selection criteria in the Group Name and Group Creator fields to filter the selection list that appears on the Copy Group Services screen.

Chapter 10: Analysis 365

Analysis Screens



U—Update. Enter U and press Enter to update the Copy Group set identified in the next two fields, Group Name and Group Creator. The Copy Group Update screen displays, which lets you make changes. When finished updating the set, press PF3 (End) to return to the Strategy Analysis screen.



N—(Default) No, a Copy Group set has not been selected. If a Copy Group set has already been identified for this strategy, this field displays Y and the Group Name and Group Creator fields are filled in. If the decision is made to not use the set, enter N in this field and press Enter to delete the Copy Group set's association with the strategy.

Group Name Specify the name of the Copy Group set. Selection criteria are accepted. Group Creator Specify the user ID of the creator of the Copy Group set. Selection criteria are accepted.

Rule Set Specifications The Rule Set Specifications fields appear only on the Compare Strategy Analysis screen and the Compare Strategy ICL Analysis screen. If these fields are left blank, the rule set chosen when the strategy was created is used. Rule Name Specify a rule name or enter an asterisk to access a rule set selection list. Rule Creator Specify a rule creator or enter an asterisk to access a rule set selection list. For more information about rule sets, see Compare Rule Database Services in the “Profile” chapter.

366 User Guide

Analysis Options Panels

Analysis Options Panels Analysis options are saved for each strategy so that options only need to be specified if they need to be changed. Options that affect the analysis process are presented on the Migration Strategy Analysis screen. Options that affect which commands are generated are presented on the Global Changes and Strategy Analysis Options panels. The following illustration shows the various options screens available:

Depending on the analysis type, the following types of options are available when the Analysis Options panels are accessed from the strategy analysis screens. ■

Control options



Data unload options



Exclusive options



Utility options



Utility model options



Output listing options



Data set delete options



IDCAMS options



RC/Merger option selections Note: For more information about these option selections, see the “RC/Merger” chapter.

Chapter 10: Analysis 367

Analysis Options Panels

The following describes the areas of the Strategy Analysis Options panel. Control Options Control the objects and authorities to be migrated. Utility Options Permit execution of utilities as part of the migration. Output Options Affect the analysis output. Dataset Delete Options Determine whether data sets created to hold the unloaded data for the unload or reorg utilities are deleted when analysis is complete. Data Unload Options Control how data is handled in the migration. Model Options Control which model utilities are used to generate the utilities. IDCAMS Options Control whether VSAM data sets are deleted or defined as part of the migration. Exclusive Options Permit performance of a single operation, without performing any other function of the strategy. Enter a question mark (?) in any option field to get help for that option. Use the SAVE command to save the options displayed for this strategy in your ISPF profile. When analysis options are saved, they are set as the default for all strategy analyses. These options are used by default whenever a strategy of any type is analyzed or if the Alteration Analysis facility of CA RC/Update is used. Accordingly, if analysis options are saved through CA RC/Update, they are used for strategy analyses. Analysis options can be changed before analysis begins. Global changes are not saved as part of the SAVE command. Press PF3 (End) to save the options for this analysis only and return to the Strategy Analysis screen. More information: Recovery Option (see page 391)

368 User Guide

Analysis Options Panels

Control Options You can use the control options to override the individual control options specified for individual objects in a strategy. If an override option is selected on this screen, the option is used regardless of what was specified for each object during strategy creation. If a global override option is not selected here, the option selected during object creation is used. The following describes the control options of the Analysis Options panels. Aux Implode Specifies whether to perform auxiliary implode to include related parent objects for objects in the current migration tree. Object types for this kind of implode are as follows: ■

Views, which implode to tables and views (for example, due to a join) Note: If a view is the primary object level, auxiliary implode includes only parent views. If you want parent tables to be included, the selected primary view's table implode option must be set.



Indexes (for example, a partitioned index), which implode to storage groups



Tablespaces (for example, a partitioned tablespace), which implode to storage groups

Valid values are as follows: N Does not perform auxiliary implode. Y Performs auxiliary implode. S Uses the value that was specified when the strategy was created. MQT Implode Specifies whether to perform an MQT implode to include parent table and parent view objects of an MQT. Valid values are as follows: N Does not perform an MQT implode. Y Performs an MQT implode. S Uses the value that was specified when the strategy was created.

Chapter 10: Analysis 369

Analysis Options Panels

RI (Local or Global) Specifies whether to include foreign keys and parent tables (with their indexes) for child tables in the strategy. Valid values are as follows: N Does not include the foreign keys and parent tables. L Includes only local referential integrity (foreign keys only). G Includes all referential integrity (foreign keys and parent tables). Note: Also included in the strategy are foreign keys and parent tables (with their indexes) for included parent tables. This occurs whenever the parent table is also a child table. S Uses the value that was specified when the strategy was created. Security Specifies whether to explode the security structure that belongs to the objects being migrated. All security associated with the objects is migrated, including security granted by users with the GRANT WITH GRANT OPTION. This option specifies security migration for all objects. It will override the security option selected during strategy creation (global override). For compare strategies, this option affects only the target objects. If security exists on the target objects, and these objects are dropped, this option controls whether the security is re-created. Security from the source object is not created if the object does not already exist on the target. Note: CA RC/Migrator generates grants on objects but not on user or system privileges. Authorizations, such as BINDADD and CREATEDBA, are not migrated from source to target. Verify that your permissions are in place on both source and target systems before you proceed with your migration. Valid values are as follows: N Does not include security. Y Includes all security.

370 User Guide

Analysis Options Panels

For alteration and compare strategies, you can also specify the following: S Invokes CA RC/Secure with an SRSLOAD call for newly created, dropped, or updated (renamed) objects. GRANTs are generated for all other objects. F Performs identically to S, with the added benefit of invoking SRSLOAD with the Fast Path performance option. Note: CA RC/Migrator detects duplicate grants and removes them rather than re-create them. A grant is considered a duplicate grant if the GRANTOR, GRANTEE, and PRIVILEGE are the same for two separate grants. CA RC/Migrator removes the second grant (determined by chronology). CA RC/Migrator reports the number of duplicate grants that have been removed in the Impact Analysis report. Drop Objects Specifies whether to drop the existing objects before the new objects are created. This is useful for “in place” migrations. This field determines whether the analysis program generates DROP DDL statements for old-named or new-named objects involved in this migration strategy. The order of drops is database, tablespace, table, index, view, synonym, storage group. (All tablespace and indexspace partitions that use the storage group must be dropped before the storage group can be dropped.) All dependent objects are dropped at the same time as the parent object. Drops are bypassed if upper level drops have already deleted the dependent objects. This field is ignored for the following types of analyses: REBIND only Rebinds any plans affected by the strategy, without performing object migrations. DATA only Migrates data only. STATS only Generates only statistics about affected data. GRANTS only Generates AUTH and GRANT statements only. RI only Generates only alterations for table objects that are associated with the referential integrity structure.

Chapter 10: Analysis 371

Analysis Options Panels

We do not check to see whether the object already exists on the target SSID before issuing the drop statement. Valid values are as follows: O Generates DROP DDL statements for all old-named objects that already exist on the target DB2 subsystem. Y Generates DROP DDL statements for all new-named objects that already exist on the target DB2 subsystem. N Does not generate DROP DDL statements. This is the default. Default SQLID Specifies an SQL ID for a SET CURRENT SQLID statement to be executed before the CREATE statements for explicitly qualified objects. Explicit objects include tables, indexes, aliases, and triggers. The SET CURRENT SQLID statement may be necessary to guarantee that the correct ID is checked for authorizations at execution time. Note: The Default SQLID option cannot be used for views. The SET statements for views can be globally modified through the global change facility by using View Text Creator. You can also modify the SQL ID individually for a view object by editing the object in a strategy and issuing the SET SQLID primary command. The following three authorization IDs can be associated with the creation of an explicitly qualified object: ■

The qualifying ID, which is stored as the CREATOR ID.



The primary authorization ID of the user who executed the CREATE statement, which is stored as the CREATEDBY ID.



The ID used to check the CREATE authorizations.

This third ID is often a secondary ID that holds the authorizations necessary to CREATE the object. The user's primary ID (CREATEDBY) might have no DB2 authorities at all. Unless the SQL ID information is saved, the correct authorizations might not be included in the recovery data set or table. A SET SQLID statement might be mandatory if views contain references to unqualified table names. Leave this field blank to suppress generation of a SET CURRENT SQLID statement before CREATE statements of explicitly qualified objects. Note: The SQL ID specified in this field is for this strategy only. It is only used as the current SQLID when producing the analysis. If this field has an SQL ID entered, a SET CURRENT SQLID command in the command line does not affect this field.

372 User Guide

Analysis Options Panels

Alias SQLID Specifies an SQL ID to execute a SET CURRENT SQLID statement before the CREATE statements for non-edited, explicitly qualified ALIAS. Using a SET SQLID statement before CREATE statements can be useful in obtaining the correct authorizations for creating ALIAS. The SQL ID will not override the one in use while the object definitions are being edited. Note: Leave this field and the Default SQLID field blank to suppress generation of a SET CURRENT SQLID statement before a CREATE ALIAS statement for explicitly qualified objects. Drop & Re-Create Specifies whether to generate DROP and CREATE DDL for an object that is alterable. Note: This option is available only during analysis of migration strategies, alteration strategies, and Incremental Change Language (ICL). Valid values are as follows: Y Specifies to drop and re-create all objects that have changed. N Specifies to use the ALTER statement whenever possible to make the requested changes. Note: To avoid versioning of objects due to the online schema evolution (extended ALTER functionality introduced in DB2 V8), you can use this option to force the dropping and creating of DB2 objects as was done prior to DB2 V8. LOB Objects Specifies whether to include LOB objects (LOB tablespaces, auxiliary tables, auxiliary indexes) for migrated tables that contain LOB columns. Valid values include: Y Includes LOB objects with migrated tables that contain LOB columns. N Does not include LOB objects with migrated tables that include LOB columns. This is the default.

Chapter 10: Analysis 373

Analysis Options Panels

TABLE OBID Specifies whether to generate the OBID clause on CREATE TABLE statements. The OBID is the internal table object identifier assigned by DB2. This analysis option allows the table OBID to be maintained in the target database. It can be used with a high-speed utility to copy or create the tablespace data sets. Note: This option is supported only for migrations. Valid values are as follows: N Does not generate the OBID clause. Note: If a table that is edited in the strategy specifies an OBID value, the OBID clause will be generated, even if this analysis option is set to N. Y Generates the OBID clause. Important! If the OBID is not available in the target database, generating the OBID clause could result in SQLCODE -736 (invalid OBID specified). The OBID will not be available if the database already exists in the target DB2 subsystem (and a tablespace, table, or index is already using the desired table OBID). The OBID would also be unavailable if a tablespace being created in this analysis output uses the desired table OBID before the table is created. SEQ Implode Specifies whether to implode SQL functions and triggers to include sequences in the strategy. Valid values are as follows: T Implodes triggers to include sequence parent objects. R Implodes SQL functions to include sequence parent objects. A Implodes triggers and SQL functions to include sequence parent objects. blank Does not implode to sequences. S Uses the value that was specified when the strategy was created.

374 User Guide

Analysis Options Panels

RTN IMPLODE Specifies which DB2 objects in the migration strategy are to be imploded to include routines (user defined functions and stored procedures) in the strategy. This specification interacts with a selected object's routine implode specification (chosen during strategy creation). The interaction behavior is controlled by the RTN INTERACTION option. Important! RTN IMPLODE can be forcibly overridden by the RTN INTERACTION option, depending on settings. T Implodes triggers to include routine parent objects that are referenced in a trigger body. V Implodes views to include routine parent objects, user-defined functions that are referenced in a view's text. A Implodes triggers and views to include routine parent objects referenced in their body/text. S Selects routines to be included in the analysis. blank Does not implode to routines. RTN INTERACTION Specifies how the RTN IMPLODE analysis option is to interact with a selected object's routine implode strategy option. The value in this field controls the interaction between specifications made at strategy creation time and specifications made at analysis time. Y Uses strategy creation specifications and ignores analysis specifications. N Does not implode views/triggers to routines and ignores all specifications. A Implodes all views/triggers to routines and ignores all specifications. This value brings in any routine referenced by triggers and views (not only what was selected in the strategy).

Chapter 10: Analysis 375

Analysis Options Panels

O Overrides all strategy specifications and uses only analysis specifications. E Excludes analysis specifications from strategy specifications. M Merges strategy specifications with analysis specifications. S Synchronizes analysis specifications with co-existing strategy specifications. MQT REFRESH Specifies whether to generate REFRESH TABLE DDL for materialized query tables (MQTs). If generated, the DDL appears after the DDL or UTILITIES SECTION portion of a CA RC/Migrator or RC/Merger script. Y Generates REFRESH TABLE DDL for each MQT that is defined as SYSTEM MAINTAINED. B Generates REFRESH TABLE DDL for each MQT that is defined as SYSTEM MAINTAINED or USER MAINTAINED. U Generates REFRESH TABLE DDL for each MQT that is defined as USER MAINTAINED. N Does not generate REFRESH TABLE DDL for MQT. More Information: How to Use RTN IMPLODE and RTN INTERACTION During Analysis (see page 390) Relationship of MQT REFRESH and ALL ROWS Analysis Options (see page 389)

376 User Guide

Analysis Options Panels

Utility Options The following describes the Utility Options fields of the Analysis Options panels. Note: The utility options are not valid for compare strategies where the target is DDL. Stats Specifies whether to update statistical information. Valid values are as follows: Y Runs the statistics utility on all affected indexes and tablespaces. Statistics utility control cards are generated for all involved indexes and tablespaces when the object is recovered. If you are going to REBIND plans, the statistics utility helps the Optimizer make correct access path decisions when linking the plans. Indexes whose tables have not been recovered will have the statistics utility executed on the indexes only. N Does not run the statistics utility. This is the default. S Generates SQL update statements using the object's current statistics utility values. For a migration strategy, these SQL statements migrate the object's statistics to the target subsystem. Update statements are defined for columns that are defined as updateable in the DB2 catalog. These SQL statements are generated instead of using the statistics utility. A Performs the same function as option S but also generates control cards for the statistics utility to make sure the catalog rows required for the updates exist. For a migration strategy, the SQL statements will migrate the object's statistics to the target subsystem.

Chapter 10: Analysis 377

Analysis Options Panels

Check Data Specifies whether to run the check utility for any tables loaded with ENFORCE=NO. (All foreign key alters will have been loaded with ENFORCE=NO). Valid values are as follows: Y Runs the check utility. N Does not run the check utility. If the check utility is not run, tables with referential integrity might be placed in a CHECK PENDING status. The default is N. This field is ignored for REBIND Only and DDL Only analyses. Image Copy Specifies whether an image copy is performed on all partitions of all tablespaces or indexspaces involved in an alteration, on altered partitions only, or whether it is not performed at all. Valid values are as follows: Y Generates image copy control cards for all partitions of all tablespaces or indexspaces involved in an alteration. This causes the image copy utility to be run during execution of the migration, comparison, or alteration. P Generates image copy control cards only for altered partitions of tablespaces or indexspaces involved in an alteration. This will cause the image copy utility to be run during execution of the migration, comparison, or alteration. N Does not generate any image copy control cards. This is the default. This field is ignored for REBIND Only and DDL Only analyses. (B)ind/(R)ebind Specifies whether to bind or rebind all plans dependent on altered objects. Valid values are as follows: R Rebinds any dependent plans and dependent packages. The rebinds execute after all object creation and table loads. B Binds any dependent plans. The binds execute after all object creation and table loads. If the original bind used a concatenation of PDS libraries for its DBRMs, check the order of the concatenation in the analysis file to make sure it is correct.

378 User Guide

Analysis Options Panels

N Does not bind or rebind any plans. This is the default. C Rebinds any dependent plans for only the most current version of any dependent packages. O Binds only operative dependent plans and only operative dependent packages. This is the same as the B option, except that only operative plans are bound. V Rebinds only valid dependent plans and only valid dependent packages. Reorg Specifes whether to include a reorg utility in the DDL produced by the analysis. These options are in effect only if a reorganization is needed, for instance, when one or more of these attributes is altered: FREEPAGE, PCTFREE, PRIQTY, SECQTY, ERASE, VCAT, or STOGROUP (and COMPRESS for a tablespace). Valid values are as follows: TS Generates tablespace reorg utilities. IX Generates index reorg utilities. B Generates both tablespace and index reorg utilities. N Does not generate reorg utilities. This is the default. Note: This field appears only on Analysis Options panels of Alter and Compare strategies. Recover Index Specifies whether to include recover index utilities in the analysis. This option is in effect only if the index was created using the DEFER YES clause. Valid values are as follows: Y Includes recover index utilities in the analysis. The DEFER YES option is overridden for indexes that are created on empty tables. N Does not include recover index utilities in the analysis.

Chapter 10: Analysis 379

Analysis Options Panels

Output Options The following describes the Output Options fields of the Analysis Options panels. Analysis Header Specifies whether to include a header in the analysis output. The analysis header lists all the strategy and analysis options selected. See the “Analysis Output” chapter for more information. Valid values are as follows: Y Includes a header in the analysis output. This is the default. N Does not include a header in the analysis output. Impact Analysis Specifies whether to include an impact analysis in the strategy analysis. The impact analysis lists the names and creators of the objects included in the migration. (Tablespaces are listed by name and database, instead of name and creator.) It also indicates whether objects have been edited. See the “Analysis Output” chapter for more information. This field is ignored for REBIND only analyses. Valid values are as follows: Y Includes an impact analysis. This is the default. N Does not include an impact analysis. RPT in DDLFILE Specifies where the Change Analysis report should appear. Valid values are as follows: Y Includes the report at the end of the output DDLFILE and not in the message file (MSGFILE). N Writes the file to MSGFILE. Note: For more information about the message file, see the “Analysis Output” chapter.

380 User Guide

Analysis Options Panels

Dataset Delete Options Data set deletions are performed as the last phase in the strategy. The following describes the data set delete options on the Analysis Options panels: Unload Specifies whether to delete the data sets that were created to hold the unloaded data for the unload or reorg utilities. Valid values are as follows: Y Deletes the data sets. N Does not delete the data sets. This is the default. Note: For more information about how data is unloaded, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide. Temporary Specifies whether to delete temporary data sets used by the load, check, and copy utilities. Y Deletes the temporary data sets. N Does not delete the temporary data sets. This is the default. More information: User-Defined Symbolic Parameters (see page 384)

Data Unload Options Data is migrated for tables that have data options selected during the strategy creation. The Data Unload options work with strategy data options by specifying data unload information for any tables whose strategy data options were left blank. These fields are ignored for rebind-only and DDL-only analyses. Note: Specify only All Rows or Number Rows, not both. A blank in both fields indicates the options specified at strategy creation time are to be used.

Chapter 10: Analysis 381

Analysis Options Panels

All Rows Specifies whether all rows should be retrieved. Valid values are as follows: Y Retrieves all rows. N Does not retrieve all rows. An N in this field does not override a Y set for the All Rows field on the Implode/Explode Services panel. If you specify a value in this field, do not specify a value for the Number Rows field. These fields are mutually exclusive. Note: An ORDER BY statement is generated after the unload SELECT statement for tables that have clustering indexes if the index is included in the strategy. If the clustering index is altered in the strategy, the ORDER BY statement reflects the newly altered index. There is no need to reorganize the tablespace after the data has been loaded. Number Rows Specifies the maximum number of rows to be retrieved. This overrides the data migration option selected at strategy creation time. Data Statistics Specifies whether to perform select counts for rows in tables that are unloaded. Use this option to gauge the volume of data that is unloaded. This option does slow down the process. Valid values are as follows: Y Performs select counts. N Does not perform select counts. This is the default. Note: This field is ignored for REBIND only analyses. Truncate Specifies whether to allow the CA Fast Unload utility to truncate column values that exceed the size of their target columns.

382 User Guide

Analysis Options Panels

Valid values are as follows: N Does not permit CA Fast Unload to truncate column values. This is the default. Y Permits CA Fast Unload to truncate column values. Note: This may result in the loss of data during the unload. More Information: Relationship of MQT REFRESH and ALL ROWS Analysis Options (see page 389)

Model Options The Model Options are used to generate the model utilities for the migration. Specify customized model utilities if desired. Model ID Specifies a model ID if utilities are to be executed as part of the strategy execution. The default is @DEFAULT. If a model ID is specified that contains errors, the General Model Utilities screen automatically displays and the errors are flagged. The model ID can then be corrected for the analysis. These changes are temporary and are not saved. Temporary changes can be saved by using the Update Model option to update the model ID. The temporary changes appear in the model ID. The changes can then be reviewed and the model ID saved. Model Creator Specifies a model creator if utilities are executed as part of the strategy execution. If no model creator is specified, a selection list of model creators that match the model ID criterion appears, or the model creator of the @DEFAULT model ID is used. See Managed Output Maintenance in the “Profile” chapter for more information. Update Model Specifies whether to update the model ID. Valid values are as follows: Y Updates the model ID. The General Model Services screen appears. See Managed Output Maintenance in the “Profile” chapter for more information about model IDs. N Does not update the model ID.

Chapter 10: Analysis 383

Analysis Options Panels

User-Defined Symbolic Parameters Model utilities are used to generate the utilities used to perform the migration. Model utilities are accessed through Model Services. See Managed Output Maintenance in the “Profile” chapter for a complete description of Model Services. These model utilities have symbolic parameters that can be altered. A symbolic parameter must start with a percent sign (%). To have a period separating a symbolic parameter from the next field in the name, two periods must be used. The symbolic parameters are automatically expanded at processing time to full data set names, devices units, or whatever they represent. The symbolic variable capability lets you automatically generate unique data set names without editing the resulting strategy data set or table. Data Set Names A default data set name is set in each model utility. It can be customized by changing the value of the data set symbolic parameters in the appropriate model utility through Model Services. Storage Devices Specify the storage devices to be used by each model utility by customizing the unit symbolic parameter in the appropriate model utility. Space Allocation In all space allocations discussed below, the strategy data set or recovery analysis data set can be edited. Unload Data Sets At execution time, the unload program dynamically determines the amount of space required to hold the unloaded data. A SELECT COUNT is performed to return the number of rows. The total number of rows is multiplied by the table's row size. This technique reduces the initial primary space allocation requested. If CA Fast Unload is used, the data set size is calculated at analysis time by Model Services. Discard and Error Data Sets Any necessary discard and error data sets are allocated to the unit specified in the appropriate model utility symbolic parameter. The space allocation is (CYL,(10,10),RLSE) with a data set disposition of (MOD,CATLG,CATLG). The space allocation statement can be changed in the model utilities. More information: Dataset Delete Options (see page 381)

384 User Guide

Analysis Options Panels

IDCAMS Options The following describes the IDCAMS options on the Analysis Options panels: VSAM Defines Specifies whether to generate the necessary IDCAMS DEFINE statements for tablespaces and indexes that require them. A define is required for migrations that involve a DB2 subsystem change or a change that affects the VSAM data set. Valid values are as follows: Y Generates the DEFINE statements. N Does not define any VSAM data sets. VSAM Deletes Specifies whether to delete any existing VSAM data sets. Y Deletes any existing VSAM data sets that are explicitly defined in the migration. The IDCAMS DELETEs are done before object creation and after any unloads or drops. N Saves VSAM data sets. CA RC/Migrator performs VSAM defines and deletes automatically as part of migrations. See VSAM Defines and Deletes next.

VSAM Defines and Deletes VSAM deletes and defines are automatically generated when the user selects the VSAM Define/Delete option, and the strategy performs one or more of the following actions. ■

Edits a tablespace or indexspace and changes its definition from storage group to VCAT.



Performs a global change from storage groups to VCAT.



Changes the name of a tablespace, indexspace, or database and the object is explicitly defined (it currently exists in a user-defined VSAM data set). When the database name, tablespace name, or indexspace name is changed, the VSAM defines must be reissued, because those names are part of the DB2-generated VSAM data set names.

Chapter 10: Analysis 385

Analysis Options Panels

If Y is specified for the VSAM DEFINE and VSAM DELETE analysis options, any necessary VSAM DELETEs and DEFINEs are made as part of the strategy analysis. The following table details the DELETEs and DEFINEs made when the DELETE and DEFINE VSAM options are specified on the Analysis Options panel. If N (no) is specified for these options, no DELETES or DEFINES are made. In the Storage column, “Old” represents the old object storage definition, and “New” represents the new object storage definition. The Storage column describes whether implicit storage (Storage Group) or explicit storage (VCAT) is used. “EX” represents explicit storage; “IM” represents implicit storage. The VSAM data set changes necessary are listed under the Migration Strategy and Alteration and Compare Strategies columns. “None” indicates that no VSAM DELETEs or DEFINEs are made. The table results are based on the following assumptions: ■

The Drop Objects analysis option is set to Y for migration strategies.



The Drop & Re-create analysis option is set to Y for alteration and comparison strategies.

Storage

Migration Strategy

Alteration and Compare Strategies

Old EX

None

Delete old

Old IM

Delete New

Define New

New EX

Define New

Old EX

Delete New

Delete Old

New EX

Define New

Define New

Old IM

None

None

New IM

New IM For example, the third Migration Strategy entry is for a migration strategy where the object definition uses explicit storage for both the source (Old) and the target (New). In this case, the VSAM data sets on the target system with the new VSAM data set name are deleted. Then, new VSAM data sets are defined on the target subsystem. When defining the data set, it is determined whether the data set is SMS-controlled. If so, the SMS information is used, and no VOLUME and CATALOG parameters are generated. If there is no SMS information, the VCAT name is placed in the CATALOG parameter and a VOLUME parameter that is the same as the source data set.

386 User Guide

Analysis Options Panels

For the VSAM DEFINE and VSAM DELETE statements to be generated when altering and comparing underlying data sets of user-managed tablespaces/indexes, a reorg must be requested during analysis. A reorg can be requested by entering the appropriate option in the REORG field under Utility Options on the RC/M Strategy Analysis Options panel.

Exclusive Options The following describes the exclusive option fields on the Analysis Options panels: No .AUTHS Specifies whether to generate an output with no Batch Processor .AUTH statements. Valid values are as follows: Y Generates the analysis output with no .AUTH statements. All options are generated as usual, but with no .AUTHs. Use this option if the analysis output contains no statements requiring APF authorization and the strategy is to be executed online. Note: CA RC/Migrator might not be able to re-create objects as they currently exist. Also, the user ID executing the analysis output or recovery must hold the necessary authority to perform all statements. N Generates the analysis output with the .AUTH statements generated as needed. BND/DAT/SQL/STAT/GRNT/RI Specifies one of the following options. Valid values are as follows: B Binds or rebinds only control cards for all affected plans in a given strategy. B or R must have been specified in the (B)ind/(R)ebind field for this option to be valid. The binds or rebinds (and, optionally, the statistics utility) are the only analysis output. This permits plan performance optimization. D Migrates data only (no objects). Utility options cannot be selected if you are migrating only data. This is useful for refreshing test tables with subsets of production data. When data only is specified in a migration strategy, and the Control Options field RI is set to L or G, referential integrity is retrieved from DB2, and the tables are loaded in parent-child order. If the Check Data Utility Options field is set to Y, a check data utility is generated for tables that are in cyclical referential relationships.

Chapter 10: Analysis 387

Analysis Options Panels

R Generates statistics only. The result is also affected by the setting in the STATS field (in the Utility Options area). The STATS field must be set to Y, S, or A. S Generates SQL only, with no Batch Processor commands (such as .SYNC, .AUTH, and so on) included. This generates a snapshot of the DDL/DCL of the objects in the strategy. It is useful because DDL can be executed through ISQL without the Batch Processor commands. A DDL-only data set or table can also serve as a backup of the DB2 objects. G Generates only .AUTH and GRANT statements for objects selected in the analysis, enter G in this field and Y in the Security field. I Generates only foreign key alters for table objects associated with the referential integrity structure specified in the migration strategy. Check Data can be specified in the Utility Option field. The following selections on the Strategy Analysis Options panel are ignored: Drop Objects; Image Copy; Bind; Recover Index; and all Data Unload, Dataset Delete, and VSAM Options. N Does not request an ONLY option. This is the default. Commit ASAP Specifies when to issue COMMIT statements. This option is valid only when the SQL Only option is chosen. (The COMMIT ASAP is not necessary for Batch Processor jobs, because implicit COMMITs are made at each .SYNC command.) When SQL Only is chosen, one COMMIT is issued after all object drops. An implicit COMMIT is also made at the DISCONNECT. Choose to COMMIT all statements as soon as possible by entering Y in the Commit ASAP field. The default is N (No).

388 User Guide

Analysis Options Panels

Relationship of MQT REFRESH and ALL ROWS Analysis Options This section describes interactions between the following analysis options: MQT REFRESH Specifies whether to generate REFRESH TABLE DDL for materialized query tables (MQTs). ALL ROWS Specifies whether to generate UNLOAD and LOAD sequences for all tables in a strategy. Note: CA RC/Migrator generates CREATE MQT DDL with query optimization disabled. DB2 will not select the MQT to resolve a query until the MQT has been enabled for query optimization. This prevents queries from returning unexpected results because of an empty MQT. If the MQT is in a state with query optimization enabled, CA RC/Migrator retains this state by generating an ALTER TABLE ALTER MQT EFQO command following all refresh and load statements. Otherwise, the MQT is left in a state with query optimization disabled. The following table describes the behavior of the MQT REFRESH option when interacting with the ALL ROWS option in a strategy. The actions that are taken depend on the specified value for each option and whether the object is a system-maintained MQT or user-maintained MQT. A Y in the Enable for Query Optimization column indicates eligibility for the ALTER TABLE ALTER MQT EFQO command, depending on the MQT's original state (query optimization enabled or query optimization disabled).

System-Maintained MQT

User-Maintained MQT

MQT REFRESH Setting

All ROWS Setting

Refresh

Load

Enable for Query Optimization

Refresh

Load

Enable for Query Optimization

N

Y

N

N

N

N

Y

Y

N/A

N

N

N

N

N

N

N

Y

Y

Y

N

Y

N

Y

Y

N/A

N

Y

N

Y

N

N

N

B

Y

Y

N

Y

Y

N

Y

N/A

N

Y

N

Y

Y

N

Y

U

Y

N

N

N

Y

N

Y

Chapter 10: Analysis 389

Analysis Options Panels

System-Maintained MQT

User-Maintained MQT

MQT REFRESH Setting

All ROWS Setting

Refresh

Load

Enable for Query Optimization

Refresh

Load

Enable for Query Optimization

N/A

N

N

N

N

Y

N

Y

More Information: Control Options (see page 369) Data Unload Options (see page 381)

How to Use RTN IMPLODE and RTN INTERACTION During Analysis Depending on settings, the RTN INTERACTION analysis option can forcibly override the RTN IMPLODE option. This override can occur regardless of how a strategy was originally built. If RTN INTERACTION contains a value of N or A, any RTN IMPLODE specification becomes irrelevant at analysis time. However, RTN INTERACTION=Y lets you honor the original strategy creation choices and the RTN IMPLODE analysis option setting. The process is as follows: 1.

You create a strategy and determine implode options while selecting objects for the strategy. For example, you can create a strategy and perform an autobuild on a database (which means you expect all dependent objects to be included).

2.

You analyze the strategy, at which point you can set and update the analysis options (including RTN IMPLODE and RTN INTERACTION). For example, you can do the following:

390 User Guide



Specify RTN IMPLODE=A to include routines referenced by views and triggers.



Specify RTN IMPLODE=T to include routines referenced by triggers.



Specify RTN IMPLODE=V to include user-defined functions referenced by views.

Recovery Option

3.

Depending on chosen settings, the RTN INTERACTION option overrides anything specified at strategy creation (while also overriding the RTN IMPLODE parameter), or it honors the RTN IMPLODE setting. As previously mentioned, RTN INTERACTION=Y lets you honor the original strategy creation choices and the RTN IMPLODE analysis option setting. Some recommended settings are as follows: ■

If you want to include all objects, specify RTN IMPLODE=A, then specify RTN INTERACTION=Y to honor the choices made at strategy creation time and honor the RTN IMPLODE specification.



If you do not want to include routines in the DDL, specify RTN INTERACTION=N.



If you want to also include routines that are not selected in the strategy, specify RTN INTERACTION=A. Note: The RTN INTERACTION=A specification is useless if autobuild is used to build the strategy (as opposed to specifically selecting objects).

More Information: Control Options (see page 369)

Recovery Option The Recovery option permits recovery from a strategy execution. Using the Recovery option, all objects in the strategy can be returned to their original versions and newly created objects can be dropped. This is useful when the new versions of the objects are not needed and there is a desire to return to the previous versions. The Recover option is also useful when part of a strategy analysis has been executed. The Recovery option enables the executed portion to be undone and returned to the original object versions.

Chapter 10: Analysis 391

Recovery Option

Executing If you specify the Recovery option, CA RC/Migrator creates a strategy that has three parts. Part of a sample strategy analysis output follows. .AUTH B0625TO .CALL UNLOAD .DATA [1]

* * * .ENDDATA .SYNC 5

'UNLOAD TABLE B0625TO.EMP'

.SYSTEM SQLDDL .CONNECT PTI2 [2]

.CALL SNAPSHOT .ALLOC FI(RCVRFILE) + DA('B0625TO.PIPE.TST(RECOVER1)') OLD .DATA .AUTH B0625TO DROP TABLE B0625TO.EMP; .SYNC TABLE

B0625TO

EMP

.AUTH B0625TO DROP ALIAS B0625TO.TABEMP; .SYNC ALIAS

B0625TO

TABEMP

.AUTH B0625TO DROP ALIAS B0625TO.TWOVIEW; .SYNC

392 User Guide

Recovery Option

ALIAS

B0625TO

TWOVIEW

RECREATE STRTSSID PTI2 DELTEMP DELUNLD HEADER LOG TRAILER UNLOAD GENUNIT SYSDA SQLID B0625TO UNLDDSN PTI.%TBNAME..RECDATA UNLDUNIT SYSDA UNLDLBL 1,SL,EXPDT=90032 .ENDDATA .FREE FI(RCVRFILE) .SYNC 10 [3]

.AUTH B0625TO DROP TABLE B0625TO.EMP;

Note the following areas on the strategy analysis output: ■

[1] UNLOAD—The first part of the strategy unloads the data that is needed to load the migrated objects. For this example, the actual UNLOAD syntax is replaced with asterisks (* * *).



[2] SNAPSHOT—The second part of the strategy calls the SNAPSHOT program, which gathers information about the objects being migrated. When the migration is executed, SNAPSHOT generates the commands necessary to create the recovery output. SNAPSHOT first allocates the recovery file, and then unloads the object data if needed. The UNLOAD program is called internally through SNAPSHOT. So while no UNLOAD commands are included in this part of the strategy when executed, unloads are performed. The Batch Processor output displays the tables being unloaded. The commands that appear in the SNAPSHOT .DATA section are the commands that perform the recovery. These commands drop the altered version of an object, re-create the original version, and load the original data. The commands are not executed when the strategy is executed, but instead are written to the recovery output along with all other necessary information. The RECREATE portion of the SNAPSHOT program provides the recovery option information needed to correctly generate the recovery output. When the recovery output is executed, the commands are executed to recover the original version of the object and restore the environment.

Chapter 10: Analysis 393

Recovery Option

Once all necessary information is written to the recovery output, the output is freed. The recovery output is the same as an ordinary strategy except that the UNLOADs for the objects have already been performed. Note: If the recovery output is directed to a table managed by CA RC/Migrator instead of a data set, the file allocation statement after the .CALL SNAPSHOT is replaced by a table identification. For more information about output managed by CA RC/Migrator, see Managed Output in the “Analysis Output” chapter. ■

[3] Migration Commands—The third part of the analysis output contains the commands that, when executed, performs the requested migration, alteration, or comparison. See the “Analysis Output” chapter for more information about the format of the migration analysis data set.

In the following example, the recovery output is directed to a table managed by CA RC/Migrator. Note the parameters in the continuation of the .CALL SNAPSHOT statement. These are parameters that identify the recovery output. Do not change these parameters while editing an analysis. (If the output is going to a data set instead of a table managed by CA RC/Migrator, the .CALL SNAPSHOT statement does not have parameters, but is immediately followed by the .ALLOC statement, as in the first example.) .AUTH B0625TO .CALL UNLOAD .DATA [1]

* * * .ENDDATA .SYNC 5

'UNLOAD TABLE B0625TO.EMP'

.SYSTEM SQLDDL .CONNECT PTI2

394 User Guide

Recovery Option

[2]

.CALL SNAPSHOT PARM(D81A,PDANGIA ,AC5072

,PDANGI

,1995121816121243,25010)

.DATA .AUTH B0625TO DROP TABLE B0625TO.EMP; .SYNC TABLE

B0625TO

EMP

.AUTH B0625TO DROP ALIAS B0625TO.TABEMP; .SYNC ALIAS

B0625TO

TABEMP

.AUTH B0625TO DROP ALIAS B0625TO.TWOVIEW; .SYNC ALIAS

B0625TO

TWOVIEW

RECREATE STRTSSID PTI2 DELTEMP DELUNLD HEADER LOG TRAILER UNLOAD GENUNIT SYSDA SQLID B0625TO UNLDDSN PTI.%TBNAME..RECDATA UNLDUNIT SYSDA UNLDLBL 1,SL,EXPDT=90032 .ENDDATA .FREE FI(RCVRFILE) .SYNC 10 [3]

.AUTH B0625TO DROP TABLE B0625TO.EMP;

If the Recovery option is set to Y (ON) and data is being saved, enough space is required for two full sets of data: ■

The object migration unload data set



The recovery unload data set

If there is concern about the usage of additional space by the recovery unload data set, send the recovery unload data set to tape. To do this, enter TAPE as the unit for the unload model utility through the Model Services screen. See the “Profile” chapter for more information about Model Services.

Chapter 10: Analysis 395

Recovery Option

Recovery Options Screen The Recovery Options screen is like the Analysis Options panels, except it lets you select options for the recovery output. This screen appears when Y or U is entered in the Recovery field of a strategy analysis screen. The recovery output contains the commands necessary to recover from the migration, including dropping the migrated objects (and their data and dependents) and recreating the objects in their original state. Any utilities requested as recovery options are executed against the newly created originalversion objects during the execution of the recovery output. The recovery options appear in the RECREATE section of the analysis output. The Recovery Dataset Specifications fields let you enter information about the recovery output. Note: For detailed descriptions, see the online help. To toggle the analysis output fields on this screen from output managed by CA RC/Migrator to a data set, and vice versa, use the primary command O (for Output). Note: For more information about managed output, see the “Analysis Output” chapter. More information: Analysis Options Panels (see page 367)

Recovery Processing When a recovery strategy is executed, the following actions are taken in the order specified to help ensure that the original versions of the objects are re-created successfully.

396 User Guide

1.

Drop newly created objects.

2.

Delete newly created user-defined VSAM data sets.

3.

Alter any objects that were altered in the strategy back to their original version if they can be altered.

4.

Create the original versions of any objects that were dropped in the strategy. Perform VSAM Defines as needed.

5.

Load the original data back into the original versions of the tables. The original data is unloaded and saved through the SNAPSHOT program when the strategy is executed and the recovery data set is generated.

Valid PARMFILE DD Analysis Parameters for Any Strategy

Any requested utilities are then executed.

Valid PARMFILE DD Analysis Parameters for Any Strategy The following parameters can be found in the PARMFILE DD of analysis JCL and are presented as a reference. Important! Only experienced users should alter these parameters. Unpredictable results and errors can result when CA RC/Migrator executes incorrectly modified JCL. Altering these parameters might become necessary for batch jobs that evolve over time. For example, if a generated batch job has been cloned and edited for several different DB2 subsystems, parameters might have changed as a site's needs for each subsystem changed.

Creator, Strategy Name, and Strategy Location Specifications These parameters control creator, name, and location of the strategy. CREATOR Specifies the creator of the strategy. This parameter is required. The creator name can be up to eight characters. STRATEGY Specifies the name of the strategy that is created. This parameter is required. The strategy name can be up to eight characters. STRTSSID Specifies where the strategy is stored. This parameter is required.

Execution Specifications These parameters control strategy execution. OVERRIDE Specifies whether to re-use the data set or analysis output named in the output data set Specifications section of the Strategy Analysis screen. RECOVERY Specifies whether recover analysis should be prepared at analysis time.

Chapter 10: Analysis 397

Valid PARMFILE DD Analysis Parameters for Any Strategy

Access Specifications These parameters control strategy access. ACM Specifies whether to use alternate catalog tables to perform the analysis. PDS Specifies whether to use the PDS option as defined in hlvl.PARMLIB(Migrator) when accessing the DB2 catalog.

Output Analysis Specifications These parameters help manage control analysis output. OUTPUT DDL_TABLE Specifies that analysis output is stored in managed output. COMPRESS B Specifies to compress blanks in the output. PREFIX Specifies an output prefix.

Control Parameters These parameters manage various aspects of executing a strategy. SECURITY Specifies to include all security. SQLID Specifies the default SQL ID. ASQLID Specifies the default alias SQL ID. DROPALL Specifies to drop and re-create all objects that have changed. REGVIEW Specifies to regenerate VIEW statements to be produced for views that are affected by an ALTER TABLE statement. RTNIMP Specifies whether to include the parent objects of routines in the strategy (known as imploding the routines).

398 User Guide

Valid PARMFILE DD Analysis Parameters for Any Strategy

Data Unload Parameters These parameters help manage unload activities. UNLOAD Specifies to perform an UNLOAD and LOAD for all tables. NUMDATA Specifies the maximum number of rows to unload. DATASTAT Specifies to issue a SELECT COUNT (*) statement for each table. TRUNCATE Allows data truncation to occur when running the Fast Unload utility.

Exclusive Parameters These parameters help manage strategy statements. NOAUTHS Specifies to not allow .AUTH statements. DDLONLY Specifies to generate native DB2 SQL only (no utilities). COMMIT Specifies to commit all statements as soon as possible.

Utility Parameters These parameters help manage utilities. RUNSTATS Specifies to run the runstats utility. CHEKDATA Specifies to run the check utility. IMAGCOPY Specifies to run the copy utility. IMAGCOPY PARTITION Specifies to run the copy utility with partition independence.

Chapter 10: Analysis 399

Valid PARMFILE DD Analysis Parameters for Any Strategy

BIND Specifies to bind any plans and/or packages. REBIND Specifies to rebind any plans and/or packages. RECOVIX Specifies to include recover index utilities. REORGTS Specifies to reorg the tablespace. REORGIX Specifies to reorg the index.

Output Listing Parameters These parameters help manages analysis content. HEADER Specifies to print the header in analysis. TRAILER Specifies to print an impact analysis. REPINDDL Specifies to print a change analysis.

Data Set Delete Parameters These parameters determine whether to delete data sets. DELUNLD Specifies to delete the unload data sets. DELTEMP Specifies to delete the temporary data sets.

400 User Guide

Valid PARMFILE DD Analysis Parameters for Any Strategy

Idcam Parameters These parameters help manage VSAM statements. DEFVSAM Specifies to generate the necessary DEFINE statements. DELVSAM Specifies to delete explicitly defined VSAM data sets.

Model Parameters These parameters help manage the model ID. MODEL4 Specifies the model ID. MODEL4C Specifies the creator of the model ID.

Ruleset Specifications These parameters help manage the rule set. RULESET Specifies the rule set name. RULECR Specifies the creator of the rule set name.

Global Change Sets These parameters help manage the global change set. GLBLNAME Specifies the global change set name. GLBLCRTR Specifies the creator of the global change set name. Note: Additional global change settings will follow GLBLNAME and GLBLCRTR in your output.

Chapter 10: Analysis 401

Valid PARMFILE DD Analysis Parameters for Any Strategy

Control Parameters for Recovery Analysis These parameters manage various aspects of a strategy for recovery analysis. RSECURIT Specifies to include all security. RSQLID Specifies the default SQL ID. RDROPALL Specifies to drop and re-create all objects that have changed. RREGVIEW Specifies to regenerate VIEW statements to be produced for views that are affected by an ALTER TABLE statement.

Data Unload Parameters for Recovery Analysis These parameters help manage unload activities for recovery analysis. RUNLOAD Specifies to perform an UNLOAD and LOAD for all tables. RNUMDATA Specifies the maximum number of rows to unload.

Exclusive Parameter for Recovery Analysis This parameter helps manage strategy statements for recovery analysis. RNOAUTHS Specifies to not allow .AUTH statements.

Utility Parameters for Recovery Analysis These parameters help manage utilities for recovery analysis. RRUNSTAT Specifies to run the runstats utility. RCHEKDAT Specifies to run the check utility.

402 User Guide

Valid PARMFILE DD Analysis Parameters for Any Strategy

RIMAGCOP Specifies to run the copy utility. RBIND Specifies to bind any plans and/or packages. RREORGTS Specifies to reorg the tablespace. RREORGIX Specifies to reorg the index.

Output Listing Parameters for Recovery Analysis These parameters help manages analysis content for recovery analysis. RHEADER Specifies to print the header in analysis. RTRAILER Specifies to print an impact analysis.

Data Set Delete Parameters for Recovery Analysis These parameters determine whether to delete data sets for recovery analysis. RDELUNLD Specifies to delete the unload data sets. RDELTEMP Specifies to delete the temporary data sets.

Output Analysis Specifications for Recovery Analysis These parameters help manage output for recovery analysis. RCVRDSN Specifies the recovery analysis data set. OUTPUT REC_TABLE Specifies that recovery analysis output is stored in managed output.

Chapter 10: Analysis 403

Valid PARMFILE DD Analysis Parameters for Any Strategy

Model Parameters for Recovery Analysis These parameters help manage the model ID for recovery analysis. RMODEL4 Specifies the model ID. RMODEL4C Specifies the creator of the model ID.

404 User Guide

Chapter 11: Incremental Change Language This section contains the following topics: Overview of ICL (see page 405) Producing the ICL (see page 406) Producing DDL from ICL (see page 409) Group ICL to DDL (see page 416) Submitting the DDL (see page 418) Import ICL (see page 419) ICL Command Syntax (see page 421)

Overview of ICL A regular analysis of a strategy produces data definition language (DDL). For alteration and compare strategies, the ICL option can be used from the Strategy Services panel to analyze a strategy and produce Incremental Change Language (ICL) statements instead of Data Definition Language (DDL). ICL statements document only the changes performed to a particular DB2 object. An ICL analysis can be performed on any alteration or compare strategy. The ICL that the analysis produces can then be used as input to CA RC/Migrator, and the changes are applied to objects that exist on a DB2 subsystem. When applying or analyzing ICL against a set of DB2 objects, the Data Definition Language (DDL) and Data Manipulation Language (DML) statements are created to make changes to the objects on the subsystem. These statements can then be executed through the Batch Processor to perform the actual changes. The following examples illustrate ICL's usefulness. ■

Two people make different changes to the same object. The changes can be isolated in ICL and applied to production at different times.



The same set of objects exists on many subsystems. A change can be encapsulated in ICL on one subsystem and applied to several subsystems. This preserves any local modifications made to the objects on each subsystem.



A software vendor sends a new release containing modifications to that vendor's DB2 objects. Using an ICL analysis, the old version's DDL and new version's DDL can be compared. The resulting ICL contains only the changes between the two versions. The ICL can then be applied to the existing version of the vendor's objects. This keeps all local modifications in place.

Chapter 11: Incremental Change Language 405

Producing the ICL

Producing the ICL To perform an ICL analysis, enter I in the O (Option) field on the Strategy Services panel. The Strategy Type (TP) must be A (Alteration) or C (Compare). For detailed information about the other fields, see Strategy Services panel in the “Strategy Services Facility” chapter. Press Enter to display the ICL analysis screen. Note: If a table managed by CA RC/Migrator is being used instead of a data set, the ICL Output Dataset Specification fields are different than the ones in the preceding example. For detailed information about the analysis screen fields, see the “Analysis” chapter. When the appropriate fields are filled in and the execution method is chosen, press Enter to begin the analysis. If batch execution was selected, the Batch JCL Specification panel appears. If online execution was selected, the Online Analysis Wait screen shows information about the analysis in progress. When the online analysis is complete, the message file appears. When finished reading the message file, press PF3 to display the analysis output data set. The ICL section of the analysis output is described next in ICL Analysis Output.

ICL Analysis Output ICL Analysis output has two parts: the message file and the ICL analysis output file. ■

The message file contains analysis messages. Also, after the messages, the Change Analysis Report appears unless otherwise selected. This report shows all changes to all objects, and includes the maskset and ruleset used with the analysis.



The ICL analysis output file contains the ICL statements necessary to produce the compare or alteration. It is like the regular compare or alteration strategy analysis output, except that it does not include utilities. The file is divided into three parts: the header, the ICL statements, and the impact analysis. Also, if selected, the Change Analysis Report follows in this data set instead of in the message file.

The Analysis Message File displays first after the online analysis is complete. If the RPT IN DDLFILE field of the ICL Analysis screen is set to N, this message file also contains the Change Analysis Report. The message file is deleted after PF3 (End) is pressed to exit, but the QPRINT command can be used to print the contents if hardcopy is desired. The ICL Analysis Report appears automatically after you press PF3 to exit the Analysis Message File.

406 User Guide

Producing the ICL

The ICL Analysis Report data set can be browsed or edited from the Strategy Services panel. The data set name is associated with its strategy name. Enter E (Edit) or B (Browse) as a line command next to the data set name. The following examples illustrate the report header and excerpts from the ICL statements generated from a strategy named COMPSAMP.

ICL Analysis Report Header The following is a sample from the beginning of the ICL Analysis Report. The analysis header gives information about the strategy used to generate the output, including the analysis options.

ICL Statements The ICL Statements section of the ICL analysis defines the CREATE, ALTER, and DROP actions indicated in the analyzed alter or compare strategy. The ICL statement types are: ■

DROP—Object is explicitly dropped and not re-created.



CREATE—New object is created. The ICL CREATE syntax is identical to the DB2 CREATE syntax.



ALTER—Specifies the differences or changes made to an object. All attributes of an object can be changed with the ICL ALTER statement.

These ICL statements are used to create the DDL necessary to make object changes according to the strategy. For instructions on generating DDL from ICL, see Producing DDL from ICL. Before producing the DDL, experienced users can edit or add ICL statements without updating the strategy or running the analysis again. See ICL Command Syntax for syntax examples.

Impact Analysis The Impact Analysis follows the ICL statements in the ICL Analysis Output if requested on the ICL analysis screen. It contains the number of each object type included in the strategy, the name and creator of each object, and, for edited objects and objects changed through global changes, the old and new name and creator ID. Edited objects are flagged. Additionally, for table data, the number of rows per table included in the strategy and the total number of rows are included if data statistics were requested.

Change Analysis Report The Change Analysis Report shows all changes to objects in the strategy, including Currently and Changed To columns to indicate the changes. This report displays if Y is selected in the RPT IN DDLFILE on the ICL Analysis screen. Otherwise, it appears at the end of the message file.

Chapter 11: Incremental Change Language 407

Producing the ICL

The Change Analysis Report also contains the compare ruleset and maskset in effect for the analysis (see the following two examples). --============================= COMPARE RULES ========================== --RULESET NAME ===> @DEFAULT -RULESET CREATOR ===> --OBJECT ATTRIBUTE RULE ------------------STOGROUP CREATEDBY Y -CREATOR Y -NAME Y -VCAT Y -PASSWORD Y -VOLUMES Y -DATABASE CREATEDBY Y -CREATOR Y -NAME Y -STOGROUP Y -BUFFERPOOL Y -ROSHARE Y -TABLESPACE CREATEDBY Y -CREATOR Y -NAME Y

The following shows maskset information: --============================= AUTOMAPPING MASKS ====================== --MASKSET NAME ===> @DEFAULT -MASKSET CREATOR ===> USER06 --OBJECT SOURCE MASK TARGET MASK ---------------------------STOGROUP -CREATOR = = -NAME = = -DATABASE -CREATOR = = -NAME = = -TABLESPACE -CREATOR = = -NAME = = -TABLE -CREATOR = = -NAME = = -COLNAME = = -INDEX -CREATOR = =

408 User Guide

Producing DDL from ICL

Producing DDL from ICL To produce DDL from ICL, analyze the output generated by the ICL analysis. This analysis uses the ICL statements as input and generates the DDL data set or managed DB2 table as output. After the analysis, the DDL data set or managed output can be browsed or edited from the Strategy Services panel by entering E (edit) or B (browse) next to the analysis output.

Select the ICL Output for Analysis To analyze the ICL, use the Strategy Services panel to display the name of the strategy that you originally analyzed to produce the ICL. The output items associated with that strategy are indented under the strategy name. An identifier precedes the output names. The ICL identifier indicates output containing ICL statements. After ICL analysis, the output containing the DDL is preceded by the target DB2 SSID instead of the ICL identifier. To select the ICL output for analysis 1.

Enter A (analyze) next to the appropriate ICL output on the Strategy Services panel and press Enter. The ICL to DDL Analysis screen appears.

2.

Specify ICL input and DDL output data set specifications. See ICL Input and DDL Output for more information about these fields. For more information about the other analysis fields, see the online help or the “Analysis” chapter. If using managed output instead of a data set, the ICL input or output specifications fields can be different.

3.

After you enter the appropriate fields and choose the execution method, press Enter to begin the ICL to DDL analysis. If batch execution is selected, the Batch JCL Specification panel appears. If online execution is selected, the Online Analysis Wait screen shows information about the ICL to DDL analysis in progress.

Chapter 11: Incremental Change Language 409

Producing DDL from ICL

ICL Input The following describes the ICL Input Dataset Specifications fields: EDIT DATASET Specify whether to edit a data set immediately. Valid only for online mode. The DDL data set can also be edited after online analysis has finished. ■

Y—Edit the data set immediately. The name must be entered in the Dataset Name field before pressing Enter.



N—(Default) Do not edit the data set.

DATASET NAME Enter the fully qualified name of the data set to contain all commands necessary to perform the strategy. Use a PDS or sequential file. The data set must already exist and be defined as LRECL=80 and RECFM=F or FB. Note: A default PDS can be specified through the CA RC/Migrator profile variables. See the “Profile” chapter for more information. VOLUME SERIAL Specify a volume serial ID if the data set is not cataloged. More information: Invoking Group ICL to DDL Analysis (see page 416)

DDL Output The following describes the DDL Output Dataset Specifications fields: EDIT DATASET Specify whether to edit the ICL analysis. ■

Y—Edit the ICL analysis.



N—(Default) Do not edit the ICL analysis.

DATASET NAME Enter the name of the PDS to contain all the commands necessary to perform the strategy. For the Strategy Analysis screen for group migration, the data set name cannot include a member name. This is because the output data set for a group migration contains multiple members, and CA RC/Migrator generates the member names. If the data set entered in this field does not already exist or cannot be found, it can be allocated. The Output Dataset Allocation screen appears, which lets you define parameters for allocating the data set. Note: A default PDS can be specified through the CA RC/Migrator profile variables. See the “Profile” chapter for more information.

410 User Guide

Producing DDL from ICL

VOLUME SERIAL Specify a volume serial ID if the output data set is not cataloged. Otherwise, leave it blank. If using a table managed by CA RC/Migrator instead of a data set, the input and output specifications fields are different from the ones in the preceding example. More information: Invoking Group ICL to DDL Analysis (see page 416)

ICL to DDL Analysis Output Like the ICL analysis, the ICL to DDL analysis output has two parts: the message file and the ICL to DDL analysis output file. ■

The message file contains any analysis messages. The message file also contains error messages that occurred when the ICL was applied to the objects on the target subsystem. In this case, CA RC/Migrator bypasses any ICL statement found to be in error, lists the error message, and issues a return code of 8. After the messages, the Change Analysis Report appears unless selected otherwise. This report shows all changes to all objects, and includes the maskset and ruleset used with the analysis.



The ICL to DDL analysis output file contains the DDL statements necessary to produce the compare or alteration. The file is divided into three parts: the header, the DDL statements, and the impact analysis. Also, if selected, the Change Analysis Report follows in this data set instead of the message file.

The Analysis Message File displays after the online analysis is complete. If the RPT IN DDLFILE field of the Strategy Analysis Options field is set to N, this message file also contains the Change Analysis Report. The message file is deleted after you press PF3 (End) to exit, but you can use the QPRINT command to print the contents. The ICL to DDL Analysis Report appears automatically after PF3 is pressed to exit the Analysis Message File. The ICL Analysis Report can be browsed or edited from the Strategy Services panel. The analysis output name is associated with its strategy name. Enter E (Edit) or B (Browse) as a line command next to the output name.

Chapter 11: Incremental Change Language 411

Producing DDL from ICL

ICL to DDL Analysis Report Header This is the beginning of the ICL to DDL Analysis Report. .CONTROL SN(USER06,COMPSAMP)

--====================================================================== -- VPxxxAA

ICL ANALYSIS REPORT

07-06-01 15:

--====================================================================== --STRATEGY INFORMATION: --STRATEGY ==> COMPSAMP

TRG SSID

--CREATOR

TRG LOCATION ===> LOCAL

==> USER06

===> D81A

---ALTERED OBJECTS: --

OBJECT TYPE

NAME

CREATOR

--

DATABASE

DSN8D81A

USER06

--

TABLESPACE

DSN8S31D

DSN8D81A

--

TABLESPACE

DSN8S31E

DSN8D81A

--

TABLE

EACT

DSN8810

--

INDEX

XEMP1

DSN8810

--

VIEW

VPHONE

DSN8810

---ANALYSIS OPTIONS: --

EXECUTION MODE

--

ANALYSIS OVERRIDE ===> N

===> O (O

- ONLINE, B

- BATCH)

--

ANALYSIS OVERRIDE ===> N

--

ACCESS MODE

===> VSAM

--

MODEL ID

===> @TIM

--

MODEL CREATOR

===> USER06

--

SECURITY

===> N

STATISTICS

===> N

--

DEFAULT SQLID

===>

CHECK DATA

===> N

--

NO SET SQLID STMT ===> N

IMAGE COPY

===> N

BIND/REBIND

===> N

--

---

ALL ROWS

===> N

REORG

===> N

--

NUMBER ROWS

===>

RECOVER IX

===> N

--

DATA STATISTICS

===> N

--

NO .AUTHS

===> N

--

SQL ONLY

===> N

--

COMMIT ASAP

===> N

--

---

DELETE UNLOAD DATASETS

--

DELETE TEMPORARY DATASETS ===> N

===> N

---********************** END OF ANALYSIS HEADER ************************

412 User Guide

Producing DDL from ICL

[1]

RMA250E THE INPUT ICL FILE CONTAINED ERRORS. ALL STATEMENTS FOUND IN ERROR WERE BYPASSED: ALTER TABLE DSN8810.EACT ADD COLUMN

COL4

FOLLOWS COL1 CHAR ( 5 )

************************************************************************ DDL00404: Column COL4 already exists in this TABLE and cannot be added. ************************************************************************ MIGRATOR ANALYSIS COMPLETED, RETURN CODE =

8

******************************** BOTTOM OF DATA *****************************

Syntax checking is performed when applying an ICL statement to an object to make sure it can be altered. The resulting messages display in the message file at the point indicated by [1], and are saved in the ICL to DDL analysis output.

ICL to DDL Analysis Output Sample A sample of the ICL to DDL analysis output is shown in the following example. --RMA233W NO UNLOADS HAVE BEEN GENERATED DURING THIS ANALYSIS. .SYSTEM SQLDDL .CONNECT D81A .AUTH DCMIKE DROP TABLESPACE DSN8D81A.DSN8S31E; .SYNC 5

'DROP TABLESPACE DSN8D81A.DSN8S31E'

.AUTH DCMIKE DROP TABLE DSN8810.EACT; .SYNC 10

'DROP TABLE DSN8810.EACT'

-- ************************************************************** -- *

*

-- * DATABASE CREATE AND ALTER STATEMENTS

*

-- *

*

-- **************************************************************

Chapter 11: Incremental Change Language 413

Producing DDL from ICL

-- DSN8D81A.DSN8S31D WILL BE ALTERED VIA THESE NATIVE DB2 COMMANDS.

.AUTH DCMIKE ALTER TABLESPACE DSN8D81A.DSN8S31D FREEPAGE 10 PCTFREE 15 ; .SYNC 20

'ALTER TABLESPACE DSN8D81A.DSN8S31D'

.CALL DSN PARM(D81A) .DATA .DATA -STO DB(DSN8D81A) SPACE(DSN8S31D) .ENDDATA ALTER TABLESPACE DSN8D81A.DSN8S31D USING STOGROUP DSN8G310 PRIQTY 100 SECQTY 100 ;

.CALL DSN PARM(D81A) .DATA -STA DB(DSN8D81A) SPACE(DSN8S31D) ACCESS(RW) .ENDDATA

Incremental Change Analysis Report The Incremental Change Analysis Report shows all changes to objects in the strategy, including Currently and Changed To columns to indicate the changes. This report is included here if Y is selected in the RPT IN DDLFILE field on the Strategy Analysis Options panel. Otherwise, it appears at the end of the message file. The following example illustrates the beginning of the Incremental Change Analysis Report as a result of the ICL to DDL analysis for strategy COMPSAMP.

414 User Guide

Producing DDL from ICL

--====================================================================== --= VPxxxAA

CA INCREMENTAL CHANGE ANALYSIS REPORT

-====================================================================== ---************************** SELECTED OBJECTS ************************** --

OBJECT TYPE

NAME

CREATOR

--

-----------

----

-------

--

DB

DSN8D81A

DCMIKE

--

TS

DSN8S31D

DSN8D81A

--

TS

DSN8S31E

DSN8D81A

--

T

EACT

DSN8810

--

I

XEMP1

DSN8810

--

V

VPHONE

DSN8810

---+++++++++++++++++++++++++ NO DROPPED OBJECTS +++++++++++++++++++++++++ ---+++++++++++++++++++++++++++ NO NEW OBJECTS +++++++++++++++++++++++++++ ---+++++++++++++++++++++++++++ ALTERED OBJECTS ++++++++++++++++++++++++++ ---

Database DSN8D81A Changes:

---

Field

Currently

Changed To

--

-----

---------

----------

--

BUFFERPOOL

BP0

BP1

---

Tablespace DSN8D81A.DSN8S31D Changes:

---

------------ Tablespace Partition Changes ------------

--

Field

Currently

Changed To

--

-----

---------

----------

--

PARTITION

01

01

--

PRIMARY

20

100

--

SECONDARY

20

100

--

FREEPAGE

0

10

--

PCTFREE

5

15

---

Tablespace DSN8D81A.DSN8S31E Changes:

---

------------ Tablespace Partition Changes ------------

--

Field

Currently

Changed To

--

-----

---------

----------

--

PARTITION

03

03

When the ICL to DDL analysis of the strategy is complete, the output can be used to apply the generated DDL to objects.

Chapter 11: Incremental Change Language 415

Group ICL to DDL

Group ICL to DDL The Group ICL to DDL feature lets you analyze an Incremental Change Language (ICL) data set or managed output and apply it multiple times within the same DB2 subsystem to produce multiple DDL analyses. This one-to-many analysis is set up by creating a copy group set. When the ICL input is analyzed, the user specifies the copy group set to use. The analysis produces multiple DDL outputs. Each DDL output can be different, based on the specification of each copy group set member (copy-ID).

Preparing and Accessing the Copy Group Set Using Copy Group Services, you can prepare the copy group set to be used with a Group ICL to DDL analysis. Note that the target subsystem ID specified for a copy group set member (copy-ID) should be the same for all copy group set members. The subsystem ID entered in the Target SSID field on the ICL to DDL Group Analysis screen is used by default, and overrides any target subsystem IDs in the copy group set. the “Expert Profile” chapter for more information about copy group sets. ICL global changes are applied to the objects in the input ICL data set and are performed prior to ICL operations. Only Name and Creator specifications are applicable. Note: DDL global changes are applied after all ICL operations have been determined prior to final DDL output generation.

Invoking Group ICL to DDL Analysis To invoke Group ICL to DDL analysis, enter the G line command next to an ICL data set or managed output on the Strategy Services panel. When you press Enter, the ICL to DDL Group Analysis screen appears, where you can enter analysis options and specify the copy group set to use. Note: The following list describes the Copy Group Specification fields. For information about the other analysis fields, see the online help or the "Analysis” chapter.

416 User Guide

Group ICL to DDL

COPY GROUP Select an existing copy group set to be used with the strategy. ■

Y—Yes. After a copy group set has been specified, Y displays in this field. If a copy group set has not yet been specified (the field contains N), enter Y and press Enter to display the Copy Group Services screen and make a selection or develop a new set.



S—Select. To select a copy group set, enter S. The Copy Group Services screen appears. When a set has been selected, press PF3 (End) to return to the analysis screen. The Group Name and Group Creator fields are filled in with the selection, and the field displays Y. Selection criteria can be used in the Group Name and Group Creator fields to filter the selection list that appears on the Copy Group Services screen.



U—Update. Enter U and press Enter to update the copy group set identified in the next two fields, Group Name and Group Creator. The Copy Group Update screen appears which lets you make changes to that set. When you are finished updating the set, press PF3 (End) to return to the analysis screen.



N—(Default) No, a copy group set has not been selected. If a copy group set has already been identified for this strategy, this field displays Y and the Group Name and Group Creator fields below are filled in. Enter N in this field and press Enter to delete that copy group set's association with the strategy.

GROUP NAME Enter the name of the copy group set. Selection criteria are accepted. GROUP CREATOR Enter the user ID of the creator of the copy group set. Selection criteria are accepted. Note: At analysis time, an option set to Y on the ICL to DDL Group Analysis Options panel overrides the corresponding option settings on the Copy Analysis Options panel. Conversely, an option set to N (the default) allows the Copy Analysis Options panel settings to be in effect. More information: DDL Output (see page 410) ICL Input (see page 410)

Chapter 11: Incremental Change Language 417

Submitting the DDL

Output Names A separate analysis output is generated for each copy group set member (copy-ID) item from the copy group set entered in the Copy Group Specifications fields. The copy-ID uniquely identifies each target copy. For more information about the copy-ID, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. Output names are generated based on the Strategy name and the copy-IDs. The first four characters of a member name are the first four characters of the Strategy name, and the last four characters are the four-character copy-ID. After the analysis, the output names that were generated will appear on the Strategy Services panel. The output names are indented under the associated strategy name.

Beginning the Analysis When the appropriate fields are filled in and the execution method is chosen, press Enter to begin the analysis. If batch execution was selected, the Batch JCL Specification panel appears. If online execution was selected, the Online Analysis Wait screen shows information about the analysis in progress.

Group ICL to DDL Analysis Output When the online analysis is complete, the message file appears. When you are finished reading the message file, press PF3. An ISPF edit session will open, displaying the members that contain the DDL produced for each copy group set member (copy-ID) represented in the copy group set. Enter S to select the member to view or edit.

Submitting the DDL To apply the DDL generated from the ICL statements, submit the data set or output managed by CA RC/Migrator to the Batch Processor. This section describes how to select the output and provides instructions for submitting it for execution.

Selecting the DDL Output for Submission To select the DDL data set or output managed by CA RC/Migrator, use the Strategy Services panel to display the name of the strategy that was originally analyzed to produce the ICL. The outputs associated with that strategy are indented under the strategy name. An identifier precedes the output names. The ICL identifier indicates output containing ICL statements. Output containing DDL are preceded by the target DB2 SSID.

418 User Guide

Import ICL

When you press enter to register the selection, the Batch Processor Interface screen appears.

Submitting the DDL Output for Processing The Batch Processor Interface screen permits job submission in batch or online mode. The DB2 SSID, DDL output name, and member name are already filled in. If there is no need to alter the defaults provided on this screen, enter O (Online mode) or B (Batch mode) and press Enter. For more information about this screen and about submitting Batch Processor jobs, see the “Execution Facility” chapter. For comprehensive information about the screen, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

Import ICL With the Import ICL data set feature, you can use an ICL data set locally that was generated at a remote site. The data set is listed on the Strategy Services panel where you can analyze the ICL data set and produce executable DDL to apply the changes that the ICL identified. To import ICL 1.

Select option 9 (Import ICL) from the Expert Profile menu, and press Enter. The Import ICL Dataset screen appears. Note: You can also enter APPLYICL or IMPICL to access the screen.

2.

Use the ICL Strategy Specification fields to specify the compare or alter strategy name to use in the local system. NAME Enter the strategy name, up to eight characters. This name and the creator ID uniquely identify a strategy. Note: If the ICL Input Dataset Specifications fields are entered first and Enter is pressed, this field is filled in from the input data set. You can change it, if necessary. DESCRIPTION Enter the description of the strategy (optional).

Chapter 11: Incremental Change Language 419

Import ICL

SHARE OPTION The authorization for others to use or update the strategy and output. ■

Y—All users can view and run analyses upon this strategy, but only the creator can update it. Analysis output is viewable and may also be read, updated, or deleted by any user.



U—All users can view and run analyses upon this strategy, and any user may update it. Analysis output is viewable and may also be read, updated, or deleted by any user.



N—The strategy can be viewed only by the strategy creator. Therefore, analysis output is viewable and can be edited, browsed, and deleted only by the strategy creator.



X—Exclusive access. All users may view and run analyses upon this strategy, but only the creator can update it. Analysis output can be read, updated, and deleted only by the strategy creator and the user who performed the analysis.



L—Limited access. All users can view and run analyses upon this strategy, but only the creator can update it. Analysis output is viewable and can be read by all users. All users can update data set analysis output, and only the strategy creator and the user who performed the analysis can update analysis output managed by CA RC/Migrator. Both types of analysis output can be deleted only by the strategy creator and the user who performed the analysis.

3.

Use the ICL Input Dataset Specification fields to specify the data set to identify with a compare or alter strategy in the local system.

4.

When all required fields have been filled, press PF3 (End) to display an ICL to DDL Analysis screen.

Producing DDL from the Imported ICL The next step is to use the ICL to DDL Analysis screen to produce the DDL. This screen displays automatically after PF3 is pressed at the Import ICL Dataset Screen. The ICL Input and DDL Output data set specification fields are described in ICL Input and DDL Output in the “Incremental Change Language” chapter. For more information about the other analysis fields, see the online help or Analysis Screen Layout in the “Analysis” chapter. When the appropriate fields are filled in and the execution method is chosen, press Enter to begin the analysis and produce the DDL. For further information about executing the DDL, see Producing DDL from ICL and Submitting the DDL.

420 User Guide

ICL Command Syntax

ICL Command Syntax This section describes command notation (see page 421) and contains the following examples of ICL statements: ■

ALTER ALIAS Syntax (see page 421)



ALTER DATABASE Syntax (see page 422)



ALTER INDEX Syntax (see page 422)



ALTER SYNONYM Syntax (see page 423)



ALTER SEQUENCE Syntax (see page 423)



ALTER STOGROUP Syntax (see page 423)



ALTER TABLE Syntax



ALTER TABLESPACE Syntax (see page 426)



ALTER VIEW Syntax (see page 427)

Note: We do not recommend modifying the ICL generated by CA RC/Migrator. ICL statements should only be modified by experienced users. Unpredictable results and errors can result when CA RC/Migrator analyzes incorrectly modified ICL.

Command Notation The following is the command notation used in the examples: ■

Uppercase characters are displayed as shown.



Lowercase italicized characters represent user-specified variables.



Default values are underlined.



The | character denotes an OR condition.



Required parameters are shown in braces { }.



Optional parameters appear in brackets [ ].

ALTER ALIAS Syntax The ALTER ALIAS syntax follows: ALTER ALIAS alias-name [NAME alias-name] [CREATOR alias-creator] [CREATEDBY createdby] [FOR table-name] [COMMENT string-constant] [LABEL string-constant]

Chapter 11: Incremental Change Language 421

ICL Command Syntax

ALTER DATABASE Syntax The ALTER DATABASE syntax follows: ALTER DATABASE database-name [NAME database-name] [CREATOR database-creator] [CREATEDBY createdby] [STOGROUP stogroup-name] [BUFFERPOOL bpname] [ROSHARE OWNER|READ|NONE]

ALTER INDEX Syntax The ALTER INDEX syntax follows: ALTER INDEX index-name [NAME index-name] [CREATOR index-creator] [CREATEDBY createdby] [ON table-name] [BUFFERPOOL bpname] [UNIQUE YES|NO] [CLOSE YES|NO] [PARTED YES|NO] [CLUSTER YES|NO] [COLUMNS {column-name ASC|DESC}] [LABEL string-constant] [ADD PART integer VALUES {constant} using block|free block]] [ALTER PART integer [VALUES {constant} using block|free block]] [DROP PART integer]

The using block syntax follows: VCAT catalog name STOGROUP stogroup-name [PRIQTY integer|SECQTYinteger|ERASE YES|NO]

The free block syntax follows: FREEPAGE integer|PCTFREE integer

422 User Guide

ICL Command Syntax

ALTER SYNONYM Syntax The ALTER SYNONYM syntax follows: ALTER SYNONYM synonym-name [NAME synonym-name] [CREATOR synonym-creator] [CREATEDBY createdby] [FOR table-name]

ALTER SEQUENCE Syntax The ALTER SEQUENCE syntax follows. ALTER SEQUENCE [SCHEMA schema-name-for-sequence] [NAME sequence-name] [TYPENAME data-type-for-sequence] [START sequence-starting-value] [MINVALUE minimum-value-for-sequence] [MAXVALUE maximum-value-for-sequence] [RESTART Y | N] [RESTARTWITH restart-value-for-sequence] [INCREMENT interval-for-consecutive-values-of-sequence] [CACHE maximum-sequence-values-to-keep-in-memory] [PRECISION precision-value-for-sequence] [CYCLE Y | N] [ORDER Y | N] [REMARKS user-remarks-for-sequence]

ALTER STOGROUP Syntax The ALTER STOGROUP syntax follows: ALTER STOGROUP stogroup-name [NAME stogroup-name] [CREATOR stogroup-creator] [CREATEDBY createdby] [PASSWORD password] [VCAT catalog-name] [VOLUMES *|volume-id]

Chapter 11: Incremental Change Language 423

ICL Command Syntax

ALTER TABLE Syntax The ALTER TABLE syntax follows. Note: To convert a table from index-controlled partitioning (ICP) to tablecontrolled partitioning (TCP), your syntax must include the key column information and must include ALTER PART operands that represent ending values.

424 User Guide

ICL Command Syntax

ALTER TABLE table-name [NAME table-name] [CREATOR table-creator] [CREATEDBY createdby] [TYPE GLOBAL | AUXILIARY] [CCSID ASCII | EBCDIC | UNICODE] [DATABASE database-name] [TABLESPACE tablespace-name] [EDITPROC {program-name|NONE}] [VALIDPROC {program-name|NONE}] [AUDIT NONE|CHANGES|ALL] [DATACAPTURE NONE|CHANGES] [OBID integer] [COMMENT string-constant] [LABEL string-constant] [BASETBNAME base-table-name] [BASETBCREATOR base-table-creator] [BASECOLNAME base-column-name] [PART partition number] [ADD COLUMN column-definition [PRECEDES column-name | FOLLOWS column-name]] [ADD RESTRICT ON DROP] [ADD CHECKCONST] [ADD CHECK] [ADD PART physical-partition-number VALUES {constant}] [ADD UNIQUE CONSTRAINT (c1 [,c2[,...]]) NAME constraintname TYPE

{UNIQUE|PRIMARY}]

[DROP COLUMN column-name] [DROP FOREIGN KEY constraint-name] [DROP RESTRICT ON DROP] [DROP CHECKCONST constraint-name] [DROP PART physical-partition-number] [DROP UNIQUE CONSTRAINT (c1 [,c2[,...]])] [PARTKEYCOLS (column-name ASC|DESC,…)] [PARTITIONED YES|NO] [ROTATE PART FIRST TO LAST VALUES {constant}] [ALTER COLUMN column-definition] [ALTER CHECKCONST] [ALTER PART physical-partition-number VALUES {constant}] [ALTER UNIQUE CONSTRAINT (c1 [,c2[,...]]) [NAME constraint-name] [TYPE

{UNIQUE|PRIMARY}][COLUMNS(c1

[,c2[,...]])]] [VOLATILE YES | NO] [referential constraint]

Chapter 11: Incremental Change Language 425

ICL Command Syntax

The column definition syntax follows: column-name [COLNAME new-column-name] [data type] [NULLABLE|NOT NULL|NOT NULL WITH DEFAULT|NOT NULL UNIQUE|DEFAULT NULL] [FOR [BIT|SBCS|MIXED] DATA] [FIELDPROC {NONE|program name {NONE|fparms}}] [FIELDPARM {NONE|fparms}] [COLCOMMENT string-constant] [COLLABEL string-constant] [MASK mask]

The referential constraint syntax follows: FOREIGN KEY [constraint-name] {column-name} REFERENCES table-name [ON DELETE RESTRICT|ON DELETE CASCADE|ON DELETE SET NULL]

ALTER TABLESPACE Syntax The ALTER TABLESPACE syntax follows: ALTER TABLESPACE ts-name [NAME ts-name] [CREATOR ts-creator] [CREATEDBY createdby] [DATABASE database-name] [BUFFERPOOL bpname] [SEGSIZE integer] [LOCKSIZE ANY|PAGE|TABLE|TABLESPACE] [CLOSE YES|NO] [PARTED YES|NO] [ADD PART integer [COMPRESS YES|NO] [using block|free block]] [ALTER PART integer [COMPRESS YES|NO] [using block|free block]] [DROP PART integer]

The using block syntax follows: VCAT catalog name| STOGROUP stogroup-name [PRIQTY integer|SECQTY integer|ERASE YES|NO]

The free block syntax follows: FREEPAGE integer|PCTFREE integer

426 User Guide

ICL Command Syntax

ALTER VIEW Syntax The ALTER VIEW syntax follows: ALTER VIEW view-name [NAME view-name] [CREATOR view-creator] [CREATEDBY createdby] [CHECK YES|NO] [COMMENT string-constant] [LABEL string-constant] [ADD EXPLICIT {column-name} [PRECEDES {column-name}| FOLLOWS {column-name}] EXPRESSION {expression} [PRECEDES {expression}| FOLLOWS {expression}] OBJECT {object-name} [PRECEDES {object-name}| FOLLOWS {object-name}]] [DROP EXPLICIT [COLUMNS] {column-name} EXPRESSION {expression} OBJECT {object-name} WHERE {where-clause} GROUP BY {group-by-clause} HAVING {having-clause}] [NEW WHERE {where-clause} GROUP BY {group-by-clause} HAVING {having clause} EXPLICIT COLUMNS {column-name}] [VIEW TEXT {view-text}]

Chapter 11: Incremental Change Language 427

Chapter 12: RC/Merger This section contains the following topics: Overview of RC/Merger (see page 429) Processing (see page 429) Supported Tablespace Formats for RC/Merger (see page 430) Strategies (see page 431) Quick Steps (see page 434) Specify Analysis Options (see page 437) Specify Move and Copy Options (see page 437)

Overview of RC/Merger RC/Merger handles all aspects of catalog consolidation, and includes the following features. ■

Object collision detection, reporting, and resolution



Utility JCL generation



Full restartability



User ability to select objects by type and level



Object alteration



Integration with the CA RC/Migrator user interface



Optional use of pre-existing CA RC/Migrator migration strategies

Processing To use RC/Merger, you must first create and save an action plan. This plan, called a strategy, specifies the objects to copy or move and includes other information about how the copy or move should be accomplished. The next step is analyzing the strategy. Use the Strategy Analysis screen and the Strategy Move Analysis Options panels to control the conditions for the analysis. To perform the analysis, the strategy definition is read, the specifications are analyzed, and an executable output data set is generated. This data set contains all the information and commands necessary to perform the actions. After analyzing the strategy, all tablespaces in the strategy on the source DB2 subsystem must be stopped. RC/Merger will not move or copy data if it cannot get exclusive control of the VSAM data sets.

Chapter 12: RC/Merger 429

Supported Tablespace Formats for RC/Merger

The final step is executing the data set, which performs the actual move or copy. The data set can be reviewed and edited to change the impact before executing it. Notes: ■

You can use preexisting migration strategies by adding the option specifications that apply uniquely to RC/Merger.



To reduce the chance of damaging or losing data, we strongly recommend that you perform a backup or create a COPY before the MOVE because the MOVE uses actual data.

Supported Tablespace Formats for RC/Merger RC/Merger supports the following tablespace formats: ■

Source tablespace and target tablespace are simple.



Source tablespace is simple and target tablespace is either segmented Basic Row Format (BRF) or segmented Reordered Row Format (RRF).



Source tablespace is segmented BRF and target tablespace is segmented BRF.



Source tablespace is segmented RRF and target tablespace is segmented RRF.

Note: DB2 V9 New Function Mode (NFM) introduced RRF and started the deprecation of simple tablespaces. BRF and RRF physically store the rows in the pages of the pageset in different formats, making them incompatible partners for source and target when using RC/Merger. When the source is segmented BRF and the target is simple or segmented RRF, use CA RC/Migrator instead of RC/Merger. When the source is segmented RRF and the target is simple or segmented BRF, use CA RC/Migrator instead of RC/Merger. If a DATA ONLY copy will be done, the following query can be used to determine row format. The query can be used for the segemented source tablespace and the target tablespace. SELECT TS.DBNAME, TS.NAME, TS.SEGSIZE, TP.PARTITION, TP.FORMAT FROM SYSIBM.SYSTABLESPACE TS, SYSIBM.SYSTABLEPART TP WHERE TS.DBNAME = '' AND TS.NAME

= ''

AND TP.TSNAME = TS.NAME AND TP.DBNAME = TS.DBNAME;

A FORMAT value of “R” means RRF; a blank means BRF. Note: This query can be used only for a DB2 9 NFM subsystem

430 User Guide

Strategies

Strategies RC/Merger strategies are created in the same way as migration strategies. Any existing migration strategy can be analyzed with RC/Merger. After you create and save a strategy, invoke RC/Merger on the Strategy Services panel by entering M in the O (Options) field next to the migration strategy to analyze. Note: For information about creating a strategy, see the “Migration Strategies” chapter. RC/Merger can be used when both the source and target subsystems are on shared DASD. This section contains information to help decide when it is advantageous to use RC/Merger instead of a conventional migration.

Moving and Copying Objects With RC/Merger, you can move or copy objects (tablespaces and indexes) from one DB2 subsystem to another without unloading and loading the data. When performing a move, the tablespace and index data sets are renamed to conform to the naming standards of the target DB2 subsystem. Note: After a move, source objects no longer have underlying data sets, so they are unavailable for use on the source subsystem. When copying, the new data sets are created on the target subsystem and the data from the source tablespace and index is copied. Note: If the objects being moved or copied are DB2 managed (STOGROUP defined), the target STOGROUP should be defined on the source subsystem. This allows RC/Merger to generate correct data set names at analysis time.

Move Considerations The most efficient move would consist of renaming the source data sets to conform to the target subsystem's naming standards. Then the header page would be updated to reflect the new target information. If you move an object from one subsystem to another and the resulting target data set name is the same as the source data set name, a message displays that warns you not to drop the source objects. Instead, you should alter the source object so that it is VCAT- defined, and then drop the objects.

Chapter 12: RC/Merger 431

Strategies

Certain conditions and options can cause RC/Merger to have to read and update every page of the data set after the renaming. Note the following: ■

Reset page RBA—The RBA of the last log record update is stored on every used page in the data set. Resetting this field helps ensure a clean, recoverable object on the target subsystem. You can choose this option at analysis time.



Log RBA—The log RBA of the source is greater than the log RBA of the target. In this case, RC/Merger must reset the last update RBA on each page to help ensure the object's recoverability. Even if the Reset Page RBA option is set to No, this condition is detected automatically and the page RBA is reset.



MOVE—Objects can be moved while maintaining the VCAT name, database name, and space name. This includes checking for “mangled” indexspace names. The process terminates if there is any chance of an error.



OBID collision—There is a collision involved between the source and target objects. An OBID collision occurs when the OBID for a source table is unavailable for use on the target subsystem. It can also happen when an OBID cannot be used because it exists on the target subsystem. To resolve this, move the appropriate objects to a new or different database.



Tablespaces in Copy Pending status—All moved tablespaces are placed in Copy Pending status because no valid image copies exist on the target subsystem. RC/Merger can generate a copy utility to be run as part of the analysis output.

Copy Considerations Following are some considerations for copying with RC/Merger.

432 User Guide



Run time—A copy usually takes longer to run than a move.



New data sets—The copy function always reads and writes every page of the data sets, because it creates new data sets.



Source and target availability—With share level data access for copy operations, RC/Merger may no longer require exclusive control of the VSAM data sets for the duration of the DATASET call. The objects are available from both the source and target subsystems for image copies or inquiry only processing.



DASD space—After a copy there are two sets of the data sets, so enough DASD space must be available before beginning the copy.



Tablespaces in Copy Pending status—All copied tablespaces are placed in Copy Pending status because no valid image copies exist on the target subsystem. RC/Merger can generate a copy utility to be run as part of the analysis output.

Strategies

Move and Copy Restrictions Following are some restrictions for a move or copy. If any of these restrictions are violated, RC/Merger must unload and load the data and rewrite the file pages to create the target objects. ■

Roshare Reader objects cannot be moved.



Shared DASD must be in effect for both the source and target subsystems.



For a move, the underlying VSAM data sets for the source and the target must be cataloged in the same ICF user catalog. An IDCAMS RENAME will be done (if required), and the old and new names in the RENAME must be cataloged in the same catalog.



Implicitly defined tablespaces cannot be moved or copied (that is, tablespaces created using a CREATE TABLE ... IN DATABASE database statement).

Data Change Considerations Objects that have data changes as a part of the move strategy cannot be moved or copied. The following table illustrates the characteristics and kinds of changes that violate the restrictions.

Object Name

Object Characteristic

Tablespace

Number of partitions Segment size 4K to 32K Segment size 32K to 4K Type CCSID

Table

Editproc (add, remove, or change) Add or delete column Column changes: ■

Size



Type



Nullable



Fieldproc (add, remove, or change)

Chapter 12: RC/Merger 433

Quick Steps

Object Name

Object Characteristic

Index

Unique rule Cluster Number of partitions Values for partitioned indexes Type Key column Key column ascending or descending

Quick Steps The following steps are for analyzing and executing move or copy operations for a migration strategy that already exists: ■

Analyze the strategy (see page 434).



Stop the source tablespaces (see page 435).



Execute the move (see page 435).

Analyze the Strategy Perform the steps in this section to analyze the strategy: To analyze the strategy

434 User Guide

1.

Display the Strategy Services panel.

2.

Enter M (for Move) in the O (Option) field of the migration strategy to use.

3.

Press Enter. The Migration Strategy Analysis screen appears.

4.

Enter Y in the Update Options field and fill in other fields as needed, but leave the Execution Mode field blank for now.

5.

Press Enter. The Strategy Move Analysis Options panel appears. For more information about the options on this screen, see Specifying Move and Copy Options.

6.

Enter M (for a move) or C (for a copy) in the Move/Copy field in the RC/Merger Option Selections area of the screen.

7.

Fill in the rest of the RC/Merger Option Selections fields and any other options as needed for the move.

8.

Press PF3 (End). The Migration Strategy Analysis screen reappears.

Quick Steps

9.

Enter O (for Online) in the Execution Mode field.

10. Press Enter. The online analysis begins automatically. When it is complete, the analysis messages appear. 11. After reading the analysis messages, press PF3 (End). The analysis output displays. 12. Press PF3 (End) to close the analysis output. The Migration Strategy Analysis screen reappears. 13. Press PF3 (End) to exit the screen. The Strategy Services panel reappears. More information: Specify Analysis Options (see page 437)

Stop the Source Tablespaces To stop the source tablespaces, stop all tablespaces in the strategy on the source DB2 subsystem. The source tablespaces must be stopped before executing the move. If they are not, CA RC/Migrator generates errors because the underlying VSAM data sets are in use. RC/Merger does not move or copy data if it cannot get exclusive control of the VSAM data sets.

Execute the Move Perform the steps in this section to execute the move. To execute the move 1.

On the Strategy Services panel, find the name of the strategy that was analyzed.

2.

Find the name of the output data set or table containing the analysis. This is indented under the strategy name.

3.

Enter S (for Submit) in the line command field next to the name of the output.

4.

Press Enter. The Batch JCL Specification panel appears. The input fields are filled in with the information about the submitted data set or table.

Chapter 12: RC/Merger 435

Quick Steps

5.

Fill in the fields necessary to execute the data set or table. For more information about the Batch JCL Specification panel, see Batch Analysis in the “Execution Facility” chapter.

6.

Press Enter. The move is performed according to the DDL in the analysis output.

Note: Before executing the RC/Merger output using the Batch Processor, all tablespaces in the strategy on the source DB2 subsystem must be stopped. See Stopping the Source Tablespaces for more information.

How You Can Adjust a Move Analysis to Avoid RC=16 Termination If the execution of the Move analysis for COPY with DATA ONLY COPY ends with RC=16, you can use the following process if you want the job to be completed successfully: 1.

Add CPYDSWRN(YES) to the PARMLIB.

2.

Regenerate the Move analysis.

3.

Execute the analysis.

When completed, the job ends with RC=4, and messages RCM0245E, RM00246E, and RCM0256W are produced.

Information About the .CALL RCMERGER Cards The .CALL RCMERGER cards are the calls to RC/Merger to do the actual work on the target subsystem. The first parm is the target SSID, and the second is the function to be performed. Important! Do not edit calls or cards within the .DATA and ENDDATA section. These calls are generated as needed by and for RC/Merger and should not be hand-coded or modified. The following describes the various calls:

436 User Guide



RESERVE—The RESERVE call directs RC/Merger to reserve the source table OBIDs on the target subsystem, if possible.



SPOBJECT—The SPOBJECT call directs RC/Merger to do the create of a target object (tablespace or index).



TABLE—The TABLE call directs RC/Merger to create all the tables in an associated tablespace.



DATASET—The DATASET call directs RC/Merger to process the data for a particular object. This step adjusts the OBIDs in the page sets, if necessary.

Specify Analysis Options

Specify Analysis Options To specify analysis options for a strategy, access the Migration Strategy Analysis screen for RC/Merger by specifying M next to a migration strategy or its associated analysis data set name on the Strategy Services panel. If M is entered next to a data set name, the analysis options are set to those used for the analysis that produced the data set. This screen is similar to the Migration Strategy Analysis screen provided by CA RC/Migrator. See Analysis Screen Layout in the “Analysis” chapter for more information. Notes: ■

If the recovery option is set to Y, the recovery analysis produces unloads of the tables in the strategy, along with output to load the data from those unloads.



Global Changes are made on the Global Changes screen. Note: For information about Global Changes, see the “Profile” chapter.



Batch Analysis requires additional information that you specify on the Batch Analysis screen. See Batch Analysis in the “Execution Facility” chapter for more information about this screen.

More information: Analyze the Strategy (see page 434)

Specify Move and Copy Options Perform the steps in this section to specify move and copy options using RC/Merger: To specify move and copy options 1.

Enter M next to a migration strategy or its associated analysis data set name on the Strategy Services panel.

2.

Press Enter. The Migration Strategy Analysis screen appears.

3.

Enter Y in the Update Options field.

4.

Press Enter. The Strategy Move Analysis Options panel appears. Note: For information about the control, utility, output, data unload, dataset delete, exclusive and model options fields, see the “Analysis” chapter.

Chapter 12: RC/Merger 437

Specify Move and Copy Options

5.

Set the move and copy options by specifying values in the following fields as needed. These options address considerations that are exclusive to RC/Merger. Note: Enter a question mark (?) in any option field to get online help for that option. (M)ove/(C)opy Indicate whether to move or copy the objects included in the strategy. Valid values are as follows: ■

M—Move the objects. Moving involves substituting the new OBID values in the objects. There are never two copies of the data.



C—Copy the objects. The page RBAs are automatically reset. This is the default.

Reset Page RBA Indicate whether to reset the page RBA (Relative Byte Address). If the target number is lower than the source, it is reset automatically, regardless of the setting for this field. Valid values are as follows: ■

Y—Reset the page RBAs. This setting can affect the recoverability of the move or copy.



N—Do not reset the page RBAs. Let RC/Merger determine whether this needs to be reset. This is the default.

Maxtasks Enter the maximum number of tasks to run simultaneously for this strategy. Valid values are from 1 to 9. The default is 3. When moving or copying partitioned objects, increasing this value can cause the job to run faster. Reserve OBIDS Indicate whether to reserve the Internal Object File Identifiers (OBIDs). This helps ensure that the same OBIDs are used in the target objects after the move or copy has been executed. Valid values are as follows:

438 User Guide



Y—Reserve the OBIDs. This is the default.



N—Do not reserve the OBIDs.

Specify Move and Copy Options

Collision RPT Indicate whether the Change Analysis Report should list object name and OBID collisions. Valid values are as follows: ■

Y—Include an object name and OBID collision report. RC/Merger will connect to the target SSID to get this information for the analysis.



N—Do not report on name and OBID collisions. This is the default.

Convert IX Indicate whether to convert indexes. Valid values are as follows: ■

Y—Convert indexes to Type 2. Note: If Y is entered, Y must also be entered in the Reorg TS field or the Recover IX All field, but not both.



N—Do not convert indexes. This is the default.

Reorg TS Indicate whether to reorganize tablespaces. Valid values are as follows: ■

Y—Reorganize the tablespaces and rebuild the indexes. Note: If Y is entered, it must also be entered in the Convert IX field and N must be entered in the Recover IX All field. Cards for the index move are not generated in this case.



N—Do not reorganize the tablespaces. This is the default.

Recover IX All Indicate whether to recover all indexes. Valid values are as follows: ■

Y—Rebuild all indexes, but do not reorganize the tablespaces. Cards for the index move are not generated in this case. Note: If Y is entered, it must also be entered in the Convert IX field and N must be entered in the Reorg TS field.



N—Do not rebuild indexes. This is the default.

Data Only Copy Specifies whether a full analysis or only the commands to populate existing target objects with data are to be generated. Valid only with a copy. Valid values are as follows: ■

Y—Perform a DATA (and any requested utilities) ONLY migration.



N—Perform a full analysis instead of a DATA ONLY analysis. This is the default.

Chapter 12: RC/Merger 439

Specify Move and Copy Options

Share Level Specify the share level for the source objects during the copy. This option is only valid with a copy. Valid values are as follows: ■

N—(NONE) Source objects must be available in Exclusive mode. If not, processing terminates.



NS—(NONE,SET) Source objects must be available in Exclusive mode. If not, RC/Merger attempts to connect to the source subsystem to stop the objects. If RC/Merger is unable to connect, processing terminates.



R—(REFERENCE) Source objects must be in RO (or stopped) status. RC/Merger attempts to connect to the source subsystem to place the objects in RO status. If RC/Merger is unable to connect, processing terminates.



RN—(REFERENCE,NOCHECK) Source objects are assumed to be in RO (or stopped) status. RC/Merger makes no attempt to connect to the source subsystem to perform status checking/setting. If the objects are in RW status and are being updated during the RC/Merger data set processing, the data may be invalid. When this processing option is used, a warning message is issued during the analysis and the execution. This mode is intended to allow SHAREVEL REFERENCE processing when the source and target subsystems reside on different MVS systems.

Allmsgs If the ALLMSGS keyword is specified, additional information about the load is issued. These messages are written to the Batch Processor output stream.

6.

440 User Guide



Y—Generate additional load information.



N—Do not generate additional load information. This is the default.

Enter SAVE to save settings.

Chapter 13: Analysis Output This section contains the following topics: Analysis Output Files (see page 441) Managed Output (see page 441) Change Analysis Report (see page 449) Analysis Output File (see page 449) Analysis Messages (see page 456) Compare Report (see page 456)

Analysis Output Files Analysis output consists of the following files: Message file Displays the analysis messages. This file is displayed after online analysis is complete. Note: You can use the QPRINT command to print the contents of this report. Report file Displays the Change Analysis Report, showing changes to all objects. This file is displayed after the Analysis Message File. (You can press PF3 (END) to display the Change Analysis Report.) Analysis output file Identifies the commands necessary to execute the migration, comparison, or alteration. The analysis output file by default is divided into three parts: the header, the commands, and the impact analysis.

Managed Output Managed Output lets you specify whether strategy analysis output data should go to a data set or to a DB2 table. The tables containing the analysis data are uniquely identified by the: ■

Strategy name and creator



Analysis user ID



Timestamp of the new analysis

Note: Multiple analyses of the same strategy can be stored for future use.

Chapter 13: Analysis Output 441

Managed Output

You have the flexibility to select managed output or a default partitioned data set (PDS) separately for each type: strategy analysis output, recovery analysis output, and Incremental Change Language (ICL) output.

Access the Managed Output Feature You can access the Managed Output feature as described in this section. To access the Managed Output feature 1.

Enter 0 on the Main Menu, or enter the primary command PROFILE at any screen. The Profile or the Expert Profile Menu appears.

2.

Enter 2 (RC/Migrator Profile Variables), and press Enter. The first Global Operational Parameters screen appears.

3.

Enter Y in the Update Output Specifications field and press Enter. The second Global Operational Parameters screen appears. Note: For more information, see the “Profile” chapter.

4.

Specify the Managed Output feature you want used or enter a default PDS for strategy analysis, recovery, or ICL output. If the Analysis Output to PDS field is set to N, this means that managed output will control the initial field settings for all subsequent analyses, and the name in the Default Analysis PDS field is not in effect. This includes the output specification fields for all analysis screens and the Batch Processor Interface screen. Note: The Default Managed Output Maintenance Specifications fields on this screen lets you view and set the defaults for managed output maintenance. For information about these fields, see the “Profile” chapter.

442 User Guide

Managed Output

Analysis Screen with Managed Output Off The following screen displays the Output Dataset Specifications fields as they appear if the managed output feature is off. (Analysis Output to PDS field set to Y on the Global Operational Parameters screen.) The output will go to a PDS. RMP$A1B -------- RC/M Alteration Strategy Analysis -------COMMAND ===> STRATEGY ===> ITEM#3A DESCRIPTION ===> CREATE WJBXX1 ENVIRO CREATOR ===> USER3 SHAREOPTION ===> Y ---------------------------------------------------------------------- USER1 EXECUTION SPECIFICATIONS ACCESS SPECIFICATIONS EXECUTION MODE ===> ( O - Online, B - Batch ) ACM ANALYSIS ===> N OVERRIDE ===> N PDS ANALYSIS ===> N RECOVERY ===> N OPTION SPECIFICATIONS UPDATE OPTIONS ===> N GLOBAL CHANGES ===> N SET NAME ===> SET CREATOR ===> OUTPUT DATASET SPECIFICATIONS EDIT DATASET ===> N DATASET NAME ===> 'USER1.DB2.ANALYZE(ITEM#3A)' VOLUME SERIAL ===> ( If not cataloged )

Chapter 13: Analysis Output 443

Managed Output

Analysis Screen with RC/M Managed Output On The following screen displays the Output Analysis Specifications fields as they appear if the managed output feature is on. (Analysis Output to PDS field set to N on the Global Operational Parameters screen.) The output will go to a managed table instead of to the default PDS. RMA3B -------- RC/M Alteration Strategy Analysis -------COMMAND ===> STRATEGY ===> ITEM#3A DESCRIPTION ===> CREATE WJBXX1 ENVIRO CREATOR ===> USER3 SHAREOPTION ===> Y ---------------------------------------------------------------------- USER1 EXECUTION SPECIFICATIONS ACCESS SPECIFICATIONS EXECUTION MODE ===> ( O - Online, B - Batch ) ACM ANALYSIS ===> N OVERRIDE ===> N PDS ANALYSIS ===> N RECOVERY ===> N OPTION SPECIFICATIONS UPDATE OPTIONS ===> N GLOBAL CHANGES ===> N SET NAME ===> SET CREATOR ===> OUTPUT ANALYSIS EDIT OUTPUT STRATEGY CREATOR

SPECIFICATIONS ===> N ===> ITEM#3A ===> USER3

ANALYSIS USER ===> USER1 ANALYSIS DATE ===> 08-16-01 ANALYSIS TIME ===> 10:29:05

Strategy Services Panel This section discusses the following regarding the Strategy Services panel:

444 User Guide



Differences in how the managed output items appear (see page 445)



How the data sets appear (see page 446)

Managed Output

Managed Output In this example, each line labeled Managed Output represents a separate analysis of the strategy named Confrm. RMS1 -------------- RC/M Strategy Services -------------COMMAND ===> SCROLL ===> CSR DB2 SSID ===> D81A STRATEGY ===> * CREATOR ===> USER1 TYPE ===> * SRC SSID ===> D81A ---------------------------------------------------------------------- USER1 T S SRC O STRATEGY DESCRIPTION CREATOR P O SSID _ ________ _________________________ USER1 _ N ____ _ CONFRM TEST USER3 M U D81A _ * MANAGED OUTPUT * _ FINTEST MIG WITH TABLES USER01 M U T23B _ USER02.DOC.TST(TRIAL1) _ USER01.KAT.TEST(DEPT2) _ DLBEJ TS COMP GLOBAL CHG TEST USER1 M U D81A _ DLBMIG TESTDLBMIG USER1 M U D81A _ CGRP * MANAGED OUTPUT * (DLBMCID1) _ CGRP * MANAGED OUTPUT * (DLBMCID2) _ CGRP * MANAGED OUTPUT * (DLBMCID3) _ CGRP * MANAGED OUTPUT * (DLBMCID4) Valid O Cmds For Strategies: A,C,D,G,I,L,M,T,U,X Valid O Cmds For Datasets : A,B,C,D,E,G,M,O,R,S,U,X

+---- LAST UPDATE ----+ USER DATE TIME

----------- CA Batch Processor Interface ---------

EXECUTION SPECIFICATIONS: EXECUTION MODE ===> DB2 SSID ===> D81A

( B - Batch mode, O - Online mode )

BATCH PROCESSOR ANALYSIS INPUT: STRATEGY ===> CONFRM CREATOR ===> USER1 EDIT INPUT

===> N

PROCESSING OPTIONS: UNLOAD MODE ===> RESTART ===> TERM UTILITY ===> RETRY LIMIT ===> WRAP/TRUNCATE ===> AUDIT OPTIONS AUDIT TRAIL OUTPUT FORM

A N N 64 T

===> Y ===> WIDE

ANALYSIS ANALYSIS ANALYSIS ( Y - Yes,

USER ===> USER1 DATE ===> * TIME ===> * N - No )

CONTINUE IF: -WARNING -SQL ERROR -BIND ERROR -LOAD DISCARDS

===> ===> ===> ===>

OUTPUT CLASS OUTPUT DESTINATION

===> A ===> RMT1

N N Y N

In this screen, the Analysis Date and Analysis Time fields contain asterisks. When Enter is pressed, the Managed Output Selection screen appears, displaying the identifying attributes for all the managed output tables that exist, in this case for the strategy name CONFRM, the strategy creator USER1, and the analysis user USER1.

Chapter 13: Analysis Output 447

Managed Output

The analysis user is the user ID of the person who performed the analysis that created the output. RMO1 ----------- RC/M Managed Output Selection ---------COMMAND ===> SCROLL ===> CSR DB2 SSID ===> D81A STRATEGY ===> CONFRM CREATOR ===> USER1 TYPE ===> D (D,R) OUTPUT USER ===> USER1 OUTPUT DATE ===> * OUTPUT TIME ===> * ---------------------------------------------------------------------- USER1 Enter 'S' to select an Output. +------ LAST ANALYSIS ------+ SEL DESCRIPTION STRATEGY CREATOR USER DATE TIME _ DDL CONFRM USER1 USER1 20011129 07441056 _ DDL CONFRM USER1 USER1 20011129 08013204 _ DDL CONFRM USER1 USER1 20011129 08085439 _ DDL CONFRM USER1 USER3 20011130 09442956 COMMENT: THIS ANALYSIS USES the @DEFAULT MODEL ID _ DDL CONFRM USER1 USER1 20011129 11303875 ******************************** BOTTOM OF DATA ******************************* -----------------------------------------------------------------------------PF7/8 : Scroll Up/Down PF10/11: Scroll Left/Right PF3/15: End (Process selected Output) CANCEL : Return with no selection.

The header fields initially identify the selection criteria entered on the preceding screen, plus the SSID and output type. You can enter new selection criteria in the Strategy, Creator, Type, Output User, Output Date, and Output Time fields to display a new list of managed output tables that match the specified criteria. Enter S in the Sel column next to the table you want to select. When Enter is pressed, the previous screen reappears, and the appropriate fields are filled in with this choice.

448 User Guide

Change Analysis Report

The following primary commands are available for manipulating the display on the Managed Output Selection screen. ■

DATE Command—Enter DATE or D in the command line to toggle the format in which the Date and Time fields are displayed on the RC/M Managed Output Selection screen. The display can be with or without delimiters. With delimiters, the date and time are displayed as MM-DD-YY HH:MM:SS.ss. Without delimiters, the date and time are displayed as YYYYMMDD HHMMSSss.



COMMENTS Command—Enter COMMENTS or C in the command line to toggle the display of comments being shown for each analysis output managed by CA RC/Migrator on the Managed Output Selection screen. When the comments list mode is on, there is one indented entry for each analysis output managed by CA RC/Migrator that has an optional comment tagged to it. These comments are highlighted and show the comment that was entered in the Comments field of the analysis screen prior to running that analysis.

Change Analysis Report For migration and alteration strategies, a comprehensive report is produced that shows all changes to all objects. The report shows primary selected objects, newly created objects, dropped objects, and altered objects. The altered objects section documents all changes to each object, displaying the Old and New fields. To generate this report, simply analyze a strategy. The report is presented before the analysis output displays. If you run the analysis in batch mode, the output is directed to the data set defined by the REPFILE DD statement.

Analysis Output File The analysis output file by default is divided into three parts: the header, the commands, and the impact analysis. The header describes the selected strategy and analysis options. The commands section contains the DDL and Batch Processor commands necessary to execute the migration, compare or alteration, and optionally to create the recovery strategy. The impact analysis lists, by type, the objects included in the strategy. The Strategy Analysis Options panel displays when the choice is made to update options from the Strategy Analysis screen. Specify whether to include the ANALYSIS HEADER, IMPACT ANALYSIS, or RPT IN DDLFILE in the analysis output file.

Chapter 13: Analysis Output 449

Analysis Output File

The analysis output file varies according to the type of strategy. This section describes the general structure of the file, using an object migration strategy analysis output file as an example. Note: For information about how specifying the Recovery option affects analysis output, see the “Analysis” chapter.

Header The header is the first part of the analysis output file and is included by default. To exclude the header, N must be specified in the Analysis Header prompt of the Strategy Analysis Options panel. The analysis header is especially helpful when reviewing output generated several days earlier. The analysis output header indicates the strategy used to generate the output, the strategy definition, and the analysis options. The information in the header is also displayed during execution. Batch Processor comments appear as part of the execution output; however, they are truncated to 72 characters. The header is broken down into three parts: Strategy Information, Strategy Options, and Analysis Options.

Strategy Information Strategy information is the first part of the header and is standard for all strategy types. This part of the header lists the strategy name, creator, description, share option, and source SSID. These fields are described in the “Strategy Services Facility” chapter.

Strategy Options The strategy options section lists the appropriate information defined during strategy creation. The number of sections that appears will vary depending on the strategy type, and roughly corresponds to the number of screens used in the strategy definition. For object migration strategies, the two Implode/Explode Services panels are used to define the object. Thus, the strategy options section for object migration strategies is divided into two sections: Implode/Explode (first screen) and Other Migration Options (second screen).

450 User Guide

Analysis Output File

The Implode/Explode Options section displays the information defined on the first Implode/Explode Services panel. Only information about Implode/Explode options is described. The Other Migration Options section displays the information defined on the second Implode/Explode Services panel. This includes auxiliary implode, referential integrity (RI), security, and data migration options. The information displays in the same format as the screens used to create the strategy, so it is easy to understand.

Analysis Options The analysis options section of the report lists all selected analysis options, including any global changes requested. --ANALYSIS OPTIONS: --

EXECUTION MODE

--

ANALYSIS OVERRIDE ===> N

===> O (O - ONLINE, B - BATCH)

--

ACCESS MODE

===> CATALOG

--

MODEL ID

===> @DEFAULT

--

MODEL CREATOR

===> IBMUTIL

--

TARGET SSID

===> DA0G

--

GLOBAL CHANGES

===> N

--

AUX IMPLODE

===> Y

STATISTICS

===> Y

--

RI(LOCAL/GLOBAL)

===> L

CHECK DATA

===> Y

--

SECURITY

===> Y

IMAGE COPY

===> Y

--

DROP OBJECTS

===> N

BIND/REBIND

===> B

--

DEFAULT SQLID

===> RECOVER IX

===> N

--

----

ALL ROWS

===> Y

VSAM DEFINES

===> Y

--

NUMBER ROWS

===>

VSAM DELETES

===> Y

--

DATA STATISTICS

===> Y

---

NO .AUTHS

===> N

--

NO SET SQLID STMTS

===> N

--

BND/DAT/SQL/STAT/GRNT/RI===> N

--

COMMIT ASAP

(B nd, D at, R -Stat, S QL, G rnt, R I or N)

===> N

---

DELETE UNLOAD DATASETS

--

DELETE TEMPORARY DATASETS ===> N

===> N

--

Chapter 13: Analysis Output 451

Analysis Output File

Any global changes specified, including the Global Change Set name and Creator, are listed in a format similar to the Global Changes screen. Only the fields that you requested changes for are listed. --GLOBAL CHANGES: ---

SET NAME

===> PTI2GLOB

--

SET CREATOR

===> PDJISK

--- CODE -- AL -- ALSV -- TS -- TSBP -- TB -- TBCB

FROM

TO

*

PTI2

ALL OBJECT TYPES STOGROUP --> VCAT

TABLESPACE BUFFERPOOL

BP0

BP32

*

PTITO

TABLE CREATED BY

---********************** END OF ANALYSIS HEADER ************************ .SYSTEM SQLDDL .CONNECT PTI2 -- ************************************************************** -- *

*

-- * STOGROUP CREATE STATEMENTS

*

-- *

*

-- **************************************************************

The End of Analysis Header comment line signals the end of the header and the beginning of the commands section (shown by the Stogroup Create Statements).

452 User Guide

Analysis Output File

Commands The Commands section follows the analysis header, and contains all of the commands necessary to perform the requested operations and optionally create the recovery file. The commands include DDL and Batch Processor commands, unless DDL Only is specified on the Analysis screen. .SYSTEM SQLDDL -- ************************************************************** -- *

*

-- * STOGROUP CREATE STATEMENTS

*

-- *

*

-- ************************************************************** -- DSN8G210 WILL BE CREATED VIA THESE NATIVE DB2 COMMANDS. .AUTH

PTIPROD

CREATE STOGROUP DSN8G210 VOLUMES (PTIPK1 ) VCAT PTI2 ; .SYNC 5

'CREATE STOGROUP DSN8G210'

-- **************************************************************

In the previous example, the .SYSTEM cards are placed in specific places to support Batch Processor UNLOAD mode specifications. The object create statements header precedes each group of CREATE statements, which are sorted by object type. Use the ISPF FIND command to find this box. The actual CREATE statements follow the heading. Each .SYNC command includes a description of the action that precedes the SYNC point. These descriptions make restarting jobs easy. SYNC point descriptions are also displayed as messages in the Execution Display facility. Note: For more information about the SYNC command, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

Chapter 13: Analysis Output 453

Analysis Output File

The Batch Processor provides restartability with .SYNC commands. You can also use .CALL commands to restart at a phase. The FLOAD and RREORG model utilities include the symbolic variable %RESTART, which you can set to automate utility restartability. Note: For more information about restarting utilities at phases, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

Impact Analysis The impact analysis appears at the end of the file. Impact Analysis must have been requested on the Strategy Analysis Options panel. Impact analysis for object migration strategies provides the following information. ■

The number of each object type included in the strategy.



The name and creator of each object included in the strategy.



For edited objects and objects changed through global changes, the old and new name and creator ID. Edited objects are flagged.



For table data, the number of rows per table included in the strategy, and the total number of rows, if data statistics were requested.

The following example shows impact analysis for an object migration strategy: ====================================================================== -- V890908

IMPACT ANALYSIS

====================================================================== ---

OBJECT TYPE: STOGROUP

TOTAL:

1

---

OBJECT NAME/CREATOR

EDITED

NEW NAME/CREATOR

---

DSN8G210

PTIPROD

DSN8G210

PTITEST

---

OBJECT TYPE: DATABASE

TOTAL:

1

---

OBJECT NAME/CREATOR

EDITED

NEW NAME/CREATOR

---

DSN8D21A

PTIPROD

DSN8D21A

PTITEST

---

OBJECT TYPE: TABLESPACE

TOTAL:

---

OBJECT NAME/DBNAME

EDITED

---

DSN8S21E

DSN8D21A

--

PROJ

DSN8D21A

--

454 User Guide

Y

NEW NAME/DBNAME

2

Analysis Output File

In the previous example, note the following: ■

The Object Type, Total lines display the total number of each object type at the beginning of the section for that object type.



The Object Name/Creator lines display the name and creator of each object included in the strategy.



If the name or creator of an object has been changed, the new values are displayed on the same line as the old values under New Name/Creator.



If the object has been edited, Y displays in the Edited field next to the object name.

If Data Statistics were requested, they will appear after the table information in the Impact Analysis. --

ACT

DSN8210

--

DUPLICATE GRANTS REMOVED =>

2

--

ROWS =>

18

ROWS =>

9

ROWS =>

34

ROWS =>

74

ROWS =>

21

ROWS =>

77

TOTAL:

12

--

DEPT

DSN8210

EMP

DSN8210

EMPPROJACT

DSN8210

PROJ

DSN8210

PROJACT

DSN8210

------------

OBJECT TYPE: INDEX

---

OBJECT NAME/CREATOR

EDITED

NEW NAME/CREATOR

---

XACT1

DSN8210

--

XACT2

DSN8210

--

XDEPT1

DSN8210

--

XDEPT2

DSN8210

For ACT, the name of each table displays. The creator ID is also displayed (for example, DSN8210). The number of duplicate grants removed and the number of rows from the table included in the strategy also display.

Chapter 13: Analysis Output 455

Analysis Messages

RPT IN DDLFILE You can use the RPT IN DDLFILE flag to control when the Change Analysis Report displays in the analysis output. Your options are as follows: ■

Y—If you specify Y and the strategy is analyzed in online or in batch mode, the Change Analysis Report displays on screen in the msgfile and in the job analysis output.



N—If you specify N and the strategy is analyzed in online mode, the Change Analysis Report does not display in the msgfile or in the job analysis output. However, if the strategy is analyzed in batch mode, the Change Analysis Report does display in the job analysis output. This is the default value.

Note: The only way you can view the Change Analysis Report in the analysis output in online mode is to specify RPT IN DDLFILE=Y.

Analysis Messages The analysis message file displays immediately after online analysis, if there are messages. For batch execution, the analysis message file is specified as MSGFILE in the analysis JCL and is routed to the destination specified on the //MSGFILE DD card. The default destination is the SYSOUT class specified in the Print Class field of the Print Parameters Profile screen.

Compare Report For compare strategies, this file displays the strategy name, creator, description, and share option, the rule name and creator, the source and target SSID or data set, the Compare Report, and any error or informational messages. Note: For more information about the contents of the Compare Report, see the “Compare Strategies” chapter. If analysis is performed in batch mode, the Compare Report is sent to the REPFILE DD indicated in the analysis job.

456 User Guide

Chapter 14: Execution Facility This section contains the following topics: Overview of the Execution Facility (see page 457) Analysis (see page 458) Submission (see page 463)

Overview of the Execution Facility The Execution Facility executes the output produced by the Analysis Facility. The Execution Facility invokes the Batch Processor to execute the commands. The Batch Processor is a standard facility in all CA Catalog products. The Execution Facility lets you perform the following functions: ■

Online or Batch Execution. The migration, compare or alteration can be executed in batch or online mode. For online execution, the DDL only option must be specified. For batch execution, the job can be written to a data set for later execution by a job scheduling system.



Audit Trail. Produced as a result of an execution, an audit trail shows all executed commands and their resulting return and reason codes. For DB2 utilities, the standard SYSPRINT output is also displayed.



Logging. All DDL is logged to the CA log tables. The log entry records the object name and creator, DDL function, date and time, and authorization ID.



Multiple DB2 Subsystems. During execution, users can attach and disconnect from multiple DB2 subsystems.



Multiple CPU Support. Different phases of a strategy can be run on different machines.



Authorization ID Switching. During execution, SET CURRENT SQLID and AUTH commands are issued to help ensure correct CREATOR and CREATEDBY authorization IDs when creating objects.



Restartable. Synchronization points are taken at every logical point during execution. If the job abends for any reason, the problem can be fixed and the job resubmitted with the RESTART flag set to YES. The Batch Processor provides restartability with .SYNC commands. You can also use .CALL commands to restart at a phase. The FLOAD and RREORG model utilities include the symbolic variable %RESTART, which you can set to automate utility restartability. See the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide for more information about restarting utilities at phases.

Chapter 14: Execution Facility 457

Analysis

The CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide describes how to submit RBP jobs for execution.

Analysis You can analyze a strategy as follows: ■

Analyze a strategy online (see page 458)



Analyze a strategy in batch mode (see page 459)

Analyze a Strategy Online You can analyze a strategy online as described in this section. To analyze a strategy online 1.

Access the Strategy Analysis screen as described in the appropriate Strategy Analysis chapter.

2.

Complete the information as described in the same chapter.

3.

Enter O in the Execution Mode prompt and press Enter. The analysis runs.

To stop the analysis process, press the ATTN key or the equivalent keystrokes on the system. If an analysis is interrupted, the analysis data set is affected as follows. ■

For partitioned data sets, the member is unchanged from its previous version.



For sequential data sets, an error message is written to the data set.

You can monitor the progress of the execution by using the Execution Display Facility, which is described in the “Execution Display Facility” chapter. During analysis, analysis messages are written to a reviewable file. This file is specified as MSGFILE in the analysis JCL. The DDL necessary to complete the migration, alteration or compare is written to the specified data set. For online execution, after analysis is complete, the analysis message file is automatically displayed so that you can review any analysis messages. After reviewing the message file, the data set containing the DDL displays. The DDL can be reviewed and edited at this point. Upon exiting the data set, the Strategy Analysis screen reappears.

458 User Guide

Analysis

Analyze a Strategy in Batch Mode You can analyze a strategy in batch mode as described in this section. To analyze a strategy in batch mode 1.

Access the Strategy Analysis screen as described in the appropriate strategy analysis chapter.

2.

Complete the information as described in the same chapter.

3.

Enter B in the Execution Mode prompt and press Enter. The Batch JCL Specification panel appears.

Execution Specifications The following describes the Execution Specifications area of the preceding screen: Destination Enter the destination of the batch job. You can submit the batch job to JES for execution or save it to a user-specified data set. If you send the job to a data set, you can use a job scheduling system to execute the job at predetermined times. Your options are as follows: ■

D—Place the job in the specified data set.



J—Submit job to internal reader (JES).



P—Preview the job. This option displays the job's complete JCL in an Edit session. This lets you review how CA RC/Migrator has replaced the symbolic variables. You can make changes to the Preview data set.

Output Data Set Specifications If a Job Destination of D is entered, a data set name must be entered. DATASET NAME Enter the name of a sequential file or PDS. If the name of a PDS is entered, the member name can be entered in parentheses within the data set name or next to the member name prompt. MEMBER NAME Specify a member if a PDS was specified. If no member name is specified, a member selection list displays. ISPF member selection list criteria (for example, MEMB*) can be entered to list only members that meet the criteria.

Chapter 14: Execution Facility 459

Analysis

VOLUME SERIAL Enter a Volume Serial number if the data set is not cataloged. REPLACE MEMBER Enter Y to replace the contents of an existing data set. Enter N to refrain from replacing existing data sets.

Model JCL Specifications Specify information about the model JCL member in the fields in this section, as follows: Model Library Enter the name of the library that contains the model JCL. By default, the member resides in the products model library, highlvl.MODEL. This information is saved until you change it. This must be a partitioned data set (PDS). Model Member Enter the name of the model JCL member. Selection criteria can also be entered to display a Member Selection list. The default is MJRCMANL. Volume Serial Enter a volume serial number if the data set is not cataloged. Edit Model JCL Enter Y to edit the specified model JCL member. An edit session for the data set allows necessary changes to be made to the model JCL member. The default for this field is N (do not edit the member). Update Values If the model JCL member contains user-defined symbolic variables, the Model JCL Substitution screen appears so symbolics can be replaced with actual values. Enter Y to display that screen for members with automatic symbolic values. Updating these values does not change the model JCL member. Note: For information about the Model JCL Substitution screen, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

460 User Guide

Analysis

Processing the Batch JCL Specifications After all information has been entered, including a valid destination, press Enter. ■

If you entered selection criteria in the output data set or model JCL member fields, a member selection list displays. Select a member and press PF3 (End) to return to the Batch Specification screen.



If you entered Y in the Edit Model JCL field, the input data set displays in an Edit session. Press PF3 (End) to return to the Batch Specification screen.



If you entered Y in the Update Values field, the Model JCL Substitution appears.



If you entered J for the destination, the job is submitted directly to JES.



If you entered D for the destination, the job is written to the specified data set.



If you entered P for the destination, the JCL is previewed in an Edit session. Press PF3 (End) to return to the Batch JCL Specification panel.

A message indicating whether the job was successfully sent to the specified destination appears. Press PF3 (End) to return to the Batch JCL Specification panel.

Chapter 14: Execution Facility 461

Analysis

Analysis JCL Following is an example of the JCL created during a batch analysis. This JCL is written to a data set that is executed to generate the commands necessary to complete the migration, alteration or comparison. *************************************** ***

CA MIGRATION ANALYSIS

***

*************************************** //ANALYZE

EXEC

//STEPLIB

DD DISP=SHR,DSN=DSN210.DSNLOAD

//PTILIB

DD DISP=SHR,DSN=PTI.R890818.LOADLIB

//MSGFILE

DD SYSOUT=*

//DDLFILE

DD DISP=SHR,

// //PARMFILE

PGM=PTLDRIVM

DSN=DSN210.GENERAL.TEST(RCMTST) DD *

************************************* SPECIFIED ANALYSIS OPTIONS.

***

************************************* CREATOR

PTIPH

STRATEGY

DSN8210

STRTSSID

PTI2

SYNCSSID

PTI2

TOSSID

PTI2

UNLDDSN

%USERID..%TBNAME..UNLOAD.DATA

UNLDUNIT

SYSDA

UNLDVOL

PTIPK1,PTIPK2,PTIPK3

CHECKDATA DATASTAT DROP REBIND RUNSTATS ALCB

*

PTIPH

ALCR

*

PTIPH

/*

In the EXEC statement, the PTLDRIVM identifies the driver (program location information). The STEPLIB and PTILIB ddnames identify the necessary DB2 and product load libraries. MSGFILE specifies the file to which the analysis messages are written. DDLFILE identifies the data set to which the results (DDL and RBP commands) are written. The specified analysis options identify the strategy being analyzed, and the DB2 subsystems containing the strategy (STRTSSID), the SYNC table (SYNCSSID), and the target subsystem (TOSSID). The other Analysis options displayed identify the options specified on the Analysis screen.

462 User Guide

Submission

The unload parameters are supplied in the UNLOAD model member. Note: For more information, see the “Profile” chapter. The codes specifying global changes are also specified. In this example, the global changes requested are that all Created By (ALCB) and Creator (ALCR) fields be changed from their present value (*) to PTIPH.

Return Codes Return codes are displayed at the end of analysis execution. They indicate any problems encountered during execution. The analysis return codes are: ■

0—Successful.



4—Warning in DDL.



8—Error in DDL.



12—SQL Error.



16—Miscellaneous Errors.



20—GETMAIN Error.

Return codes greater than 4 stop execution.

Submission Once a RBP data set has been created, it must be submitted for execution to execute the object changes. To invoke the Batch Processor submission screen, select Batch Processor from the Main Menu. Submitting Batch Processor jobs is described in the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide. The Batch Processor provides restartability with .SYNC commands. You can also use .CALL commands to restart at a phase. The FLOAD and RREORG model utilities include the symbolic variable %RESTART, which you can set to automate utility restartability. See the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide for more information about restarting utilities at phases.

Chapter 14: Execution Facility 463

Chapter 15: Execution Display Facility This section contains the following topics: Overview of the Execution Display Facility (see page 465) Usage (see page 466) Custom Display Format (see page 470) Execution Display Commands (see page 470) Define Execution Display Session Defaults (see page 473)

Overview of the Execution Display Facility The Execution Display facility is an online execution display of analysis and Batch Processor jobs. It shows the progress of the job as it executes. This online monitor lets you track the executions of one or more executions on multiple DB2 subsystems while you are logged on to one subsystem. The Execution Display: ■

Shows the real-time progress of analysis and strategy executions. All executing jobs are highlighted for easy identification. A status code displays next to each execution. The display can be scrolled horizontally and vertically.



Lets you view executions on multiple DB2 subsystems at the same time from one DB2 subsystem.



Shows progress of a batch execution by displaying the current syncpoint. If an error is encountered, you can look at the syncpoint record and restart the job. The Batch Processor provides restartability with .SYNC commands. You can also use .CALL commands to restart at a phase. The FLOAD and RREORG model utilities include the symbolic variable %RESTART, which you can set to automate utility restartability. See the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide for more information about restarting utilities at phases.



Provides a hands-off facility for monitoring job executions. You can automatically update the screen every n seconds when monitoring executions, using the CYCLE command.



Aids log maintenance. As you begin executing many jobs, the execution listing can become large. Old execution log entries can be deleted by simply entering D next to their names. Block deletes are also supported.

Chapter 15: Execution Display Facility 465

Usage



Set up and save custom display formats. The execution listing can be controlled through selection criteria. Columns can be sorted, excluded, and frozen. The custom formats can be saved and automatically applied when you reenter the facility.



Provides access to all familiar scrolling commands.

The Batch Processor IDs (BPIDs) displayed in the execution display are Batch Processor data sets or managed analysis outputs.

Usage To use the Execution Display, select Execution Display from the Main Menu. You can also enter an X next to a strategy name, a data set name, or managed output on the Strategy Services panel. If X is entered next to a strategy name and Enter is pressed, the Execution Display screen appears and the BPID field is pre-filled with an asterisk (*). Press Enter again, and all log entries for that strategy are displayed. If X is entered next to a data set name or managed output for a strategy and press Enter, the Execution Display screen appears and the BPID field is prefilled with the BPID for that strategy analysis. Press Enter, and the log entries associated only with that strategy analysis output will display. If the Execution Display Prefetch option on the Execution Profile screen is set to N, no rows are shown when the Execution Display appears. This lets you specify criteria before execution information displays. If the Execution Display Prefetch option is set to Y, rows are displayed using the search criteria last specified. See Defining Session Defaults for more information about the Execution Display Prefetch option and other display parameters.

Specifying Selection Criteria You can enter selection criteria at any time in the header fields on the Execution Display to limit or change the data displayed. Enter data in the following fields to specify selection criteria: BPID Specify the Batch Processor ID. Enter the fully qualified BPID of the data set or managed output being executed. The percent sign (%) and underscore (_) can be used as selection criteria to filter the selection list. The percent sign indicates that one or more characters can occupy that position and all remaining positions to the end of the BPID, or to the next character. The underscore indicates that only one character can occupy that position.

466 User Guide

Usage

Enter the BPID in one of the following formats: dataset

Indicates a sequential data set, where dataset cannot exceed 44 characters. datasetname-member

Indicates a PDS, where datasetname cannot exceed 44 characters and member must be from one to eight characters. Note: When specifying a data set name and member combination or managed output, the dash (-) delimiter is required, and blanks are not valid. strategycreator-strategyname-analysisuser-analysistimestamp

Indicates managed DB2 table output, where strategycreator, strategyname, and analysisuser each must be from one to eight characters, and analysistimestamp must be 16 characters. Note: Because data set names are usually prefixed with the ID of the user who submitted the job, the percent sign (%) can be used to list all jobs submitted by a specific user. DB2 SSID Specify the DB2 subsystem ID of the executing subsystem. This is also the subsystem where the execution display records are logged (in the table BPLOG_0200). A specific subsystem ID must be entered. Selection criteria are not accepted. Strat Creator Specify the creator of the strategy on which analysis is being run. By specifying a specific strategy creator, you can limit the information retrieved from the Batch Processor log. As with the BPID field, the percent sign (%) and underscore (_) can be used to help filter some of the creator names. Strat Name Specify the name of the strategy on which analysis is being run. By specifying a specific strategy name, you can limit the information retrieved. Note: For records generated by Batch Processor, the Strat Creator and Strat Name fields contain the value specified on the SN parameter of the .CONTROL Batch Processor command. Timestamp Specify a timestamp to limit the rows retrieved from the log table to those generated during a particular time. The timestamp takes the form CCYYMMDD (century, year, month, day). Hours, minutes, seconds, and hundredths of seconds (CCYYMMDDHHMMSS99) can also be specified.

Chapter 15: Execution Display Facility 467

Usage

Type Specify the type of record. Valid values are as follows: ■

S—Sync point (SYNC command, migration, alteration, or comparison executions). Batch Processor generated sync point record. Used by Batch Processor during restart processing.



A—Analysis. Generated by the analysis step.



M—Message record. Generated when the Batch Processor encounters the LOG parameter on a .MSG command.



L—Load record. Generated by CA Log Analyzer.

Status Specify the status of the execution. Valid values are as follows: ■

XI—Currently executing, BPID enqueued, connected to the DB2 system whose BP log is being viewed.



SC—Currently executing, but job is now connected to and logging to a different DB2 system.



NC—Completed successfully.



NI—Error during execution, job terminated.



FC—Forced completion (.EXIT command encountered that specified a return code of zero.)



FI—Forced incomplete (.EXIT command encountered that specified a non-zero return code.)



AB—Abended, BPID not enqueued. Indicates that the job abended before updating the log record to properly reflect the error condition. Such records might incorrectly have a status of XI (executing).

Unless otherwise noted, all the previous fields permit masking. After entering the information and pressing Enter, the Execution Display screen is refreshed with the rows that match the criteria. Note: Selection criteria are saved between sessions.

468 User Guide

Usage

Maintaining and Tracking the Executions You can specify the following values in the Option field (the left most column on the Execution Display) to maintain and monitor the executions: ■

D—Delete this entry from the log table. Entries with a status of FC or NC can be deleted. For other status codes, a deletion confirmation screen appears.



DD—Block delete. To delete a block of consecutively displayed rows, enter DD in the selection column next to the first and last rows that are to be deleted. The delete commands can be used in any combination. Note: Entries with the status code XI (currently executing) cannot be deleted. Entries with codes of FC and NC can be safely deleted. A warning displays before deleting entries with other status codes. If entries with status codes other than FC and NC are deleted, the jobs are no longer restartable.



E—Edit the data set or managed output. If an uncataloged data set is selected, a new data set is created and displayed on the edit screen. If managed output that no longer exists is selected, a screen prompt displays for another managed output.



B—Browse the data set or managed output. If a data set or managed output that is not cataloged or no longer exists is selected, a screen prompt displays for another data set name or managed output.



S—Submit the data set or managed output to Batch Processor for execution. If the selected data set or managed output is not cataloged or no longer exists, a screen prompt displays for another data set name or managed output.

Note: The BPID column displays the fully qualified BPID of the data set or managed output being executed. This column is frozen by default and cannot be unfrozen. The length of the display of this column can be changed using the BPIDCHAR command. (See Execution Display Commands for more information about the execution display commands.) A default length for the display of this column can be set on the Execution Display Profile screen. Additional fields can be displayed by scrolling right (PF11). See the online help for more information about these fields. Note: The Execution Display has its own SORT command, explained in Execution Display Commands.

Chapter 15: Execution Display Facility 469

Custom Display Format

BPID Considerations The BPID is inserted into the Batch Processor input .CONTROL statement at the time the analysis output DDL is submitted for execution, and it appears in the JCL that is built by Batch Processor when the job is submitted for execution. The BPID is required by the Execution Display facility to edit and browse analysis output and to resubmit or restart any of the jobs from the Execution Display panel. In addition, this BPID identifies analysis input to Batch Processor as coming from a data set or a managed DB2 table. Although alternate or user-created BPIDs are supported by Batch Processor and the Batch Processor Log, we recommend that you do not change the BPID generated by Batch Processor. If the BPID is altered in the Batch Processor .CONTROL statement, an error can appear when attempting to edit or browse the DDL or resubmit the job from the Execution Display panel. This error indicates that the file or managed output could not be found or that the BPID is unrecognizable or invalid.

Custom Display Format The Execution Display formatting commands (SAVEF, FORMAT, and UNFORMAT) work with the other Execution Display commands to let you save your preferred display format. The SAVEF command saves your format. Use the FORMAT command to recall a saved format. UNFORMAT returns the display to its default settings. These and the other Execution Display commands are discussed in Execution Display Commands.

Execution Display Commands In addition to the standard scrolling commands, the following special commands are available to control the display of the execution records. The commands can be entered on the command line or assigned to PF keys.

470 User Guide



BPIDCHAR (see page 471)



CYCLE (see page 471)



FORMAT (see page 471)



HEADER (see page 472)



PROFILE (see page 472)



SAVEF (see page 472)



SORT (see page 473)



UNFORMAT (see page 473)

Execution Display Commands

BPIDCHAR Controls the width of the BPID column in the Execution Display facility. The BPID column accepts a minimum of four characters and a maximum of 53 characters. Use the BPIDCHAR command to change the width of the BPID column by entering the following: BPIDCHAR #

Where # is the length of the column. The default width is 30. A default BPIDCHAR value can be set in the Execution Display Profile. If the BPIDCHAR command is used without entering a length for the BPID column, the value specified in Execution Display Profile is used. To omit the BPID column, enter a length of 0. Because the BPID column is permanently frozen, it cannot be excluded using the EXCLUDE command.

CYCLE Deactivates the refresh function of the Enter key and sets the refresh interval in seconds. Normally, the screen is refreshed with new data each time Enter is pressed. However, you can use the CYCLE command as follows to deactivate the refresh function so that the screen is refreshed automatically at a specified interval. CYCLE #

Where # is the number of second between refreshes. The default is 5 seconds. If a number less than five is entered, the cycle time is automatically changed to five seconds. To conserve system resources, do not set the cycle frequency faster than necessary. To turn CYCLE off and refresh data using the Enter key, press PF1. Note: If using a session manager, exit CYCLE by pressing ATTN, then RESET, then ATTN. These keystrokes must be entered before the beginning of the next refresh cycle.

FORMAT Switches the formatting to the Saved Execution Display format. A format must be saved with the SAVEF command before using the FORMAT command.

Chapter 15: Execution Display Facility 471

Execution Display Commands

HEADER Acts as a toggle to let you view the Execution Display screen without its header. If the header portion of the screen is currently being displayed, enter HEADER to turn it off. You can then enter HEADER to turn it on again.

PROFILE Displays the Execution Display Profile menu. The Print Parameters screen and the Execution Display Parameters screen can be accessed from this menu. The Execution Display Parameters screen lets users set defaults for the BPID column width and the cycle time interval. It also allows selection of the Execution Display Prefetch option and specification of whether the initial display is formatted with the user's saved display format (see SAVEF command). See Defining Session Defaults for more information about the Execution Display parameters.

SAVEF Saves personalized Execution Display formats from one session to the next. After formatting the Execution Display, enter the SAVEF command to save the following format information in your ISPF profile:

472 User Guide



The number of columns being displayed and their left-to-right order (controlled by the FREEZE and EXCLUDE commands)



Which columns are currently designated nonscrollable



The current length of the BPID column (controlled by the BPIDCHAR command)



The order in which log entries are currently being displayed (determined by the SORT command)

Define Execution Display Session Defaults

SORT Sorts the lines of scrollable data into ascending or descending order according to the data contained in one or more columns. The default order for sorting, if no SORT command is entered, is by BPID (in ascending order) and within like occurrences of the BPID by timestamp (in descending order). The SORT command allows specification of any number of column names as follows: SORT {column name 1} A|D [column name 2] A|D

If multiple columns are specified, the data is sorted by the first column specified (in the order requested). Like values of the first column are sorted by the second column specified, and so on. Note: This command functions differently than the general SORT command. The Execution Display SORT command allows specification of sorting parameters for multiple columns in one command.

UNFORMAT Returns the Execution Display to the default format established on the Execution Display Profile screen.

Define Execution Display Session Defaults You can define Execution Display session default values using the Execution Display Profile screens. A default can be set for the BPID column length and whether to prefetch execution records. Also you can specify whether the initial display is formatted with the your saved display format (SAVEF command). To define Execution Display session defaults 1.

Enter the PROFILE command while the Execution Display screen displays.

2.

Press Enter. The Execution Display Profile menu appears.

3.

Enter 1 to display the Execution Display Parameters screen. Note: Enter 2 to display the Print Parameters Profile screen. The Print Parameters screen is described in the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

Chapter 15: Execution Display Facility 473

Define Execution Display Session Defaults

4.

Enter values in the following fields to define session defaults for the Execution Display: Default BPID Width Enter the default display width of the BPID column on the Execution Display screen. The standard default is 30. The value specified in this field is used for each initial Execution Display session. To exclude the BPID column, enter 0. (The EXCLUDE command cannot be used on the BPID column because it is permanently frozen.) The BPID column length can also be changed with the BPIDCHAR command and save the value using the SAVEF command. Default Cycle Time Interval Enter the number of seconds to pause between each refresh of the displayed data when using the CYCLE command. This value is used by the CYCLE command if the command is issued without specifying a time interval. The standard default is five seconds. To conserve system resources, do not set the CYCLE frequency faster than necessary. If the refresh cycle is too rapid, it is more difficult to turn off the CYCLE command when running under a session manager. Execution Display Prefetch Enter Y to use previous values for the BPID, timestamp, status, log DB2 SSID, type of record, strategy name, creator, and execution DB2 SSID. Enter N to enable users to change search criteria before DB2 access takes place. The default is N. When PREFETCH is specified, the Execution Display screen displays using the selection criteria, which was used the last time the screen was displayed. This option is especially helpful to those who want to use the same selection criteria most of the time. By limiting the number of execution rows displayed, the time it takes to display strategies is reduced. Scrolling through the data selection is also easier with fewer listings. If the same search criteria is used most of the time, enter Y. Otherwise, enter N. Auto Load Saved Display Fmt Enter one of the following values.

5.

474 User Guide



Y—The initial display of information from the log is formatted using your saved display format (SAVEF command).



N—(Default) The initial display is shown using the default Execution Display format.

Save your changes. These values remain in effect until they are changed.

Chapter 16: Object Definition Defaults This section contains the following topics: Masking and ID Groups (see page 475) Required Authorization (see page 475) Define Defaults for Attributes Used during Object Creation (see page 476) Object Type Defaults (see page 477)

Masking and ID Groups You can define default definitions for individual users or for groups of users. Defaults can be assigned for groups of IDs using an ID mask. A mask is a valid TSO ID followed by an asterisk (*). When the DEF command is entered, a search for an object definition defaults entry for the ID is performed. If there is an entry for the ID, it is used. If there is not an entry, we look for the mask that most closely matches the ID. An asterisk by itself represents all IDs. A specific ID always takes precedence over a masked ID.

Required Authorization Use the Product Authorizations facility (described in the CA Database Management Solutions for DB2 for z/OS General Facilities User Guide) to define which users can view and change object definition defaults for which IDs. These privileges are shared between CA RC/Migrator and CA RC/Update.

Chapter 16: Object Definition Defaults 475

Define Defaults for Attributes Used during Object Creation

Define Defaults for Attributes Used during Object Creation When you define defaults for DB2 object attributes, the specified defaults are used as the initial attribute values when an object is created, templated, or altered. Note: When a template or alter screen initially appears, the values of the existing object are displayed. To change those values to the default values, enter APPLY DEF at the command line. To define defaults for object attributes used during object creation 1.

2.

Do one of the following on the command line: ■

From CA RC/Migrator, enter DEF.



From CA RC/Update, enter DEFAULTS.

Press Enter. The Object Definition Defaults screen appears. Note: Defaults for the current user or the mask ID that matches most closely are displayed.

3.

In the Userid field, specify the TSO ID of the user for whom object definition defaults are being defined. Enter a percent sign (%) to get a list of Object Definition Default entries.

4.

Specify a description in the Description field of the ID or the mask. This can be up to 30 characters.

5.

In the Action field, enter the action to perform on the ID specified in the Userid field. Valid values are as follows: ■

R—Retrieve the object definition defaults.



S—Save the object definition entries.



D—Delete the object definition entries.

Note: Some users have authority to view and change object definition defaults for all IDs. Others can view and change object definition defaults only for their own IDs. Still others can only view object definition defaults for their own IDs. 6.

476 User Guide

Press Enter to process the Action field value.

Object Type Defaults

7.

8.

Review and update the default values as needed for the object attribute in the Default Value field. Note the following fields: ■

Object Type—The type of DB2 object to which the attributes apply. Global defaults apply to all DB2 object types.



Object Attribute—The name of the object attribute.



Valid Entry Information—For some attributes, information displays in this area to help specify a valid value.

Once the necessary changes have been made, enter S in the Action field to save the entries, and press Enter.

Object Type Defaults The following defaults can be set on the Object Definition Defaults screen: ■

Global defaults (see page 477)



Storage group defaults (see page 479)



Database defaults (see page 480)



Tablespace defaults (see page 480)



Table defaults (see page 482)



Sequence defaults (see page 483)



Index defaults (see page 485)



View defaults (see page 486)



Alias defaults (see page 487)

Global Defaults Global Defaults apply to all DB2 object types to which the attribute pertains. However, if an attribute default is also specified for the specific object type, that value is used. Enter a value in the Default Value field to the right of the appropriate attribute name to set the default as needed.

Chapter 16: Object Definition Defaults 477

Object Type Defaults

The following defaults let you establish default values for a specific object attribute across all of the object types to which the attribute pertains. Creator Specify the default creator to use for a newly created object. ■

(blank)—(Default) Use the current User ID as the default creator for all object types.



userid—Use the User ID you enter in this field as the default creator for all object types.

SQLID Use the Current SQLID in effect at creation time as the default creator for an object you create. If you enter an explicit entry in the Creator field for any object type on this screen, it overrides the Global Defaults value for that type. Note: The following values also apply for individual object types, except that explicit (SQLID or non-blank) individual object type values override the Global Defaults value. VCAT NAME VSAM catalog. Enter selection criteria to display an object selection list. STOGROUP Storage Group. Enter selection criteria to display an object selection list. PRIMARY QTY Primary Allocation for storage groups in KB. SECONDARY QTY Secondary Allocation for storage groups in KB. FREEPAGE Number of pages loaded before a page is left as free space (0-255). PCTFREE Percentage of each page left as free space (PCTFREE) (0-99). BUFFER POOL Buffer pool. BP0, BP1, BP2, BP32K. DATABASE Database. Enter selection criteria to display an object selection list. PARTITIONED Indicates whether the tablespace or index will be partitioned. YES or NO.

478 User Guide

Object Type Defaults

CLOSE Indicates whether the VSAM data sets allocated to the tablespace are closed when the tablespace is not in use (resource consideration). YES or NO. CCSID (Coded Character Set Identifier) Specify the encoding scheme for the object. Valid values are as follows: ■

Ascii—Specifies that the data must be encoded using the ASCII CCSIDs specified during installation.



Ebcdic—Specifies that the data must be encoded using the EBCDIC CCSIDs specified during installation.



Default—Specifies that the CCSID argument is to be omitted from the generated DDL. When creating an object, the default encoding scheme that is used depends on the object type and how it is created. The rules used in determining which encoding scheme to use are decided by DB2. See the IBM DB2 SQL Reference or Administrator guides for more information about default encoding schemes. When altering an object, the encoding scheme of the object is changed to the current default encoding scheme if it is different than the encoding scheme currently used by the object.



Unicode—Specifies that the data must be encoded using the Unicode CCSIDs specified during installation. This value is only supported by DB2 versions 7.1 and later.



blanks—None. This has the same meaning as Default.

Storage Group Defaults The following defaults can be specified for storage groups. CREATOR Authorization ID of the owner of the storage group. VCATNAME Name of the VSAM catalog used to track the DASD volumes defined by the storage group. Enter selection criteria to display an object selection list. VOLUME1 - VOLUME6 VOLSERs for space allocation. Enter selection criteria to display an object selection list.

Chapter 16: Object Definition Defaults 479

Object Type Defaults

Database Defaults The following defaults can be specified for databases. Note: For more information about these fields, see the “Database” chapter. CREATOR Authorization ID of the owner of the database. STOGROUP The database's storage group. All table and indexspaces will use this storage group by default unless they specify their own. Enter selection criteria to display an object selection list. BUFFER POOL The database's buffer pool. All table and indexspaces will use this buffer pool by default unless they specify their own. CCSID (Coded Character Set Identifier) Specifies the CCSID encoding scheme.

Tablespace Defaults The following defaults can be specified for tablespaces. For more information about these fields, see the “Tablespace” chapter. CREATOR Primary authorization ID of the owner of the tablespace. DATABASE Name of the database that contains the tablespace. VCAT NAME The name of the VSAM catalog used to track the DASD volumes defined by the tablespace. Each partition can reference a different VSAM catalog. STOGROUP Partition's storage group. This can be different for each partition. PRIMARY QTY Primary allocation in KB. SECONDARY QTY Secondary allocation in KB.

480 User Guide

Object Type Defaults

FREEPAGE Number of pages loaded before a page is left as free space. PCTFREE Percentage of each page left as free space. PARTITIONED Denotes whether the tablespace is partitioned. BUFFER POOL The tablespace's buffer pool. CLOSE Denotes if the VSAM data sets allocated to the tablespace are closed when the tablespace is not in use (resource consideration). SEGSIZE The number of pages in each segment of the segmented tablespace (must be a multiple of 4 from 0 to 64). Zero if tablespace is not segmented. COMPRESS Indicates whether ESA compression is used on the data rows for this tablespace or this partition of the tablespace. LOCKSIZE Lock size of the tablespace. Determines how DB2 locks the pages in the tablespace. LOCKMAX The maximum number of page or row locks that an application can hold in the tablespace before locks are escalated from the level indicated in the LOCKSIZE field. TS Type Specifies the type of tablespace. CCSID (Coded Character Set Identifier) Specifies the CCSID encoding scheme. DEFINE Indicates whether to defer the physical allocation of DB2-managed data sets.

Chapter 16: Object Definition Defaults 481

Object Type Defaults

Table Defaults The following defaults can be specified for tables. For more information about these fields, see the “Table” chapter. CREATOR Primary authorization ID of the owner of the table. DATABASE Table's database. TABLESPACE Table's tablespace. AUDIT Determines which value is specified for the AUDIT clause of the CREATE TABLE statement. The AUDIT value determines the types of access to this table that will cause auditing to be performed. COLUMN DATA TYPE Data type for columns. COLUMN NULL INDICATOR The value used for the NULL clause of the CREATE TABLE and ALTER TABLE statements. COLUMN DEFAULT IND. The value used for the DEFAULT clause of the CREATE TABLE and ALTER TABLE statements. The possible entries for this field depend on the value entered (Y or N) for the Column Null Indicator. DATA CAPTURE Indicates whether SQL changes to the table should be written to the Log. Table Type Specifies the type of table. CCSID (Coded Character Set Identifier) Specifies the CCSID encoding scheme. Volatile Specifies how DB2 chooses access to the table. Valid values are as follows:

482 User Guide



Y—Index access should be used on this table whenever possible for SQL operations. The VOLATILE clause is generated and inserted into the DDL.



N—SQL access to this table should be based on the current statistics. The NOT VOLATILE clause is generated and inserted into the DDL if necessary.

Object Type Defaults

Sequence Defaults The following defaults can be specified for sequences: Schema Specifies the default schema name (qualifier) to be used when creating an explicitly qualified sequence. Note: The name cannot begin with the character string SYS (unless it is SYSADM). Default: Blanks As Type Specifies the default data type to be used for the sequence. The type can be SMALLINT, BIGINT, INTEGER, or DECIMAL with a scale of 0, or the type can be a user-defined distinct type for which the source type is an exact numeric data type with a scale of 0. Default: INTEGER Note: If you do not specify a value, the corresponding field on the Sequence Create panel will default to an asterisk (not INTEGER). Type Schema Specifies the default type schema name (qualifier) of the data type to be used for the sequence when data type is a distinct type. Default: SYSIBM Note: If you do not specify a value, the corresponding field on the Sequence Create panel will default to an asterisk (not SYSIBM). Precision Specifies the default precision for the sequence. Precision depends on the data type of the sequence. You can enter a specific value for Precision only if the specified data type is one of the following: ■

A user-defined type (from which a defined precision can be picked up) Note: When the sequence's data type is SMALLINT, INTEGER, or a distinct type that is sourced on SMALLINT, BIGINT, INTEGER, or DECIMAL, you cannot edit the Precision field. Instead, the field displays a precision that is inherent to (or defined for) the specified type.



DECIMAL

If the data type is not user-defined or DECIMAL, Precision is set to 10 (for an INTEGER type) or 5 (for a SMALLINT type). Default: 10

Chapter 16: Object Definition Defaults 483

Object Type Defaults

START WITH Specifies the default start value for the sequence. The value can be any positive or negative value that could be assigned to a column of a data type (without non-zero digits existing to the right of the decimal point). Default: Blanks INCREMENT Specifies the default increment interval between consecutive values of the sequence. The value can be any positive or negative value (or 0) within the scope of an INTEGER that could be assigned to a column of a data type (without any non-zero digits existing to the right of the decimal point). Default: Blanks MINVALUE Specifies the default minimum value at which one of the following occurs: ■

A descending sequence cycles or stops generating values.



An ascending sequence cycles after encountering the maximum value (or the NO keyword).

Note: In CA RC/Update, this field does not allow the keyword NO when the DB2 version is less than V8. Default: Blanks MAXVALUE Specifies the default maximum value at which one of the following occurs: ■

An ascending sequence cycles or stops generating values.



A descending sequence cycles after encountering the minimum value (or the NO keyword).

Note: In CA RC/Update, this field does not allow the NO keyword when the DB2 version is less than V8. Default: Blanks CYCLE Specifies whether the sequence should continue generating values after reaching its maximum value or minimum value. The boundary of the sequence can be reached with the next value landing exactly on the boundary condition or by overshooting the boundary. Valid values are YES, NO, and blanks. Default: NO

484 User Guide

Object Type Defaults

CACHE Specifies one of the following: ■

Maximum number of values of the sequence that DB2 can preallocate and keep in memory



NO

Default: 20 ORDER Specifies whether the sequence numbers must be generated in order of request. Valid values are YES, NO, and blanks. Note: In CA RC/Update, this field shall not display when the DB2 version is less than V8. Default: NO

Index Defaults The following defaults can be specified for indexes. See the “Index” chapter for more information about these fields. CREATOR Primary authorization ID of the index (and indexspace) owner. TABLE CREATOR Creator of the table the index is based on. VCAT NAME The name of the VSAM catalog under which you user defined data sets have been created. STOGROUP Storage group for index (if not partitioned) or partition (if partitioned). This can be different for each partition. PRIMARY QTY Primary allocation in kilobytes. SECONDARY QTY Secondary allocation in kilobytes. FREEPAGE The number of pages loaded before a page is left as free space. PCTFREE The percentage of each subpage or nonleaf page that is left as free space.

Chapter 16: Object Definition Defaults 485

Object Type Defaults

UNIQUE Denotes whether the UNIQUE keyword is included in the CREATE INDEX statement. CLUSTER Denotes whether the CLUSTER keyword is included in the CREATE INDEX statement. PARTITIONED Denotes whether the index is partitioned. BUFFER POOL The buffer pool for the index. CLOSE Denotes if the VSAM data sets allocated to the index are closed when the index is not in use (resource consideration). TYPE Indicates the index type. DEFINE Indicates whether to defer the physical allocation of DB2-managed data sets.

View Defaults The following defaults can be specified for views. See the “View” chapter for more information. CREATOR Creator of the view. W/CHECK OPTION Specifies if the CHECK OPTION is specified in the CREATE VIEW statement.

486 User Guide

Object Type Defaults

Alias Defaults The following defaults can be specified for aliases. Note: For more information about these fields, see the “Alias” chapter. CREATOR Authorization ID of the owner of the alias. TABLE LOCATION Location of the table on which the alias is based.

Chapter 16: Object Definition Defaults 487

Chapter 17: Storage Group This section contains the following topics: Overview of Storage Groups (see page 489) Storage Group Functions (see page 490) Accessing Storage Group Functions (see page 490) Storage Group Create Option (see page 494) Storage Group Template Option (see page 495) Storage Group Alter Option (see page 496) Drop Considerations (see page 496) DDL Execution (see page 497)

Overview of Storage Groups The Storage Group option lets you create, template, alter, and drop DB2 storage groups. A storage group is a DB2 object that represents a named set of DASD volumes controlled by a specified VSAM catalog (VCAT), on which DB2: ■

Allocates storage for tablespaces and indexes



Defines the necessary VSAM data sets



Extends and deletes VSAM data sets as required

DB2 monitors and maintains the storage groups, and uses them to store DB2 table and index spaces. A storage group can be assigned to a database, tablespace, or index space. All tables that reside in a given tablespace use that tablespace's storage group. Following are some of the ways DB2 helps manage external storage requirements. ■

When a tablespace is created, DB2 uses VSAM access method services to define the necessary VSAM data sets. After the data sets have been created, they can be processed with access method service commands that support VSAM control-interval (CI) processing.



When a tablespace is dropped, DB2 automatically deletes the associated data sets.



When a data set in a simple tablespace reaches its maximum size of 2 GB, DB2 can automatically create a new data set.



When needed, DB2 can extend individual data sets.

Chapter 17: Storage Group 489

Storage Group Functions

Storage Group Functions The functions to create and maintain storage groups include: ■

Volume and VCAT Selection Help. When defining a storage group, the names of the volumes or VCAT that the storage group references must be entered. Instead of having to remember and enter specific volume and VCAT names, they can be selected by entering selection criteria to receive a list of volumes or VCATs.



Line Commands. Insert and Delete line commands are supported to assist in manipulating the volume list.



Template Option. The Template option permits creation of a new storage group, using an existing storage group as a model. Enter selection criteria to receive a more specific list of storage groups.



Alter Option. The Alter Storage Group option lets you change any characteristic of the storage group. While DB2 allows only the addition or removal of volumes from the storage group, we let you change the VCAT or even the storage group name. This is done by dropping, then recreating the storage group. Like the Template function, the Alter function lets you select from lists of storage groups, VCATs, and volumes.

Accessing Storage Group Functions This section describes how you can access storage group functions from within each strategy type. Specific entry paths are described. ■

For alteration strategies, to create, alter, template, or drop a storage group, enter C, A, T, or D in the Option field and SG in the Object field of the Alteration Strategy Services panel. The appropriate storage group screen appears.



For migration strategies, to create a storage group, enter U in the New Objects field of the Implode/Explode Services. The Object Creation Services screen appears. Enter an S under Stogroup and press Enter. To alter a storage group through a migration strategy, enter E in the Selection field next to the name of a storage group which is included in your strategy on the Implode/Explode screen. Only primary and dependent objects can be altered in a migration strategy. A storage group cannot be templated or dropped through a migration strategy because it is not a dependent object. To perform a drop, exclude the object from the migration. The appropriate storage group screen appears.

490 User Guide

Accessing Storage Group Functions



For compare strategies, to create or drop a storage group through a compare strategy, enter U in the Create/Drop Objects field of the Compare Explode Services screen. The Create/Drop Object Selection screen appears. –

To create a storage group, enter C in the Option field and DB in the Object field. The Database Create screen appears.



To drop a storage group, enter D in the Option field and SG in the Object field. A selection screen appears. Select the object to be dropped.

To alter a storage group through a compare strategy, enter E next to the name of a storage group included in the strategy on the Compare Explode Services screen. The Storage Group Alter screen appears. Objects cannot be templated in compare strategies.

Selection Screens When you choose to alter, drop, or create by template a storage group, a selection screen appears that lets you select the storage groups not already specified. Make the storage group selection list more specific by specifying selection criteria for the Item (storage group) Name and Creator ID prompts in the header. The EQF facility can also be used to further specify the storage groups displayed. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about EQF.

Selection Criteria The Item Name and Creator fields let you specify a specific storage group name or search conditions for retrieving multiple objects. These fields accept the following SQL search criteria: ■

Asterisk (*)—The asterisk selects all objects. All storage groups in the system are displayed.



Percent sign (%)—The percent sign is a wild card character that will match zero or more characters.



Underscore (_)—The underscore character indicates that any one character can occupy that position.

Note: For more information about SQL search criteria, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide). The Storage Group Selection screen displays information from the SYSIBM.SYSSTOGROUP table to make selection of the storage groups easier.

Chapter 17: Storage Group 491

Accessing Storage Group Functions

To choose items from the listing, type an S (select) in the Sel column next to the items you want to select. Press Enter to register the selection. Note: You can also enter a question mark (?) or query option, to display a CA RC/Query menu or report for the option specified. See the CA RC/Query User Guide for lists of report options per object type. The following fields are displayed in every Storage Group Selection screen. Stogroup Eight-character name assigned to the storage group. Creator ID of storage group creator. Vcatname Name of the VSAM catalog associated with the storage group. Eightcharacter maximum. Space, Space Date Displays space information provided by the STOSPACE utility. The Space field displays the number of kilobytes of storage allocated to the storage group. The Space Date field is the date the Space field was last updated. Press Enter to register the selection: ■

For templates and alters, each storage group selected is processed individually, beginning with the storage group first on the selection list, and continuing in the order of the selection list.



For standard drops, all selected storage groups are dropped together.



For recoverable drops, each storage group is dropped one at a time.

For more information about drops, see the CA RC/Update User Guide.

VCAT Selection List If the name of the VCAT you want to use is not known, enter an asterisk (*) in the Vcat field of the storage group screen. This provides a complete listing of VCATs currently referenced within DB2. Selection criteria can also be entered for a partial listing. When you press Enter, a list of VCATs appears from which you can select.

492 User Guide

Accessing Storage Group Functions

Insert a Volume from Another Storage Group The Volser field on the storage group screen indicates the names of the volume serial IDs that you want to include. To insert a volume from another storage group 1.

Insert a new volume (unless overwriting an existing volume).

2.

If the first letters of the volume name are known, enter the letters followed by a percent sign (%) in the Name field. If the volume name is unknown, you can enter an asterisk (*) to display a list of all volumes from all current storage groups. This should be avoided and can be very timeconsuming.

3.

Press Enter. The Volume Selection List screen appears.

4.

Enter S next to each volume to select and press Enter. Note: Enter the S (shrink) toggle command in the command line to view the volumes that have been queued.

5.

Press PF3 (End) to return to the Storage Group screen. The selected volumes are automatically inserted.

Storage Groups Compared to VSAM Data Sets To maintain closer control over the physical storage of tables and indexes, users can define and manage their own VSAM data sets instead of using storage groups. To do this, there must be at least one VSAM catalog. The VSAM data sets can then be defined and managed by selecting a specific (explicit) VCAT when creating tablespaces and indexes.

Commands The HEADER and COMPARE commands can make working with storage groups easier as follows: ■

HEADER—Toggles the header on and off. This is helpful when viewing a long list of VCATs or volumes. Enter H or HEADER in the command line to toggle the header.



COMPARE—Displays old and new versions of the storage group for comparison. Use the RESET command to reset a changed volume to its original status.

Note: For more information about the primary commands, see the online help.

Chapter 17: Storage Group 493

Storage Group Create Option

Storage Group Create Option The Storage Group Create option performs all functions of the SQL CREATE STOGROUP statement. This statement defines a set of VSAM controlled volumes on which storage can later be allocated for tablespaces and indexes. When defining a storage group, you must enter the names of the volumes or VCATs that the storage group will reference. Selection lists can be used. See VCAT Selection List and Volume Selection List for more information. The DDL used to create the storage group is generated when the strategy creating the storage group is analyzed.

Storage Group Create Screen The Storage Group Create screen provides an easy way to supply the information necessary for storage group creation. The following describes the fields on this screen: Stogroup Eight-character name assigned to the storage group. Enter the storage group name here. If a name was entered in the Item Name field of the main header, the name is carried to this screen and displayed in this field. Creator Enter the ID of storage group creator here. If a creator ID was entered in the main header, the ID is carried to this screen and displayed in this field. VCAT Enter the name of the VSAM catalog associated with the storage group. Eight-character maximum. See VCAT Selection List for more information. Password Enter the VSAM Catalog password here, if one is required. A VSAM password only needs to be entered if the VSAM Catalog is password protected. Entering a password only tells DB2 what password to use when accessing the catalog. CMD (Line Command) Enter line commands here. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about line commands.

494 User Guide

Storage Group Template Option

Volser Indicate the volume serial IDs to include. The following rules apply to volume serial IDs. See Volume Selection List for more information. ■

The volume name can be a maximum of six characters.



A maximum of 133 volumes can be entered.



The volumes must all be of the same device type.



Volume types cannot be mixed.

The insert and delete commands can be used to manipulate the volume entries. (Block mode is also supported.) Although move and copy are valid commands, they are irrelevant, as volume order is not important. Also, replicate is not supported, as the same volume name cannot be designated more than once. Enter an asterisk (*) to select an SMS-managed volume.

Processing Considerations DB2 does not validate the volume names or VSAM catalog name when the storage group is created. These objects are only validated when a tablespace or index is defined that references the storage group. When a tablespace or index that references a storage group is created with an invalid VSAM catalog name or volumes, the tablespace or index create will fail. For invalid volumes, DB2 issues a CONNECT command to the master console for the missing volumes.

Confirming the Creation When you have entered all your information on the Create screen and pressed PF3 (End), the Creation Confirmation screen appears.

Storage Group Template Option The template option allows the creation of a new storage group using an existing storage group as a template. A template session is actually a create session with the additional step of selecting a storage group as a starting point. The name of the templated storage group must be changed on the Storage Group Template screen. The other fields can be changed as needed. Dependent objects are not included in the template operation. Press PF3 (End) when all changes have been made.

Chapter 17: Storage Group 495

Storage Group Alter Option

Storage Group Alter Option The Storage Group Alter screen performs all functions of the SQL ALTER STOGROUP statement. This statement changes the definition of a storage group. The DB2 ALTER statement can change all the parameters used initially to create the storage group, except the VSAM catalog name and the name of the storage group itself. (For more information about the fields on this screen, see Storage Group Create Screen.) You can add or delete volumes using the DB2 ALTER STOGROUP statement. The changes do not affect the storage of existing objects in the storage groups, but do affect the future assignments of storage within the group: an object defined later can be assigned to an added volume, but cannot be assigned to a deleted volume. To change the storage group name, VCAT name, or creator name, you must drop and re-create the storage group. If this type of change is made, the RC/Alter Specification screen appears and you will be prompted for information about the data set to which the DDL should be written. The DDL must then be executed in batch mode. Note: For more information, see the CA RC/Update User Guide. If the alter is one that can be performed by a DB2 ALTER STOGROUP statement, a confirmation screen appears where you can accept, edit, or reject the DDL to be executed.

Drop Considerations Rules of DB2 specify that a storage group cannot be dropped if it contains tablespaces or indexspaces. RC/Objects automatically drops tablespaces or indexspaces necessary for the storage group drop, and then drops that storage group. If the default storage group of a database is dropped, an explicit storage group name must be used when creating a tablespace or index in the database. When using the standard drops (S or SO), if one or more of the drops requested cannot be completed, none of the drops are committed. Note: For information about the various drop options, see the CA RC/Update User Guide.

496 User Guide

DDL Execution

DDL Execution After pressing PF3 (End) to process the storage group information, a confirmation screen appears. Reviewing the confirmation screen lets you accept, edit, or reject the DDL to be used to complete the request. Note: If your changes are complex, require dropping and recreating objects (and their dependencies), or the current RC/Update Operation Mode is set to A (RC/Alter), you can perform a complete analysis of your changes that includes rebuilding the DDL and optionally including utility statements and extended DDL generation and analysis options.

Chapter 17: Storage Group 497

Chapter 18: Database This section contains the following topics: Overview of Databases (see page 499) Accessing Database Functions (see page 499) Selection Screens (see page 501) Commands (see page 502) Database Create (see page 502) Database Template (see page 505) Database Alter (see page 505) Create a Database for Declared Temporary Tables (see page 506) Drop Considerations (see page 506) DDL Execution (see page 506)

Overview of Databases In DB2, a database is a set of DB2 objects. When a DB2 database is defined, a name is given to an eventual collection of tables and associated indexes, as well as to the table and index spaces in which those tables and indexes reside. A single database, for example, can contain all the data associated with one application or with a group of related applications. Collecting that data into one database lets you start or stop access to all the data in one operation, and grant authorization to access all the data in a single unit. The database object options let you create, template, alter, and drop databases. A series of screens request the information necessary to create the DDL to perform the requested operation. A list of storage groups is also provided from which the default for the database can be selected.

Accessing Database Functions You can access database functions from within each of the following strategy types: ■

Alteration strategy (see page 500)



Migration strategy (see page 500)



Compare strategy (see page 500)

Chapter 18: Database 499

Accessing Database Functions

Alteration Strategy To create, alter, template, or drop a database through an alteration strategy, enter C, A, T, or D in the Option field and DB in the Object field of the RC/M Alteration Strategy Services panel. The appropriate database screen appears.

Migration Strategy To create a database through a migration strategy, enter U in the New Objects field of the RC/M Implode/Explode Services. The RC/M Object Creation Services screen appears. Enter S under Database and press Enter. To alter a database through a migration strategy, enter E in the Selection field next to the name of a database included in the strategy on the RC/M Implode/Explode screen or the Dependent Object Selection screen. Only primary and dependent objects can be altered in a migration strategy. To template a database through a migration strategy, enter T in the Selection field next to the name of the database to be templated on the Dependent Object Selection screen. Only dependent objects can be templated in a migration strategy. Objects cannot be dropped in a migration strategy. The appropriate RC/Migrator Database screen appears.

Compare Strategy To create or drop a database through a compare strategy, enter U in the Create/Drop Objects field of the RC/M Compare Explode Services screen. The RC/M Create/Drop Object Selection screen appears. To create a database, enter C in the Option field and DB in the Object field. The RC/Migrator Database Create screen appears. To drop a database, enter D in the Option field and DB in the Object field. A selection screen appears. Select the object to be dropped. To alter a database through a compare strategy, enter E next to the name of a database included in the strategy on the RC/M Compare Explode Services screen or the RC/M Dependent Object Mapping screen. The Database Alter screen appears. Objects cannot be templated in compare strategies.

500 User Guide

Selection Screens

Selection Screens When altering, dropping, or creating (by template) a database, a selection screen appears to select a database if not already specified. Make the database selection list more specific by specifying selection criteria for the Item (database) Name or Creator ID prompts in the header. The EQF facility can also be used to further specify the databases displayed. Note: For more information about EQF, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. The Database selection screen has five fields available in the SYSIBM.SYSDATABASE table. This information displays to make database selection easier. All CA RC/Migrator selection screens support the standard scrolling commands. Note: For more information about the scrolling commands, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. The following fields are displayed in the database selection screen. Sel Enter one of the following options: ■

S—Select the object you want to process and press Enter. The appropriate screen for that object appears.



?—Access CA RC/Query and display the RC/Query menu for that object type. Note: For lists of report options per object type, see the CA RC/Query User Guide. You must have a license for CA RC/Query to use this option.

DATABASE The database name. CREATOR The database creator ID. STOGROUP The default storage group for the database. BUFFPOOL Default buffer pool for tables and indexes within the database. DBID The ID assigned by DB2 to the database.

Chapter 18: Database 501

Commands

For templates and alters, each selected database is processed individually, beginning with the database selected first from the selection list. For Standard Drops, all selected databases are dropped together. For Recoverable Drops, each database is dropped one at a time. Note: For more information about drops, see the CA RC/Update User Guide.

Commands The Header and Compare commands can make working with databases easier. Following is a brief description of how to use these commands. ■

HEADER—Toggles the header on and off. Enter H or HEADER in the command line to toggle the header.



COMPARE—Displays a summary of changes made to the database. This can be useful when templating or altering a database. Use the RESET command to reset changed attributes to their original status.

Database Create The Database Create option performs the same functions as the SQL CREATE DATABASE statement. A screen is provided where you can supply the information necessary to generate the DDL to be used to create the database. When defining a database, you can specify a default storage group. CA RC/Migrator assists in defining the storage group by displaying a list of storage groups from which the default can be selected. The DDL used to create the database is generated when the strategy creating the database is analyzed.

Database Alter Screen The Database Alter screen, shown following, provides an easy way to supply the information necessary for database creation: Notice the following fields on the screen. Database The database name has a maximum of eight characters. If a name is entered in the Item Name field of the main header, it is passed to this field. Creator The database creator ID. If an ID is entered in the Creator ID field of the main header, it is passed to this field.

502 User Guide

Database Create

Stogroup The default storage group for the database. The default is SYSDEFLT. You can also use the wildcard % (the percent character) or enter specific selection criteria to select a storage group from a list on the Storage Group Selection screen. Buffer Pool The name of the bufferpool to be associated with the tablespace. A valid bufferpool name must be used or you will receive an SQL error. The default is BP0. Valid entries are: BP0 to BP49, BP32K, and BP32K1 to BP32K9. Index BP Defines the default buffer pool for indexes. Note: If the database is a work file database, do not specify a name. Specify DEFAULT to use the buffer pool specified for user indexes on installation panel DSNTIP1. As ==> Enter one of the following: ■

TEMP—Specifies that the database is for declared temporary tables only. You can create only one temporary database for each DB2 subsystem or data sharing member. A temporary database cannot be shared between DB2 subsystems or data sharing members. Specifying TEMP causes the AS TEMP clause to be inserted into the generated DDL.



WORKFILE—Specifies that the database is a work file database. This value is valid only in a data sharing environment. You can create only one work file database for each DB2 member. Specifying WORKFILE causes the AS WORKFILE clause to be inserted into the generated DDL.



blanks—Specifies that a regular database is to be created, a database that is neither a work file nor temporary database. When you specify blanks, the AS clause is omitted from the generated DDL.

For ==> Enter the name of the data sharing group member for which this database is the work file.

Chapter 18: Database 503

Database Create

CCSID (Coded Character Set Identifier) Specify the default encoding scheme for data stored in the database. This default applies to tablespaces created in the database. All tables within a tablespace must use the same encoding scheme. Valid values are as follows: ■

Ascii—Specifies that the data must be encoded using the ASCII CCSIDs specified during installation.



Ebcdic—Specifies that the data must be encoded using the EBCDIC CCSIDs specified during installation.



Default—Specifies that the CCSID argument is omitted from the generated DDL. Note: For more information about default encoding schemes, see the IBM DB2 SQL Reference and Administrator guides. When creating a database, the new object will use the default encoding scheme, which is the value of the Def Encoding Scheme field on the DB2 installation panel (DSNTIPF). When altering a database and the encoding scheme is different than the default, the current encoding scheme of the database is changed to the encoding scheme currently used by the database.



Unicode—Specifies that the data must be encoded using the Unicode CCSIDs specified during installation. This value is only supported by DB2 versions 7.1 and above.



blanks—Specifies that the database does not have an encoding scheme. This is applicable when the Workfile field is set to W, in which case CCSID must be set to blanks.

Confirming the Creation Once all information has been entered on the Create screen and PF3 (End) is pressed, the Creation Confirmation screen appears.

Storage Group Object Selection Screen Use the Stogroup selection screen to assign a default storage group name for working with databases. This screen appears when you enter selection criteria in the Storage Group field on one of the CA RC/Migrator Database screens and press Enter. Note: For information about selection criteria, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide.

504 User Guide

Database Template

The following describes the fields on this screen: STOGROUP Eight character name assigned to the storage group. CREATOR ID of storage group creator. VCATNAME Name of the VSAM catalog associated with the storage group. SPACE, SPACE DATE Space information provided by STOSPACE utility. The SPACE field displays the number of kilobytes of storage allocated to the storage group. The SPACEDATE is the date the SPACE field was last updated. To select a storage group, enter an S next to the storage group to select and press Enter. The RC/Migrator Database screen reappears.

Database Template The template option allows the creation of a new database using an existing database as a template. A template session is actually a create session with the ability to select a database as a starting point. The name of the templated database must be changed. The other fields can be changed. Dependent objects are not included in the template operation. The Database Template screen displays the values used to create the template database. Change the fields for the new database according to the procedures outlined in Database Create. Once changes have been made, press PF3 (End) to process the template. A Confirmation screen will appear, enabling you to accept, edit, or reject the DDL to be used to create the databases.

Database Alter When PF3 (End) is pressed from the Database Alter screen, the Alteration Analysis screen appears with the message that RC/Alter is required to make your requested changes. Enter the information about the data set to which the DDL is written. The DDL must then be executed in batch mode. Note: For more information about RC/Alter, see the CA RC/Update User Guide.

Chapter 18: Database 505

Create a Database for Declared Temporary Tables

The Database Alter screen lets you make changes to the values that were used to create the database. It is similar to the Database Create and Database Template screens. Change any fields as necessary, according to the procedures outlined in Database Create. Once changes have been made, press PF3 (End) to process the alter.

Create a Database for Declared Temporary Tables To specify that a database is for declared temporary tables, set the Database Alter panel's AS option to TEMP. You can create only one temporary database for each DB2 subsystem or data sharing member. A temporary database cannot be shared between DB2 subsystems or data sharing members. A temporary database must have its CCSID option set to blanks. Specifying the AS option to TEMP causes the AS TEMP clause to be inserted into the generated DDL.

Drop Considerations The Drop Database screen permits database drops. Use extreme caution in dropping databases because dropping a database deletes all objects in the database. See the CA RC/Update User Guide for more information about various drop options (S, SO, R, RO).

DDL Execution When PF3 (End) is pressed from the Create, Alter, Template or Drop screen, a confirmation screen appears before the DDL is executed, where you can accept, edit, or reject the DDL to be used to complete the request. Note: If your changes are complex, require dropping and recreating objects (and their dependencies), or the current RC/Update Operation Mode is set to A (RC/Alter), you can perform a complete analysis of your changes that includes rebuilding the DDL and optionally including utility statements and extended DDL generation and analysis options.

506 User Guide

Chapter 19: Tablespace This section contains the following topics: Product Features for Maintaining DB2 Tablespaces (see page 507) Accessing Tablespace Functions (see page 508) Define a VSAM Cluster (see page 509) Selection Screens (see page 510) Tablespace Create (see page 514) Tablespace Template (see page 527) Tablespace Alter (see page 528) Calculate Space Requirements for Tablespaces (see page 536) Locate Free Space (see page 539) VSAM Cluster Definitions (see page 541) LOB Tablespaces (see page 543) Tablespace Drop Considerations (see page 544)

Product Features for Maintaining DB2 Tablespaces The tablespace option lets you create, (new or template), alter, and drop tablespaces. A tablespace is a DB2 object consisting of VSAM ESDS data sets containing one or more DB2 tables. We provide the following sophisticated features for creating and maintaining DB2 tablespaces: ■

Selection help for database, VCAT, and storage group When defining a tablespace, you must specify the database in which the tablespace will reside, as well as a VCAT name or storage group for partitioned databases. Using selection lists, you can enter selection criteria to receive a list of objects from which you can select the database, VCAT, and storage group.



Space Calculation Screen A sophisticated space calculation facility is available to assist you in calculating space allocations for the tablespace. If the tablespace is partitioned, space calculations can be made on each partition. And you can perform space calculations for LOBs. When you have completed your space calculations, the information is passed back to the tablespace screen.



Space Locator The Space Locator facility helps you locate a volume or storage group with adequate free space for your tablespaces.

Chapter 19: Tablespace 507

Accessing Tablespace Functions



VSAM Define Screen If you specify VSAM data sets instead of specifying a storage group, you must specify the data set name and type and supply any required passwords. The VSAM Define screen will assist you in defining your VSAM data sets.



RC/Alter Support DB2 lets you make only certain changes to tablespaces. If the changes you want to make are not supported by DB2, we invoke RC/Alter support to drop and re-create the tablespace. All dependents, data, and authorizations are automatically restored and all changes are automatically propagated to any dependent object types. This extremely powerful feature is transparent to the end user. The user makes the request for the change, and the changes are made using the appropriate methods.

Accessing Tablespace Functions You can access tablespace functions from within each of the following strategy types: ■

Alteration strategy (see page 508)



Migration strategy (see page 508)



Compare strategy (see page 509)

Alteration Strategy To create, alter, template, or drop a tablespace through an alteration strategy, enter C, A, T, or D in the Option field and TS in the Object field of the RC/M Alteration Strategy Services panel. The appropriate Tablespace screen appears.

Migration Strategy To create a tablespace through a migration strategy, enter U in the New Objects field of the RC/M Implode/Explode Services. The RC/M Object Creation Services screen appears. Enter an S under Tablespace and press Enter. To alter a tablespace through a migration strategy, enter E in the Selection field next to the name of a tablespace which is included in your strategy on the RC/M Implode/Explode screen or the Dependent Object Selection screen. You can only alter primary and dependent objects in a migration strategy.

508 User Guide

Define a VSAM Cluster

To template a tablespace through a migration strategy, enter T in the Selection field next to the name of the tablespace to be templated on the Dependent Object Selection screen. You can only template dependent objects in a migration strategy. You cannot drop objects in a migration strategy. The appropriate Tablespace screen appears.

Compare Strategy To create or drop a tablespace through a compare strategy, enter U in the Create/Drop Objects field of the RC/M Compare Explode Services screen. The RC/M Create/Drop Object Selection screen appears. To create a tablespace, enter C in the Option field and DB in the Object field. The RC/Migrator Tablespace Create screen appears. To drop a tablespace, enter D in the Option field and TS in the Object field. A selection screen appears. Select the object to be dropped. To alter a tablespace through a compare strategy, enter E next to the name of a tablespace that is included in your strategy on the RC/M Compare Explode Services screen or the RC/M Dependent Object Mapping screen. The Tablespace Alter screen appears. Note: You cannot template objects in compare strategies.

Define a VSAM Cluster If storage groups will not be used, the rules of DB2 state that the VSAM data sets must already exist prior to creating the indexspace. However, you can also create VSAM data sets during the indexspace create session using the VSAM Define screen. Important! You should specify your space allocations on the Index Space Calculation screen before defining the VSAM data sets because the space statistics are provided as input to the VSAM Define screen. See Space Calculator for more information. If the Volume Space Locator was used, any VOLSER selections made are used to define the VSAM cluster. To define a VSAM cluster 1.

From the partition information fields on the Index Create screen, enter V in the Cmd column next to the partition or index for which you want to define a VSAM cluster.

2.

Note: To select from a list of existing VCATs, enter an asterisk (*) for Cmd.

Chapter 19: Tablespace 509

Selection Screens

3.

Press Enter. The VSAM Define screen appears.

4.

Specify the name of the database that contains the base table in the In Database field. This name is needed to generate the correct VSAM data set name. Note: If the table definition exists in the system catalog, the name is automatically provided in this field. Otherwise, the default is DSNDB04.

5.

Enter data in the Name and Type field to specify generated VSAM cluster information.

6.

Enter data in the space allocation fields. Values must be specified for the following: ■

Unit—Identifies the unit type (R-records, T-tracks, C-cylinders).



Primary and Secondary—Specifies the VSAM space allocation amount retrieved from the data set in use. You can specify new values in terms of the unit selected, not bytes.



Volumes—Specifies the volume names (up to six). If specified, do not specify values in the Storageclass, Managementclass, and Dataclass field. Likewise, if one of these fields is specified, do not specify volume information.

7.

To use the VSAM catalog, you must specify a VSAM password in the Password field.

8.

Specify additional options as follows:

9.



To have binary zeros written when the data set is erased, specify Y for Erase.



To use VSAM SHAREOPTIONS (1,3), specify Y for Roshare. For databases defined as shared, read-only, you must specify Y.

After all necessary information has been entered, press PF3 (End) to process the information and return to the Index Create, Template, or Alter screen.

Selection Screens When you alter, drop, or create by template a tablespace, a selection screen is presented for selecting the tablespaces if you have not specified a particular tablespace. You can make the tablespace selection list more specific by specifying selection criteria for the Item (tablespace) Name and Creator ID prompts in the header.

510 User Guide

Selection Screens

You can also use the EQF facility to further specify the tablespaces displayed. For example, if you want to view the tablespaces created by a specific set of users, create a default EQF that selects the tablespaces created by those users. Every time you access the tablespace selection screen, your default EQF is automatically be applied and you only see a listing of the tablespaces created by the desired user group. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about EQF.

Selection Criterion The Item Name and Creator fields let you specify a specific tablespace name or to enter search conditions for retrieving multiple objects. These fields accept the following SQL search criteria (for more information, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide): * The asterisk selects all objects. % The percent sign is a wildcard that matches zero or more characters. _ The underscore indicates that any one character can occupy that position. If you enter an asterisk for these fields, all tablespaces in the system are displayed.

Screen Layout The Tablespace selection screen displays most of the fields available in the SYSIBM.SYSTABLESPACES table. This information displays to make selection of the tablespaces easier. All selection screens support the standard scrolling commands. For example, you can freeze columns, exclude columns, sort on columns, and perform both horizontal and vertical scrolling. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about the scrolling commands. The horizontal scrolling of fields is controlled by the SCROLL MODE. If the SCROLL MODE is COLUMN, then a column does not appear on the screen until it can be completely displayed (a column will not be split between screens).

Chapter 19: Tablespace 511

Selection Screens

The following fields are displayed in the tablespace selection screen. Sel Enter one of the following options: ■

S—Select the object you want to process and press Enter. The appropriate screen for that object appears.



?—Access CA RC/Query and display the RC/Query menu for that object type. See the CA RC/Query User Guide for lists of report options per object type. You must have a license for CA RC/Query to use this option.

TSNAME The tablespace name. CREATOR ID of the tablespace creator. DATABASE Name of the database in which the tablespace resides. PARTS Number of partitions in the tablespace. NTABLES Number of tables in the tablespace. ACTIVE PAGES Number of pages currently active. DBID ID assigned by DB2 to the database in which the tablespace resides. OBID Internal DB2 object ID assigned by DB2 to the tablespace file descriptor. The following fields can be displayed by scrolling right using PF11: PSID Internal DB2 object ID assigned by DB2 to the tablespace. BUFFPOOL The buffer pool associated with the tablespace. LOCKRULE The locking level for the tablespace. PAGESIZE Page size (4k or 32k) for the tablespace.

512 User Guide

Selection Screens

ERASERULE This field indicates whether the DB2-defined data sets should be erased if the tablespace is dropped. IMPLICIT This field identifies whether the tablespace was created implicitly (during table creation). CLOSERULE The close data set rule for the tablespace. SPACE The number displayed in this field is the number of kilobytes of DASD storage allocated to the tablespace, as of the last time the STOSPACE utility was run.

Selecting Tablespaces To select a tablespace, enter S next to each one you want to select, then press Enter. You can select more than one tablespace at a time by entering S for every tablespace you want to select. For templates or alters, each tablespace you select is processed individually, beginning with the first tablespace listed, and continuing in the order of the selection list. For standard drops, all tablespaces are dropped together. Recoverable drops are processed one at a time.

Chapter 19: Tablespace 513

Tablespace Create

Part 1 of the diagram shows that all standard drops are processed together in a single batch of DDL. You accept or reject the batch of drops. Part 2 shows that in templates or alters, each template or alter is processed individually. After confirming the DDL used to template or alter the tablespace, the user is returned to the Template or Alter screen for the tablespace next on the selection list. This continues until all selected objects have been processed. Part 2 also shows that recoverable drops are processed individually. Note: For information about screen flow for standard and recoverable drops, see the CA RC/Update User Guide.

Tablespace Create CA RC/Migrator provides all the functions of the DB2 CREATE TABLESPACE command. This statement allocates and formats a tablespace in which you can later create one or more tables. A list of databases and storage groups will be displayed if you are not sure of the names of the objects you want to use. It will also help you calculate the primary and secondary space quantities using the Space Calculation screen, and locate volumes or storage groups with adequate space through the Space Locator. You can also define the VSAM data sets you want to use through an easy to use VSAM Define screen. After you have given all the Create information to CA RC/Migrator, you receive a Confirmation Screen. This screen displays the actual DDL that is used to create the tablespace. You can accept, edit, or reject the Creation at this point.

Creating Simple Tablespaces A simple tablespace is a tablespace that is not segmented or partitioned. A simple tablespace can contain many tables. Simple tablespaces are not used very often because there are many drawbacks such as: ■

You cannot lock only one table; the whole tablespace must be locked at once.



You must scan the whole tablespace to scan one table.



You cannot reuse the space of a dropped table immediately.

One advantage to a simple tablespace is that you can control the order of the rows stored in a table.

514 User Guide

Tablespace Create

Create a Simple Tablespace You can create a simple DB2 tablespace as described in this section. To create a simple tablespace 1.

Go to the Tablespace Create screen. See Accessing Tablespace Functions if you are unsure how to get to this screen.

2.

Enter data in the following fields to define some basic information: ■

Table Space



Creator

Other fields contain default specifications. Note: You can set defaults through the DEF command for all these fields except Table Space and Partitioned. See the “Object Definition Defaults” chapter for more information. 3.

Enter storage related information about the tablespace in the Partition Information fields. Because this is a simple tablespace, you will only enter information on the first line, which represents the whole tablespace. You must enter a VCAT or storage group if you do not want to accept the storage group default (SYSDEFLT). The rest of the information is optional. These fields are described in Partition Information Fields. Because the tablespace is not partitioned, the only valid line commands are V (VSAM Define), S (Space Calculation), and U (Undo any changes, set back to old definition). Note: You can set defaults through the DEF command for all these fields except Erase. See the “Object Definition Defaults” chapter for more information.

4.

Press PF3 (End) to process the creation.

Creating Segmented Tablespaces A segmented tablespace is a non-partitioned tablespace that has been segmented. A segmented tablespace can contain more than one table, but each segment contains rows from only one table. Every segment in a segmented tablespace is the same size. A table uses only as many segments as it needs. Segmented tablespaces provide these advantages over simple tablespaces: ■

To scan a table, you only need to scan the segments containing data from that table.



You can lock only one table in the tablespace.



You can re-use the space of a dropped table immediately.

Chapter 19: Tablespace 515

Tablespace Create

One drawback to a segmented tablespace is that some DB2 utilities, such as COPY, REORG or LOAD REPLACE, operate on a tablespace or partition basis only. Note: These steps are the same as the steps used to create a simple tablespace, except you must also specify the segment size.

Create a Segmented Tablespace You can create a segmented DB2 tablespace as described in this section. To create a segmented tablespace 1.

Go to the Tablespace Create screen. See Accessing Tablespace Functions if you are unsure how to get to this screen.

2.

Enter data in the following fields to define some basic information: ■

Table Space



Creator

Other fields contain default specifications. Note: You can set defaults through the DEF command for all these fields except Table Space and Partitioned. See the “Object Definition Defaults” chapter for more information. 3.

Enter storage related information about the tablespace in the Partition Information fields. Because this is a segmented tablespace, you will only enter information on the first line. You must enter a VCAT or storage group if you do not want to accept the storage group default (SYSDEFLT). These fields are described in Partition Information Fields. Because the tablespace is not partitioned, the only valid line commands are V (VSAM Define), S (Space Calculation), and U (Undo any changes, set back to old definition). Note: You can set defaults through the DEF command for all these fields except Erase. See the “Object Definition Defaults” chapter for more information.

4.

516 User Guide

Press PF3 (End) to process the creation.

Tablespace Create

Creating Partitioned Tablespaces A partitioned tablespace is a tablespace that is partitioned to better manage data access. It can contain only one table. We recommend that tables with over 10 million rows be stored in partitioned tablespaces. Some advantages of partitioned tablespaces include: ■

The ability to spread a large table over several storage groups or data sets.



The ability to run utilities on only part of the tablespace.

The primary strength to a partitioned tablespace is also its drawback: A partitioned tablespace can contain only one table. If you are having trouble avoiding the maximum number of concurrently opened data sets, you might want to use segmented tablespaces that contain multiple tables.

Create a Partitioned Tablespace You can create a partitioned DB2 tablespace as described in this section. To create a partitioned tablespace 1.

Enter data in the following fields on the Tablespace Create screen to define basic information: ■

Table Space



Creator

Other fields contain default specifications. Note: You can set defaults through the DEF command for all these fields except Table Space and Partitioned. For more information, see the “Object Definition Defaults” chapter. Your settings are applied to the tablespace. 2.

Specify values in the Partition Information fields to define storage-related information about the tablespace, then press the END key to process the creation. Note: You can use standard ISPF line commands to create and manipulate partitions. You must enter a VCAT or storage group if you do not want to accept the storage group default (SYSDEFLT). You can set defaults through the DEF command for all of these fields except Erase. For more information, see the “Object Definition Defaults” chapter. Your tablespace is defined.

More information: Accessing Tablespace Functions (see page 508) Partition Information Fields (see page 524)

Chapter 19: Tablespace 517

Tablespace Create

Create a Range-Partitioned Tablespace In addition to being partitioned, a range-partitioned tablespace is also segmented. Note: A range-partitioned tablespace can contain only one table, which must be a table-controlled partitioned table. You can create a range-partitioned DB2 tablespace as described in this section. To create a range-partitioned tablespace 1.

Complete fields as follows on the Tablespace Alter screen: ■

Specify a name in the Table Space field.



Specify a creator in the Creator field.



Type RANGE in the TS Type field.



Specify a non-zero value in the Segment Size field. Note: Because a value exists that defines a segment size, you cannot specify YES for Mbr Cluster (which would indicate that inserted data should not be clustered by a clustering index).

Note: You can use the DEF command to set defaults for all fields except Table Space, Partitioned, and Erase. For more information, see the “Object Definition Defaults” chapter. Press Enter. Your settings are applied to the tablespace. If a value was not specified for Lockmax, a message appears indicating that a default value was created. 2.

Specify values in the Partition Information fields to define storage-related information about the tablespace, then press the END key to process the creation. Note: You can use standard ISPF line commands to create and manipulate partitions. You must enter a VCAT or storage group if you do not want to accept the storage group default (SYSDEFLT). You can set defaults through the DEF command for all of these fields except Erase. For more information, see the “Object Definition Defaults” chapter. Your tablespace is defined.

More information: Accessing Tablespace Functions (see page 508) Partition Information Fields (see page 524)

518 User Guide

Tablespace Create

Tablespace Create Screen The Tablespace Create screen provides an easy way to supply the necessary information. The fields below the header control the information on the Tablespace Create screen: Tablespace Enter the name of the tablespace. For DB2 V6.0 and above, LOB tablespaces are supported. Creator The creator of the tablespace. Close Dataset Indicate whether to close the data sets supporting the tablespace when there are no current tablespace users. Enter YES or NO. The default is YES. Database Enter the name of the database into which you want to place the tablespace. You must use a valid database name or you receive an SQL error. You can enter selection criteria to get a list of valid databases. Buffer Pool Name the buffer pool to be associated with the tablespace. You must use a valid buffer pool name or you receive an SQL error. The default is BP0. The following table lists valid entries for Buffer Pool:

Size (kbs)

Buffer Pool Names

4 KB

BP0 through BP49

8 KB

BP8K0 through BP8K9

16 KB

BP16K0 through BP16K9

32 KB

BP32K through BP32K9

Partitioned Indicate whether the tablespace is partitioned. Enter YES or NO. The default value is YES. You must enter YES in this field before you can define partitions. Lock Size Determine the locking level for the tablespace. Valid values are as follows: ■

ANY—Lets DB2 determine the locking level. This is the default.



PAGE—Sets locks at the page level.



TABLESPACE—Sets locks at the tablespace level.

Chapter 19: Tablespace 519

Tablespace Create



TABLE—Sets locks at the table level. Note: The TABLE setting should be used with a segmented tablespace only. However, the setting cannot be specified for a universal tablespace.



ROW—Sets locks at the row level. Indexes for tables in the tablespace must be type 2.



LOB—Sets locks at the LOB level. This value can only be used for a LOB tablespace.

Note: Do not use ROW or PAGE for a LOB tablespace. Segment Size Enter the segment size for a universal tablespace or a non-partitioned tablespace. If the tablespace is not partitioned, you can choose to segment it. The segment size is measured in pages. Enter the number of pages you want assigned to each segment. This feature is useful in combating table locking problems. Valid entries are multiples of 4 from 4 to 64. TS Type Indicates the type of tablespace. Valid values are as follows: ■

RANGE—Specifies to create a range-partitioned universal tablespace, which is a partitioned tablespace that is also segmented.



REGULAR—Specifies that a regular tablespace is to be created. A regular tablespace is one that is neither explicitly LARGE nor LOB. This value can be specified for partitioned and non-partitioned tablespaces. This is the default if not overridden by object definition defaults. See the “Object Definition Defaults” chapter for more information about object defaults.



LARGE—Specifies that a partitioned tablespace has more than 64 partitions. This causes the LARGE clause to be added to the generated DDL.



LOB—Specifies that a partitioned tablespace is being created to contain an auxiliary table for storing LOB data. See Auxiliary Tables in the “Table” chapter for more information about auxiliary tables. When specified, the CREATE LOB TABLESPACE statement is generated and inserted in your DDL. Valid for DB2 V6 and above only. For more information about LOB tablespaces, see LOB Tablespaces.

520 User Guide

Tablespace Create

Lockmax Specify the maximum number of page or row locks that an application can hold in this tablespace before locks are escalated from the level indicated in the Locksize field (described below). Valid values are as follows: ■

0—The number of locks allowed is unlimited. As a result, there is no escalation.



SYSTEM—Uses your system default value. This is the default.



1 to 2147483647—The number of locks allowed before escalation.

GBP Cache Specify what pages of the tablespace or partition are written to the group buffer pool in a data sharing environment. In a non-data sharing environment, you can specify this value, but it is ignored. Valid values are as follows: ■

CHANGED—Cache only changed pages in the group buffer pool. This is the default.



ALL—Cache all pages in the group buffer pool as they are read in from DASD. However, in the case of a single updating DB2 when no other DB2s have any interest in the page set, no pages are cached in the group buffer pool.



SYSTEM—Cache only system pages within the LOB tablespace to the group buffer pool. A system page is a space map page or any other page that does not contain actual data values. This is the default for LOB tablespaces; and you can only use this option for a LOB tablespace.



NONE—Do not cache any pages to the group buffer pool. DB2 uses the group buffer pool only for cross-invalidation. This value applies to DB2 V6 and above only. For partitioned tablespaces, the entry overrides the partition-level setting specified with the G prefix command. In other words, you can set the GBP cache for all the partitions at once by changing the value in this field, provided you want them all set to the same value.

CCSID (Coded Character Set Identifier) Specify the encoding scheme for tables stored in this tablespace. Valid values are as follows: ■

Ascii—Specifies that the data must be encoded using the ASCII CCSIDs specified during installation.



Ebcdic—Specifies that the data must be encoded using the EBCDIC CCSIDs specified during installation.

Chapter 19: Tablespace 521

Tablespace Create



Default—Specifies that the CCSID argument is omitted from the generated DDL. See the IBM DB2 SQL Reference and Administrator guides for more information about default encoding schemes. When creating a tablespace, the default encoding scheme of the database in which the tablespace resides is used. However, if the tablespace resides in the DSNDB04 database, the CCSID defaults to the value of the Def Encoding Scheme field on the DB2 installation panel (DSNTIPF). When altering a tablespace, the encoding scheme of the tablespace is changed to the current default encoding scheme; if it is different than the encoding scheme currently used by the tablespace.



Unicode—Specifies that the data must be encoded using the Unicode CCSIDs specified during installation.



blanks—Specifies that the tablespace does not have an encoding scheme. This field is always set to blanks if your DB2 version does not support this option.

Note: All data stored within a tablespace must use the same encoding scheme. Log Specifies whether changes to a LOB column in the tablespace are to be written to the log. Valid for DB2 V6.0 or higher. Valid values are as follows: ■

YES—Changes to a LOB column are to be written to the log. This is the default. Note: You cannot use YES if the auxiliary table in the tablespace stores a LOB column that is greater than 1 G in length.



NO—Changes to a LOB column are not to be written to the log. This option has no effect on a commit or rollback operation; the consistency of the database is maintained regardless of whether the LOB value is logged.

Rows/Page Specify the maximum number of rows that DB2 will place on a data page. Valid values are 1 to 255. The default is 255. This option adds the MAXROWS(integer) argument to the generated DDL. When altering a tablespace, the change takes effect immediately for new rows added. Note: You cannot specify this value for a tablespace in a work file database. Additionally, you cannot alter this value for catalog or directory tablespaces.

522 User Guide

Tablespace Create

DSSIZE (G) A value in gigabytes that indicates the maximum size for each partition, or for LOB tablespaces, each data set. Valid for DB2 V6.0 or higher. Valid values in GB are: 1, 2, 4, 8, 16, 32, and 64. For values over 4 GB, special SMS requirements are in effect. Lockpart Indicate whether selective partition locking is to be used when locking a partitioned tablespace. Valid values are as follows: ■

Y—If you specify Yes and all conditions required for selective partition locking are met, only the partitions accessed are locked. If you specify Yes and all conditions required for partition locking are not met, every partition of the tablespace is locked. Selective partition locking is not supported when the value in the Lock Size field is TABLESPACE.



N—(Default) Selective partition locking is not used. The tablespace is locked with a single lock on the last partition, which has the effect of locking all partitions on the tablespace. Note: This option is valid for partitioned tablespaces only.

Mbr Cluster Specifies that data inserted by the INSERT statement is not clustered by the implicit clustering index (the first index) or the explicit clustering index. Instead DB2 chooses where to locate the data in the tablespace based on available space. Valid for DB2 V6.0 or higher. Note: Do not use Mbr Cluster for a LOB tablespace, a universal tablespace, or a tablespace in a work file database.

Chapter 19: Tablespace 523

Tablespace Create

DEFINE Specifies whether to defer the physical allocation of DB2-managed data sets. This can be useful when performance is important, or when a DASD resource is constrained. Valid values are as follows: ■

YES—Builds the DEFINE YES clause and inserts it into the DDL. This is the default. The tablespace is defined, and the associated data sets are immediately allocated.



NO—Builds the DEFINE NO clause and inserts it into the DDL. When specified, the tablespace is defined, but DB2 does not allocate the associated data sets until a row is inserted into a table in the specified tablespace. The DB2 catalog table SYSIBM.SYSTABLEPART contains records of the created tablespace and an indication that the data sets are not yet allocated.

Note: You cannot specify DEFINE NO for LOB tablespaces, for tablespaces in a work file database or a temp database, or for user-managed data sets (which are defined with the USING VCAT clause).

Partition Information Fields The Partition Information Fields lets you enter storage related information about each partition in the tablespace or the whole tablespace (nonpartitioned). Note: If you enter partition information, then change the tablespace to nonpartitioned, all lines except the first are deleted. If you change the tablespace back to a partitioned tablespace, the old partition values are returned. See Tablespace Alter for more information about changing from one type of tablespace to another. The following describes the partition information fields. CMD Use standard ISPF line commands such as Insert, Move, Copy, and Delete to manipulate the partitions. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information. Enter the line commands in the CMD area preceding the partition number. As you insert or delete partitions, the partition numbers automatically change.

524 User Guide

Tablespace Create

You can also enter the following commands: ■

LC—IDCAMS LISTCAT Report



V—VSAM Define



S—Space Calculation



U—Undo any changes, set back to old definition



G—Group Bufferpool Cache Setting command (these are discussed in Group Bufferpool Cache Setting Popup Screen)

Note: If the tablespace is not partitioned, you cannot specify the LC or G commands. PART The partition you are presently processing. If the tablespace is non-partitioned, this field will not be displayed. VCAT Select the VSAM Catalog for the tablespace or tablespace partition. You can enter an asterisk or pattern to view a VCAT selection list. The rules of DB2 state that the VSAM data sets must already exist prior to creating the tablespace; you are responsible for creating the VSAM data sets if you are not going to use storage groups. However, we let you create the VSAM data sets during the tablespace create session. Use the V (VSAM Define) command to access the VSAM Define screen. (The VSAM define function is described in VSAM Cluster Definitions.) Important! If you are going to use storage groups, you do not have to enter a VSAM Catalog. STOGROUP Use the Storage Group field as an alternative to the VSAM Catalog field. The field lets DB2 define the data sets for the tablespace by using space from a named storage group. The default name is SYSDEFLT. You can enter selection criteria to view a storage group selection list. Note: Space Locator can help you select storage groups with enough space. PRIQTY When creating or altering a tablespace, you can use the PRIQTY field to specify the tablespace's minimum primary space allocation for a DB2managed data set. The PRIQTY field has a valid range of 12 to 4194304 kilobytes, or you can specify the keyword DEFAULT. Note: If you specify a user-managed data set by supplying a value in the VCAT field, PRIQTY is set to 0 and cannot be overridden. When creating a tablespace or a tablespace template, entering the keyword DEFAULT in the Tablespace screen's PRIQTY field causes the PRIQTY clause to be omitted on a CREATE TABLESPACE statement.

Chapter 19: Tablespace 525

Tablespace Create

When altering an existing tablespace, entering the keyword DEFAULT in the Tablespace Alter screen's PRIQTY field causes the PRIQTY -1 clause to be inserted on an ALTER TABLESPACE statement. Note: For DB2 versions prior to V8, the clause PRIQTY 12 is inserted on an ALTER TABLESPACE statement if DEFAULT is entered in the PRIQTY field. SECQTY When creating or altering a tablespace, you can use the SECQTY field to specify the tablespace's minimum secondary space allocation. The SECQTY field has a valid range of 0 to 4194304 kilobytes, or you can specify the keyword DEFAULT. Note: If you specify a user-managed data set by supplying a value in the VCAT field, SECQTY is set to 0 and cannot be overridden. When creating a tablespace or a tablespace template, entering the keyword DEFAULT in the Tablespace Create screen's SECQTY field causes the SECQTY clause to be omitted on a CREATE TABLESPACE statement. When altering an existing tablespace, entering the keyword DEFAULT in the Tablespace Alter screen's SECQTY field causes the SECQTY -1 clause to be inserted on an ALTER TABLESPACE statement. Note: For DB2 versions prior to V8, the clause SECQTY 12 is inserted on an ALTER TABLESPACE statement if DEFAULT is entered in the SECQTY field. ERASE Specify whether the DB2-defined data sets should be erased if the tablespace is dropped. You can enter YES or NO. NO is the default. The Erase Option does not apply to partitioned tablespaces and is ignored. FRPAGE The Free Page field determines after how many pages DB2 should leave a page of free space when the table is loaded or reorganized. The default is 0. %FR The Percent Free field tells what percentage of each page is left as free space when the table is loaded or reorganized. The default is 5. COMP Specify whether to use ESA compression on the data rows for this tablespace or this partition of the tablespace. Options are: ■

YES—Build the compression dictionary and compress the data rows the next time the data is loaded or reorganized.



NO—(Default) Do not compress the data rows.

TRKMOD Whether to track the page modifications in the space map pages.

526 User Guide

Tablespace Template

Group Bufferpool Cache Setting Pop-up Screen The Group Bufferpool Cache Setting pop-up screen appears when you issue the G line command next to a tablespace partition on the Tablespace Create, Alter, or Template screen. From this screen, you can specify what pages of the tablespace or partition are written to the group buffer pool in a data sharing environment. In a non-data sharing environment, you can specify this information, but it is ignored. Enter one of the following values in the GBP Cache for partition field: ■

A—All. Indicates that pages are to be cached in the group buffer pool as they are read in from DASD. However, in the case of a single updating DB2 when no other DB2s have any interest in the page set, no pages are cached in the group buffer pool.



C—Changed (Default). When there is an inter-DB2 R/W interest on the tablespace or partition, updated pages are written to the group buffer pool. When there is no inter-DB2 R/W interest, the group buffer pool is not used. Inter-DB2 R/W interest exists when more than one member in the data sharing group has the tablespace or partition open, and at least one member has it open for update.



N—None. Indicates that no pages are to be cached to the group buffer pool. DB2 uses the group buffer pool only for cross-invalidation.



S—System. Indicates that only changed system pages within the LOB tablespace are to be cached to the group buffer pool. A system page is a space map page or any other page that does not contain actual data values. This is the default for LOB tablespaces; and you can only use this option for a LOB tablespace.

Processing Considerations When you create a tablespace, you must use a valid storage group and database. Remember that DB2 lets you define a storage group and database using invalid values. If you try to create a tablespace that references invalid storage groups or databases, you will receive an SQL error.

Tablespace Template The template option lets you create a new tablespace using an existing tablespace as a template. In fact, a template session is actually a create session with an additional step: you can select a tablespace as a starting point. The other fields can be changed, but you must change the name of the templated tablespace. The tablespace's dependent objects are not included in the template operation.

Chapter 19: Tablespace 527

Tablespace Alter

Tablespace Template Screen The Tablespace Template screen displays the values that were used to create the template tablespace. Notice that the fields for this screen are similar to those on the Tablespace Create screen. Change the fields for the new tablespace according to the procedures outlined in Tablespace Create. Edit the information as you would enter it in a Tablespace Create screen. Once you have made the changes you want, press PF3 (End) to process the template.

LC Line Command The LC line command lets you browse the LISTC Report and view space amounts for user-defined data sets. You can use this command from the Tablespace Alter or Tablespace Template screen to access a report of a particular data set. Enter LC at the CMD field of the data set for which you would like a report and the IDCAMS System Services LISTC Report appears. For more information about the specifics of this report, see the IBM IDCAMS documentation.

Confirming the Template A confirmation screen appears, which lets you accept, edit, or reject the DDL that is used to create the tablespace.

Tablespace Alter The DB2 ALTER TABLESPACE command is fully supported. The following information can be altered in DB2:

528 User Guide



BUFFER POOL



LOCKSIZE



CLOSE DATA SET



FREE PAGE



PERCENT FREE



USING (DATA SET)



ERASE RULE

Tablespace Alter



COMPRESS



GBPCACHE



LOCKPART



MAXROWS



TRACKMOD



LOG



CCSID

Note: The Primary (PQTY) and Secondary (SQTY) Quantity alterations are done through RC/Alter even though a DB2 ALTER could partially do them. If you attempt to change these quantities with a DB2 ALTER statement, the change will not be complete in any usable way until a REORG or DROP/CREATE is performed. For this reason, we do not include PQTY or SQTY in the previous list. If CA RC/Migrator cannot make the changes you request using a DB2 ALTER TABLESPACE statement, it uses RC/Alter. It uses RC/Alter if you change the following: ■

Tablespace name



Database



Partition Information



Segment Information

These changes are made by dropping and re-creating the tablespace. All dependents, data, and authorizations are automatically restored and all changes are automatically propagated to any dependent object types. The Tablespace Alter screen also lets you change multiple partitions on one screen without having to issue separate ALTER TABLESPACE statements. In DB2, if you want to change the Free Page or Percent Free for partitions, you must issue a separate ALTER TABLESPACE command for each partition.

Change Tablespace Type from Simple to Segmented You can change the tablespace type from simple to segmented by changing the value of the Segment Size field on the Tablespace Alter screen. To change tablespace type from simple to segmented, change the Segment Size field from 0 to segment size. More information: Accessing Tablespace Functions (see page 508)

Chapter 19: Tablespace 529

Tablespace Alter

Change Tablespace Type from Simple to Partitioned You can change the tablespace type from simple to partitioned as described in this section. Note: After performing the conversion, you need to alter the index on the table that exists in the tablespace. If the table in the tablespace does not have an index, you need to create the index. For more information about creating the index, see the “Index” chapter. To change tablespace type from simple to partitioned 1.

Enter YES in the Partitioned field on the Tablespace Alter screen. Your settings are applied to the tablespace. A PART field appears in the Partition Information portion of the screen.

2.

(Optional) Perform the following steps as many times as needed to produce additional partitions: a.

Enter R in the CMD line next to a partition to repeat the partition.

b.

Change the PRIQTY, SECQTY, Freepage, and PCTfree fields for the partition, if necessary, then press Enter.

The partition is added according to your specifications. More information: Accessing Tablespace Functions (see page 508) Alter the Index for a Table in a Partitioned Tablespace (see page 533) Partition Information Fields (see page 524)

Change Tablespace Type from Simple to Range-Partitioned You can change the tablespace type from simple to range-partitioned as described in this section. To change tablespace type from simple to range-partitioned 1.

Complete fields on the Tablespace Alter screen as follows: a.

Change the value in the Partitioned field from NO to YES.

b.

Change the value in the TS Type field to RANGE.

c.

Specify a non-zero value in the Segment Size field.

Press Enter. Your settings are applied to the tablespace. A PART field appears in the Partition Information portion of the screen.

530 User Guide

Tablespace Alter

2.

(Optional) Perform the following steps as many times as needed to produce additional partitions: a.

Enter R in the CMD line next to a partition to repeat the partition.

b.

Change the PRIQTY, SECQTY, Freepage, and PCTfree fields for the partition, if necessary, then press Enter. The partition is added according to your specifications.

More information: Accessing Tablespace Functions (see page 508) Convert a Non-Partitioned Table to a TCP Table (see page 534) Partition Information Fields (see page 524)

Change Tablespace Type from Partitioned to Range-Partitioned To change the tablespace type from partitioned to range-partitioned, complete fields as follows on the Tablespace Alter screen: ■

Change the value in the TS Type field to RANGE.



Specify a non-zero value in the Segment Size field.

Press Enter. Your settings are applied to the tablespace. Note: If an index-controlled partitioned table exists in the tablespace, the table is automatically converted to table-controlled partitioning. More information: Accessing Tablespace Functions (see page 508)

Chapter 19: Tablespace 531

Tablespace Alter

Change Tablespace Type from Segmented to Partitioned You can change the tablespace type from segmented to partitioned as described in this section. Note: After performing the conversion, you need to alter the index on the table that exists in the tablespace. If the table in the tablespace does not have an index, you need to create the index. For more information about creating the index, see the “Index” chapter. To change tablespace type from segmented to partitioned 1.

Complete fields on the Tablespace Alter screen as follows: a.

Change the value in the Partitioned field from NO to YES.

b.

Change the value in the Segment Size field to 0.

Press Enter. Your settings are applied to the tablespace. 2.

(Optional) Perform the following steps as many times as needed to produce additional partitions: a.

Enter R in the CMD line next to a partition to repeat the partition.

b.

Change the PRIQTY, SECQTY, Freepage, and PCTfree fields for the partition, if necessary, then press Enter.

The partition is added according to your specifications. More information: Accessing Tablespace Functions (see page 508) Alter the Index for a Table in a Partitioned Tablespace (see page 533) Partition Information Fields (see page 524)

532 User Guide

Tablespace Alter

Change Tablespace Type from Segmented to Range-Partitioned You can change the tablespace type from segmented to range-partitioned as described in this section. To change tablespace type from segmented to range-partitioned 1.

Complete fields as follows on the Tablespace Alter screen: a.

Change the value in the Partitioned field from NO to YES.

b.

Change the value in the TS Type field to RANGE.

Press Enter. Your settings are applied to the tablespace. 2.

(Optional) Perform the following steps as many times as needed to produce additional partitions: a.

Enter R in the CMD line next to a partition to repeat the partition.

b.

Change the PRIQTY, SECQTY, Freepage, and PCTfree fields for the partition, if necessary, then press Enter.

The partition is added according to your specifications. More information: Accessing Tablespace Functions (see page 508) Convert a Non-Partitioned Table to a TCP Table (see page 534) Partition Information Fields (see page 524)

Alter the Index for a Table in a Partitioned Tablespace When you perform any of the following conversions, you also need to alter the index on the table that exists in the tablespace: ■

Changing the tablespace from simple to partitioned



Changing the tablespace from segmented to partitioned

Note: If the table in the tablespace does not have an index, you must create the index. For more information, see the “Index” chapter. For more information about configuring key columns and limit keys, see the "Table" chapter. To alter the index for a table in a partitioned tablespace 1.

Enter YES in the Partitioned field on the Table Alter screen. The Table Partitioning Key Col Selection & Maint screen appears.

Chapter 19: Tablespace 533

Tablespace Alter

2.

Set up your key columns according to instructions on the screen, then press the END key. The table is converted to a partitioned table, and the Table Alter screen appears.

3.

Enter LIMITS on the command line. The Table Partitioning & Limit Key Values screen appears.

4.

Specify limit keys for each partition, then press the END key. The index is altered.

More information: Accessing Table Functions (see page 546) Change Tablespace Type from Segmented to Partitioned (see page 532) Change Tablespace Type from Simple to Partitioned (see page 530)

Convert a Non-Partitioned Table to a TCP Table When a tablespace is changed to be range-partitioned, CA RC/Migrator converts any existing index-controlled partitioned table within the tablespace to a table-controlled partitioned (TCP) table. However, simple and segmented tablespaces do not contain a partitioned table that can be converted. Therefore, you must convert the existing non-partitioned table to a TCP table after performing either of the following tasks: ■

Changing a tablespace from simple to range-partitioned



Changing a tablespace from segmented to range-partitioned

To convert a non-partitioned table to a TCP table 1.

Enter YES in the Partitioning field on the Table Alter panel. Note: For more information about accessing table functions and panels, see the "Table" chapter. The Table Partitioning Key Col Selection & Maint screen appears. You must define at least one partitioning key column.

2.

Type S beside the name of each column that you want to include in the table's partitioning key, then press Enter. The selected columns are inserted into the key. Note: You can use line commands to arrange the columns in the key if needed.

3.

Press the END key. The Table Alter panel appears.

534 User Guide

Tablespace Alter

4.

Press the END key. The Table Partitioning & Limit Key Values panel appears.

5.

Enter a limit value for the first key column of each partition. Any values you entered are now reflected on the panel.

6.

(Optional) Specify additional limit values, then press the END key. The Alteration Strategy Services panel appears.

7.

Press the END key. CA RC/Migrator saves the changes to your strategy to convert the nonpartitioned table to a TCP table.

More information: Change Tablespace Type from Segmented to Range-Partitioned (see page 533) Change Tablespace Type from Simple to Range-Partitioned (see page 530)

Tablespace Alter Screen The Tablespace Alter screen lets you change the values that were used to create the tablespace. It is similar to the Tablespace Create and Tablespace Template screens. If you enter partition information, then change the tablespace to nonpartitioned, all lines except the first are deleted. If you change the tablespace back to a partitioned tablespace, the old partition values are returned. Edit the information as you would enter it in a Tablespace Create screen. Once you have made the changes you want, press PF3 (End) to process the alter.

Processing Considerations A change to the CLOSE Rule is effective as soon as the DDL is executed. A change to the BUFFER POOL is effective the next time the tablespace's data sets are opened. A change to the LOCKSIZE applies only to SQL statements that are executed later. It has no effect on currently executing SQL statements. Application plans are updated only if they are rebound. A change to the FREEPAGE or PCTFREE values take effect when records are loaded into the tablespace or when the tablespace is reorganized.

Chapter 19: Tablespace 535

Calculate Space Requirements for Tablespaces

When the changes are being made through the DB2 ALTER TABLESPACE, the following steps are taken to make the alter: 1.

The tablespace is stopped.

2.

The ALTER statement is issued.

3.

The tablespace is started in UT (utility) mode.

4.

The REORG statement is issued.

5.

The tablespace is started in RW (read/write) mode.

LC Line Command The LC line command lets you browse the LISTC Report and view space amounts for user-defined data sets. You can use this command from the Tablespace Alter or Tablespace Template screens to access a report of a particular data set. Enter LC at the CMD field of the data set for which you would like a report and the IDCAMS System Services LISTC Report appears. See Tablespace Template for a sample report.

Calculate Space Requirements for Tablespaces The Space Calculator facility can calculate the primary and secondary space quantities needed for your tablespaces and eliminates time-consuming calculations. This is especially important to calculate the space needed for segmented tablespaces and multiple tables within one tablespace. Multiple table calculations require an average row size to calculate accurately the total space needed for non-segmented tablespaces. The average row size approximates multiple tables' row length to compensate for the rows being interleaved on one page. You can create a stand-alone tablespace space strategy that saves space requirements for a tablespace or edit an existing space strategy as needed. If the tablespace is partitioned, space calculations can be made on each partition.

536 User Guide

Calculate Space Requirements for Tablespaces

To calculate space requirements for tablespaces 1.

Do one of the following: ■

Type SS (Space Calculator) in the Option field on the CA Products for DB2 for z/OS Main Menu and press Enter.



Type SSC on the command line from any CA database management productfor DB2 for z/OS and press Enter.

The SpaceCalc Strategy Select panel appears. The strategies are sorted by database name, space name, creator, and name. Stand-alone space strategies always appear at the top because the database name is blank. Object-linked space strategies appear indented under the name of the object to which they are linked. Depending on your video attributes, standalone and object-linked space strategies appear in low-intensity text. Actualized space strategies are highlighted. 2.

Do one of the following: ■

Type CT, the name of the strategy, and the name of the tablespace on the create line (first) to create a stand-alone tablespace strategy.



Press Enter to see a list of existing strategies and then type E next to the strategy that you want to edit. Selection criteria can be specified.

Press Enter. The Tablespace Strategy panel appears. Note: This panel has the same fields as the Tablespace Alter, Tablespace Create, and Tablespace Template panels. For more information about these fields, press F1 to access the online help. 3.

Type S next to a tablespace and specify a VCAT or storage group name in the VCAT or Stogroup fields, and press Enter. The Space Calculation panel appears. The tablespace name and the partition number appear on the first line. The control parameters default to the values last used on the Tablespace Create and Table Alter panels.

4.

Edit the control parameters and the table information fields as needed and press Enter. Note: All fields must contain a value before the Space Calculator can calculate the results. The space requirements for the tablespace or partition are calculated and the Space Calculator fills in the columns for each table included in the tablespace. If you have multiple tables in a non-segmented tablespace, the average row size appears.

Chapter 19: Tablespace 537

Calculate Space Requirements for Tablespaces

5.

(Optional) Type E (explode) next to a table or multiple tables and press Enter. Detailed statistics for the selected table or tables appears on the Space Calculation panel. Multiple commands are processed in the order they appear on the space calculation panel. Note: The statistics shown are applicable only for the selected table.

6.

Type T (totals) on the command line and press Enter. The calculated results for the tablespace appear in the Space Statistics section on the Space Calculation panel. Note: Segmented tablespace totals are calculated based on the minimum or maximum number of segments needed for the given number of rows, cylinders, or tracks as specified in the Qty Type field. Non-segmented tablespace totals are calculated based on the average row size.

7.

Press F3 (End) when you have completed your calculations. The calculations are used for the selected tablespace or partition. If you accessed the Space Calculator from CA RC/Migrator or CA RC/Update, you are returned to the tablespace panel you were at in the product. The calculations are updated on the panel and the information is used for the selected tablespace or partition. Note: You cannot change the values of an actual catalog object or the associated actualized space strategy. If you make and save changes to the statistics, an object-linked space strategy is created.

8.

Type S and an eight-character strategy name in the SSTRAT field and press Enter. Note: You can enter the name of a new strategy or reference an existing (previously saved) strategy. When a new space strategy is created, the strategy name or object link name is put into this field. The SpaceCalc Strategy Save panel appears.

9.

Verify the strategy attributes (database name, space name, creator, strategy name, and share option) and press Enter. The space calculation panel reappears. A message confirms that you have successfully saved the strategy, the action code in the SSTRAT field resets to N, and the space strategy is saved with the specified attributes.

More information: Locate Free Space (see page 539)

538 User Guide

Locate Free Space

Locate Free Space You can use the Space Calculator to locate volumes and storage groups with adequate free space for your tablespaces and indexspaces. For example, you can request a list of volumes, determine which volumes have available space, and create a storage group using those volumes. If you execute most jobs in batch, ensuring you have enough space available before job execution helps to ensure that the job does not execute unsuccessfully because of space limitations. Use the FIT command to toggle between showing all available volumes or storage groups or only those with adequate free space available. To locate free space 1.

Edit an existing strategy or perform a tablespace or indexspace space calculation. The Space Calculation panel for the tablespace or indexspace appears. The total space requirements needed for the tablespace or indexspace appear in the Space Statistics section. This information is used to determine which storage groups or volumes have available space.

2.

Type V (volume) or S (storage group) and an object name or selection criteria in the Volume field and press Enter. The Space Calculation panel lists and highlights the storage groups or volumes that match your selection criteria. The specified volume serial IDs (volsers) in the storage groups that contain the space amounts are also shown. Note: Note the track largest and cylinders largest field values to ensure you select a storage group that can accommodate the space you need allocated. SMS in the Volser field indicates that this is an SMS-managed storage group. If the device type is N/A and the remaining values are zero, this indicates that the volumes defined in the storage group do not exist, although they might have existed at the time the storage group was created.

3.

(Optional) Type FIT on the command line and press Enter. The Space Calculation panel lists only the storage groups or volumes that have adequate free space available. You can scroll through the list vertically and horizontally. Note: Use the FIT command to toggle between showing all available volumes or storage groups or only those with adequate free space available.

Chapter 19: Tablespace 539

Locate Free Space

4.

Review the following Free Space Verification fields and type S next to a storage group or volume to select it. You can select one storage group and up to six volumes. STOGROUP Identifies the name of the storage group that matches your selection criteria entered in the Volume field or Name field. The names that are highlighted have enough free space to satisfy the space calculator request. (This field displays only when stogroups are selected.) VOLSER Identifies the volume serial ID matching the selection criteria you entered in the Volume field or Name field or associated with the specified storage group. Volsers containing available space are shown. If SMS, the storage group is SMS-managed, rather than having volumes assigned to it. UNIT TYPE Identifies the device type of the pack (DASD device) associated with the Volser. If N/A (not applicable), the storage group is SMS-managed or the volume shown in the Volser field does not exist, is offline, or is otherwise inoperative. FREE EXTENTS Identifies the number of contiguous free tracks or cylinders on a DASD device. TRACKS (SIZE and LARGEST) Identifies the total number of free tracks available and the largest number of free tracks that exist in exactly one free extent. CYLINDERS (SIZE and LARGEST) Identifies the total number of free cylinders available and the largest number of free cylinders that exist in exactly one free extent. TOTAL TRACKS Identifies the total number of tracks that exist on the device. TRK/CYL Identifies the number of tracks per cylinder for the device. PERCENT USED Identifies the percentage of space that is currently allocated.

540 User Guide

VSAM Cluster Definitions

FREE DSCBS Identifies the number of free data set control blocks (DSCB) that exist in the volume table of contents (VTOC). A DSCB is a label of the disk data set. This field is useful when you want to confirm how many records are in the VTOC. If the VTOC is full, the space cannot be allocated. PUBLIC/PRIVATE Identifies the mount attribute of the volume. Valid values are PUBLIC, PRIVATE, or STORAGE. SMS Identifies whether the volume is managed by IBM System Managed Storage. Press Enter. The Space Calculation panel reappears. The Volume field shows the name of the storage group or volume located with free space. The Action value is reset to N. If more than one volume is selected, a plus sign (+) appears next to the name. Note: Volumes are temporarily removed from the panel if selected and placed in a queue for processing. They are used to automatically generate the appropriate VSAM define cards. You can use the S (SHRINK) command to view the selected volume queue and update as needed. When you process the create, alter, or template request from CA RC/Migrator or CA RC/Update, the selected volumes are included in the DDL to create or alter the tablespace or index. More information: Calculate Space Requirements for Tablespaces (see page 536) Calculate Space Requirements for Indexes (see page 639)

VSAM Cluster Definitions You can define the VSAM Cluster by accessing the VSAM Cluster Definition screen. You should use the Space Calculation screen before defining the VSAM data sets, as the space statistics calculated are saved and brought to this screen. Any volser selections made from the Volume Space Locator are used to define the VSAM cluster. For example, if you access the VSAM Define screen, any volser selections for the tablespace are displayed. VSAM Define for Tablespace The tablespace name and partition number are displayed.

Chapter 19: Tablespace 541

VSAM Cluster Definitions

The following fields are displayed under Generated VSAM Cluster: NAME The name of the data set. TYPE Choose the type of VSAM data set. Valid values are as follows: ■

L—Linear.



N—Non-indexed. A non-indexed data set is an Entry Sequenced data set (ESDS).

You must enter information for the unit type, primary and secondary space allocation, and volume names under Space Allocation. A short description of each field is given below. If you have calculated space information through the Space Calculation screen, the information is passed to this screen and converted to the proper unit for display. UNIT Select one of three units: R-Records, T-Tracks, and C-Cylinders. PRIMARY The VSAM space allocation amount is automatically retrieved from the data set in use and displayed in this field. Alternatively, you can enter the primary space quantity, specified in terms of the Unit you selected. Note: This quantity is not specified in bytes, as on the Space Calculation screen. SECONDARY The VSAM space allocation amount is automatically retrieved from the data set in use and displayed in this field. Alternatively, you can enter the secondary space quantity, specified in terms of the Unit you selected. Note: This quantity is not specified in bytes, as on the Space Calculation Screen. VOLUMES Enter the volume names. You can enter up to six volumes. Do not use these fields if you enter the Storageclass, Management Class, and Dataclass fields below. Any volser selections that you made from the Volume Space Locator is used to define the VSAM cluster and will appear in the Volumes fields. The example screen shows volumes CA200, CA300, and CA400. STORAGECLASS Enter the SMS storage class. If you entered something in the Volume field, leave this field blank.

542 User Guide

LOB Tablespaces

MANAGEMENT CLASS Enter the SMS management class. If you entered something in the Volume field, leave this field blank. DATACLASS Enter the SMS dataclass. If you entered something in the Volume field, leave this field blank. If the VSAM Catalog you are using requires the use of VSAM passwords, enter them under Passwords. Two additional options are offered on the VSAM Define screen under Options: ERASE Determine whether binary zeroes are written when the data set is erased. The options are: ■

YES—Yes, write binary zeroes.



NO—No, do not write binary zeroes.

ROSHARE Determine whether to use VSAM SHAREOPTIONS (1,3), which is needed for shared read-only defined databases. The options are: ■

YES—Yes, use the VSAM SHAREOPTIONS (1,3).



NO—No, do not use the VSAM SHAREOPTIONS (1,3).

Once you have entered all necessary information, press PF3 (End) to process the information and return to the tablespace Create, Template, or Alter screen.

Define a VSAM Cluster To define a VSAM Cluster, enter V (VSAM) in the line command area next to the partition or Tablespace whose VSAM Cluster you want to define. The VSAM Cluster Definition Screen appears.

LOB Tablespaces A LOB tablespace is used for holding an auxiliary table, which stores LOB data for a LOB column. If a column is defined as LOB in a table, it requires its own auxiliary tablespace and index.

Chapter 19: Tablespace 543

Tablespace Drop Considerations

The LOB Tablespace screens let you alter, create, and template DB2 LOB tablespaces. These screens appear when you specify LOB in the TS Type field on the Tablespace Create, Alter, or Template screens. Note: Database is the name of the database in which the tablespace is created. This is a required field. For LOB tablespaces, the database must be the same database in which the base table and its tablespace reside. The LOB Tablespace screens let you alter, create, and template DB2 LOB tablespaces. As with regular tablespaces, you can: ■

Apply user defaults to the index definition using the Apply Def command.



Display the original and current definitions of an object using the Compare command.



Toggle the header on and off using the HEADER command.



Enter selection criteria to bring up lists of objects to choose from. See the online help for more information about these fields.



Create an explicit VSAM data set for the tablespace through the VSAM definition facility.



Estimate the space required by a tablespace using the Space Calculator feature. If the tablespace is partitioned, you can make space calculations on each partition.

See the previous sections of this chapter for more information about these functions. When altering a tablespace object of any type, you cannot switch from an auxiliary tablespace to a standard tablespace, and vice-versa. However, you can change the type on a create or template.

Tablespace Drop Considerations The Drop Tablespace option lets you drop one or more tablespaces. You can select the tablespaces you want to drop from a selection list. Once you have selected the tablespaces you want to drop, you can accept, edit, or reject the actual DDL that is used to make the drop. If you drop a tablespace, all tables within the tablespace and all objects dependent all these tables are also dropped. You cannot drop a tablespace if it is being used by a DB2 utility. Note: For information about how to drop an object with the various drop options (S, SO, R, RO), see the CA RC/Update User Guide.

544 User Guide

Chapter 20: Table This section contains the following topics: Product Features for Maintaining DB2 Tables (see page 545) Accessing Table Functions (see page 546) Table Create Screen (see page 550) Table Template (see page 569) Table Alter (see page 569) Table-Controlled Partitioning (see page 575) Auxiliary Tables (see page 586) Identity Columns (see page 588) Materialized Query Tables (MQTs) (see page 593) Table Check Constraints List Screen (see page 600) SQL Editor Screen (see page 601) Referential Integrity (see page 602)

Product Features for Maintaining DB2 Tables The table object options let you create, template, alter, and drop DB2 tables. A DB2 table is a collection of rows all having the same columns. All data in DB2 is stored in tables, including the system catalog information. A DB2 table is the main object type within DB2. The following functionality is provided for creating and maintaining DB2 tables: ■

DB2 Object Selection Help—When defining a table, the object names of the table's database and tablespace must be entered. Instead of entering a specific object name, selection criteria can be entered, from which a list of objects appears.



Column Selection Help—You can retrieve other table columns that have already been defined into the current table definition. This lets you create standard column definitions that can be copied into other tables.



Row Size Indicator—Automatically displays the effects different data type decisions will have on the total row size as a table is created or changed.



Column Editor—When defining columns, any of the standard ISPF editor commands can be used to copy, replicate, delete, and move columns within the table definition. Four-way ISPF scrolling is supported for the table column display and split screen mode is fully supported. A help screen is available for selecting the column data types.

Chapter 20: Table 545

Accessing Table Functions



Column Explode—Instead of scrolling horizontally to view all the attributes of a column, you can use the column explode option. This option shows all column attributes on one screen.



Referential Integrity—You can create primary and foreign key rules as part of the table create or table alter process. Table and column selection screens make selecting the right columns easy, and let you specify the sequence number for each column.



Table-Controlled Partitioning—You can exploit table-controlled partitioning when creating, altering, and dropping DB2 objects as part of a CA RC/Migrator strategy.



Alteration Support—DB2 permits only certain alterations to a DB2 table using the DB2 ALTER command. If the alterations to a table cannot be performed using the DB2 ALTER command, you can use the Alter Table Option to automatically invoke RC/Alter to perform a drop and recreation of the table with the changes. All dependents, data, and authorizations are automatically restored and all changes, including the impact on any indexes using columns, are automatically propagated to any dependent object types. This is a very powerful feature and is transparent to the end user. When the end user makes the change, we will make the change using the appropriate methods.



COMPARE Command—While modifying a table, a summary of all changes displays by entering the COMPARE command. A new screen displays showing the old and new versions of the table, and the associated changes. Use the RES command to reset the changed column back to its original values.



CURRENT SQLID Support—Create tables for other users using the SET CURRENT SQLID command to perform the necessary ID switching.

Note: The term “table screen” is used to refer to the general layout of the Table Create screen, Table Template screen, and Table Alter screen. All these screens share the same fields and layout, but the available options are different depending on the mode (create, alter, template).

Accessing Table Functions Review the following regarding accessing table functions from within the strategy types:

546 User Guide



Accessing table functions from an alteration strategy (see page 547)



Accessing table functions from a migration strategy (see page 547)



Accessing table functions from a compare strategy (see page 547)



Selecting tables (see page 548)



Editing or browsing table data in views (see page 550)

Accessing Table Functions

Alteration Strategy To create, alter, template, or drop a table through an alteration strategy, enter C, A, T, or D in the Option field and T in the Object field of the RC/M Alteration Strategy Services panel. The appropriate table screen appears.

Migration Strategy To create a table through a migration strategy, enter U in the New Objects field of the RC/M Implode/Explode Services. The Object Creation Services screen appears. Enter an S under Table and press Enter. To alter a table through a migration strategy, enter E in the Selection field next to the name of a table included in the strategy on the Implode/Explode screen or the Dependent Object Selection screen. Only primary and dependent objects can be altered in a migration strategy. To template a table through a migration strategy, enter T in the Selection field next to the name of the table to be templated on the Dependent Object Selection screen. The appropriate table screen appears. Only dependent objects can be templated in a migration strategy, and objects cannot be dropped.

Compare Strategy To create or drop a table through a compare strategy, enter U in the Create/Drop Objects field of the RC/M Compare Explode Services screen. The RC/M Create/Drop Object Selection screen appears. To create a table, enter C in the Option field and T in the Object field. The Table Create screen appears. To drop a table, enter D in the Option field and T in the Object field. A selection screen appears. Select the object to be dropped. To alter a table through a compare strategy, enter E next to the name of a table included in the strategy on the RC/M Compare Explode Services screen or the RC/M Dependent Object Mapping screen. The Table Alter screen appears. Objects cannot be templated in compare strategies. Note: Because they are similar in appearance, the majority of the screens in this chapter are from CA RC/Update.

Chapter 20: Table 547

Accessing Table Functions

Selecting Tables When altering, dropping, or creating (by template) a table, a selection screen is presented for selecting the tables if not already specified. Make the table selection list more specific by specifying selection criteria for the Item (table) Name and Creator ID prompts in the header. Use the EQF facility to further specify the tables displayed. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about EQF. The Table Selection screen displays all the fields available in the SYSIBM.SYSTABLES table. This information displays to make selection of the tables easier. All selection screens support the standard scrolling commands. To select a table, enter S in the Sel column next to the table name. The following describes the table definition fields: Table Name (Display only.) The table name. Creator (Display only.) The table creator. Database The table's database name. Tsname The table's tablespace name. Colcount The number of columns defined in the table. Reclen Internal DB2 record length of the table, including control fields. Obid Internal DB2 table object identifier assigned by DB2. The following fields are displayed by scrolling right (PF11). DBID Internal database identifier assigned by DB2. Label The table's label.

548 User Guide

Accessing Table Functions

Edproc The table's Edit Procedure. Valproc The table's Validation Procedure. Card The number of rows in the table or total number of LOBs in an auxiliary table. Npages Number of pages on which rows of the table exists. Pctpages Percentage of pages in the table's tablespace that have rows from this table. Parents Number of Referential Integrity relations in which this table is a parent. Children Number of Referential Integrity relations in which this table is a child. Keycols Number of columns in the table's primary key. Status Reports the status of the table's index as it relates to keys. ■

Table is incomplete—The table has been created with a primary key, but has no index defined on the primary key. The internal code stored in SYSIBM.SYSTABLES for this condition is I.



Table has Primary Index—The table has a primary index. The internal code stored in SYSIBM.SYSTABLES for this condition is X.



(blank)—Table has no primary key or it is a catalog table.

Location Location name of object for alias defined on a remote object. Blank for all others. Tbcreator For an alias, the authorization ID of the owner of referenced table or view. Blank for all others. Tbname For an alias, the name of the referenced table or view. Blank for others.

Chapter 20: Table 549

Table Create Screen

Editing or Browsing Table Data in Views You can edit or browse table data in views using RC/Edit. See the CA RC/Update User Guide for more information.

Table Create Screen The Table Create screen automatically generates all statements associated with the SQL CREATE TABLE statement including: ■

CREATE TABLE



COMMENT ON TABLE



COMMENT ON COLUMN



LABEL ON TABLE



LABEL ON COLUMN

Note: Specify APPLY DEF on the command line to replace the initial values and options that are displayed on this screen with the established default values for the type of object being created, altered, or templated. The default values for each object type are established through the DEFAULTS command. For more information about establishing object defaults for individual users or groups of users, see the “Object Definition Defaults” chapter. From this screen, you can:

550 User Guide



Use object selection lists to retrieve the name of the desired database or tablespace.



Copy column definitions into the table from other tables.



A dynamic row size indicator displays showing the current row size.



Column Explode and Column Type screens are provided for entering column data.

Table Create Screen

The following diagram illustrates the possible screen flow when creating a table: Tablespace Selection Screen Tablespace==>%

Table Comments and Labels

Table Screen

Comm/Lab==>Y

Database Selection Screen

Table Check Constraints List

Database==>%

Check Const==>Y

Column Explode Detail

Table Referential Constraints Foreign Key==>Y

Enter E under CMD Column Type Selection Enter * (an asterisk) under COLUMN TYPE

Unique Constraints Management Command: UC|UNIQUECONST

Create a Table The Table Create facility offers help in creating a table accurately and efficiently. However, these screens can camouflage the easy process of creating a table. This section summarizes the required and optional steps for creating a table. To create a table 1.

Go to the Table Create screen. See Accessing Table Functions if unsure of how to get to this screen.

2.

Enter data in the required table information fields (Table and Creator), and optionally update other fields.

3.

Enter the required column fields (Column Name and Column Type), and optionally update other fields.

4.

Press PF3 (End).

Chapter 20: Table 551

Table Create Screen

Table Definition Fields The following describes the table definition fields: Table Enter the table name. The name must not identify a table, view, alias, or synonym that exists at the current server. This field is required. Creator Enter the table creator (user ID). Comm/Lab Enter a value to indicate whether to enter comments or labels on the table. Upper and lowercase characters can be specified. Valid values are as follows: ■

Y—Displays the Table Comments and Label screen.



N—Erases any table comments and labels. This is the default.



U—Enter over a Y to update table comments and labels.

Database Enter the table's database or enter selection criteria to select the database name from an object selection list. The default is DSNDB04. Editproc Enter the name of an edit routine for the table. This edit routine is an installation defined program that is invoked whenever a row is inserted or updated. This routine is typically used to translate a row of data to or from its stored condition (like a compression routine). If nothing is entered for EDITPROC, the table has no edit procedure. This is not valid for tables that contain a ROWID or LOB column. The default is none. Data Cap Indicate whether SQL changes to this table are written to the log. Valid values are as follows: ■

NONE—No additional information is recorded. This is the default.



CHANGES—Additional information about SQL updates is written to the log.

Tablespace Enter the table's tablespace or enter selection criteria to select from a selection list. If the field is left blank, DB2 creates an implicit tablespace for the table. You can also set a default with the DEF command. (See the “Object Definition Defaults” chapter for more information about the DEF command.)

552 User Guide

Table Create Screen

Validproc Enter the name of a validation routine for the table. A validation routine is usually used to impose limits on the information that can be entered in a table. If you do not enter a value for this field, the table has no validation routine. The default is none. OBID Enter the object ID for this table. If this field is left blank, the SQL to assign the OBID is automatically generated if the table resides in a READ database; otherwise, no SQL is generated to assign a special OBID. If an invalid OBID is entered, the SQL fails when executed. This field defaults to SQL assigned. The Object Identifier is automatically assigned by DB2 to each tablespace, table, and index in the database when it is created. The system uses the OBID as an internal descriptor. You can specify the OBID when in one of the Table screens. If a table is being created in a READ database, it must have the same OBID as the corresponding table in the OWNING database. If a table is being created in an OWNED database, use the OBID field to assign an object identifier. Otherwise, DB2 will assign it. When the COMPARE command is executed, the OBID for the existing table displays. Use this feature to make sure the correct OBID is being used in READ databases. Forgn Key Enter U or Y in this field to define a foreign key. A screen listing existing referential rules appears. See Listing Referential Rules for more information. The default is none. Note: If you are creating, altering, or templating an MQT, and you have specified Initially Deferred in the Data field, the Forgn Key field is unavailable. An MQT cannot be a parent or child in a referential integrity relationship. Initially Deferred is the default value (unless overridden by object definition defaults).

Chapter 20: Table 553

Table Create Screen

Audit Determines the types of access to this table that will cause auditing to be performed. Valid values are as follows: ■

None—No auditing to be done when this table is accessed. This is the default.



Changes—Auditing to be done during the first insert, update, or delete operation by each unit of work, only if the appropriate audit trace class is active.



All—Auditing to be done during the first of any operation by a utility or application, only if the appropriate audit trace class is active and access is not with CA Quick Copy or COPY, CA Fast Recover or RECOVER, REPAIR, or any standalone utility. See the IBM DB2 SQL Reference Guide for more information.

Volatile Specifies how DB2 chooses access to the table. Valid values are as follows: ■

Y—Index access should be used on this table whenever possible for SQL operations. The VOLATILE clause is generated and inserted into the DDL.



N—SQL access to this table should be based on the current statistics. The NOT VOLATILE clause is generated and inserted into the DDL if necessary.

Check Const Specify whether to enter values that define check constraints for any columns of the table. Valid values are as follows:

554 User Guide



N or (blank)—Do not apply check constraints. This is the default. If check constraints currently apply, disable them.



Y—Indicator that check constraints already exist for one or more columns of the table.



U—Display the Table Check Constraints List screen. Use the screen to select a constraint name for updating, to add a new constraint, or to view the existing constraints.

Table Create Screen

Restrict Specify whether to protect this table from being accidentally dropped. Valid values are as follows: ■

N or (blank)—Do not restrict. This is the default. We do not prevent the table from being dropped. If the value is Y and N is entered, the restriction is lifted from the table and its associated database and tablespace.



Y—Prevent a drop for this table. The table cannot be dropped while this option is in effect. To drop the table, first alter it and change the setting to No (N). The database and tablespace associated with the table are also restricted and cannot be dropped until the table's restriction is lifted.

CCSID (Coded Character Set Identifier) Specify the encoding scheme for data stored in the table. Valid values are as follows: ■

Ascii—Encode data using the ASCII CCSIDs specified during installation.



Ebcdic—Encode data using the EBCDIC CCSIDs specified during installation.



Default—Omit the generated CCSID argument from the generated DDL. When creating a table, the default encoding scheme of the tablespace in which the table resides is used. However, note the following: –

If a tablespace is explicitly defined, default must be specified or CCSID must be the same as the encoding scheme used by the tablespace.



If the tablespace is not explicitly defined, the encoding scheme of the database is used.



If the tablespace is not explicitly defined and the database is DSNDB04, the value of the Def Encoding Scheme field on the DB2 installation panel (DSNTIPF) is used.

See the IBM DB2 SQL Reference or Administrator guides for more information about default encoding schemes. ■

Unicode—Specifies that the data must be encoded using the Unicode CCSIDs specified during installation. This value is only supported by DB2 versions 7.1 and above.



blanks—None. This has the same meaning as Default.

Note: All data stored within a tablespace must use the same encoding scheme.

Chapter 20: Table 555

Table Create Screen

Partitioning Specifies whether the table uses table-controlled partitioning (TCP) and displays the number of partitions (TS Parts) for a TCP tablespace (if partitions exist). Valid values are as follows: ■

YES—Specifies that the table is defined to use TCP.



NO—Specifies that the table is not a partitioned table.

You can change the value from YES to NO to indicate that the table is not a partitioned table. Index controlled partitioning (ICP) is assumed. If the table had a type P clustering index defined, the index is converted to type 2. You can also change the value from NO to YES to convert the table from ICP to TCP (without dropping the clustering index). Table Type Indicates the type of table. Valid values are as follows: ■

Regular—Regular table Note: This is the default (if not overridden by object definition defaults). For more information about object defaults, see the “Object Definition Defaults” chapter.



MQT—Materialized query table



Globaltemp—Global temporary table



Auxiliary—Auxiliary table

Rowsize A display-only field showing the current length of table's row and by how many bytes it falls under (-) or over (+) the maximum row size. These values are recalculated each time the screen displays and reflects the changes in the table's row size as you add or modify columns. The maximum possible rowsize is 8 bytes less than the table's record size. If the table has an EDITPROC, the table's record size as well as the maximum rowsize is reduced by 10 bytes. With the exception of Large Object (LOB) and ROWID columns, other than where noted, the general guidelines for determining the space required for built-in and user defined column types (UDT) is:

556 User Guide



Based on its size, the number of bytes that a non-graphic column needs is one byte per character



The number of bytes that a graphic column needs is two bytes per character



Allow one extra byte for each column that allows nulls

Table Create Screen



Including all LOB columns, allow two extra bytes for each varying length column



Allow two extra bytes for ROWID columns

When creating a table (and before any columns are added), the first number to the left of the '/' displays zero (0) indicating that no columns are defined for the table and that the rowsize is essentially zero. The number to the right of the '/' displays the maximum rowsize with a negative sign (-) next to it. As columns are added to the table, the number to the left of the '/' will increase and the number to the right of the '/-' will decrease showing how many bytes are still available before reaching the maximum rowsize. When the maximum rowsize is reached, the number to the right of the '/' will display '-0'. If the maximum rowsize is exceeded, the '-' is replaced with a '+' to indicate the number of bytes you are over the maximum rowsize. Rowsize will generally be the maximum rowsize when one or more varying length (LONG VARCHAR or LONG VARGRAPHIC) columns are used. This is because all remaining space in the row is allocated to, and evenly distributed amongst, the LONG columns. The size of the long varying length column will change depending on the number and sizes of the other columns.

Column Definition Fields The Column Definition section of the Table Create screen defines the attributes of each column in the table. You can define up to 750 columns per table. Note: If you are creating, altering, or templating a materialized query table (MQT) (see page 593), a column list is not available. However, to view or change column list information, you can change Table Type to REGULAR. When you are finished, you can enter MQT for Table Type to redisplay the MQT panel. The following describes the column definition fields: Cmd Specify line commands to define your columns. For a descriptive list of the available commands, see the Column Line Commands section in this chapter. ### Numeric place of the column in the table.

Chapter 20: Table 557

Table Create Screen

PS Identifies the column's partitioning sequence (numeric position) within the table's partitioning key. Note: If the column is not part of a partitioning key, or if the table is not using table-controlled partitioning (TCP), no value is displayed. Column Name Designates the name for the column. Do not use the same name more than once per table. Use column selection criteria to retrieve column names from other tables. See Inserting Columns from Other Tables for more information. Column Type Identifies whether the column is a built-in or user-defined data type (UDT). Note: A column defined as LOB in a table requires its own auxiliary tablespace and index. Only a single LOB column can exist for a single table. See LOB Tablespaces in the “Tablespace” chapter and Auxiliary Indexes in the “Index” chapter for more information about LOB tablespaces and auxiliary indexes. The built-in data types are:

558 User Guide



BLOB—For a binary large object string, the size can range from 1 to 2,147,483,647 bytes (2 GBs -1). A BLOB column has a varying-length and is a long string column regardless of its length. If the length specification is omitted, the default 2 megabytes is assumed.



CHAR—For a fixed-length character string, which can range from 1 to 255. If the length specification is omitted, the default is 1.



CLOB—For a character large object string, which can range from 1 to 2,147,483,647 bytes (2 GBs -1). A CLOB column has a varying-length and is a long string column regardless of its length. If the length specification is omitted, the default is 2.



DATE—For a date.



DBCLOB—For a double-byte character large object string. A DBCLOB column has a varying-length and is a long string column regardless of length. If the length specification is omitted, a length of 1,073,741,824 (1 GB) is assumed.



DECIMAL—For a decimal number. The first integer is the precision of the number or the total number of digits, which can range from 1 to 31. The second integer is the scale of the number or the number of digits to the right of the decimal point, which can range from zero to the precision of the number.

Table Create Screen



FLOAT—For a double precision floating-point number.



GRAPHIC—For a fixed-length graphic string, which can range from 1to 127. If the length specification is omitted, a length of 1 character is assumed.



INTEGER—For a large integer.



LONGVAR—For a varying-length character string whose maximum length is determined by the amount of space available in a page. If the maximum length is greater than 254, the column is a long string column.



LONGVARG—For a varying-length graphic string whose maximum length is determined by the amount of space available in a page. If the maximum length is greater than 127, the column is a long string column.



REAL—For a single precision floating-point number.



ROWID—For a row ID type. A table can have only one ROWID column. The values in a ROWID column are unique for every row in the table and cannot be updated.



SMALLINT—For a small integer.



TIME—For a time.



TIMESTMP—For a timestamp.



VARCHAR—For a varying-length character string, which can range from 1 to the maximum rowsize.



VARG—For a varying-length graphic string, which must range from 1 to n/2, where n is the maximum rows size minus 2 bytes. An integer longer than 127 defines a long string column.

Note: To view a list of column types from which you can select, enter an I (to insert a column) or T (to display valid column types) in the CMD field and press Enter. A selection screen appears. See Inserting a New Column for more information. Size Determines the length of the column, or in the case of a decimal column, its precision. See the previous Column Type field descriptions for valid value ranges and defaults. You can also set a default using the DEF command. Once you select a column type and press Enter, a range description is provided so that you can enter a valid size. This field has been expanded to 10 characters to support large object sizes in DB2 V6.0 or higher.

Chapter 20: Table 559

Table Create Screen

If there is a single column whose type is a long varying type (LONG VARCHAR or LONG VARGRAPHIC) the size is equal to the remaining space available in the row. If there is more than one LONG VARCHAR column, the space available on the page is divided equally among the long varying type columns. The size is automatically calculated. The size of LONG VARCHAR columns is recalculated each time the size of another column is changed or when a column is added or deleted. Note: If there are LONG VARCHAR and LONG VARGRAPHIC columns, the size of the LONG VARGRAPHIC is half the number of characters of the LONG VARCHAR columns. This is because the graphic characters are two bytes per character, rather than one. N (Column null indicator) Indicates whether the column can contain a null value. Valid values are as follows: ■

Y—Null values are allowed. This is the default.



N—Null values are not allowed.

Enter ? to access the Column Nulls Selection screen. You can also set a default using the DEF command. Note: For the ROWID Column Type, this value defaults to N. D (Column Default Indicator) Indicates the type of default to be used. Valid values depend on the value entered for the previous Column Null Indicator (N) field. To display a list of values, enter ?. When the Column Null Indicator (N field) is Y, the following values are valid:

560 User Guide



C—User-defined constant. The column has a user-defined default value. This generates the WITH DEFAULT 'constant' clause in the DDL.



N—Null. The column's default is null. The NOT NULL and WITH DEFAULT clauses are omitted from the DDL. This generates the WITH DEFAULT NULL clause in the DDL. This is the default. You can also set a default using the DEF command.



S—SQLID. The column's default is the SQL authorization ID of the process. Valid only for character string columns with a length attribute of at least 8 bytes. This generates the WITH DEFAULT CURRENT SQLID clause in the DDL.



U—USERID. The column's default is the execution-time value of the USER special register. Valid only for character string columns with a length attribute of at least 8 bytes. This generates the WITH DEFAULT USER clause in the DDL.

Table Create Screen



Y—System Defaults. The column's default is determined by the column's data type. The following list describes the value inserted (by the WITH DEFAULT clause in the DDL) for each column type: –

Numeric—0



Fixed-length string—Blanks



Varying-length string—A string length of 0



DATE—Current Date



TIME—Current Time



TIMESTAMP—Current Timestamp



DISTINCT TYPE—The default of the source data type

When the Column Null Indicator (N field) is N, the following values are valid: ■

All of the previous values are available, with the same functionality, with the exception of N-Null.



A—ROWID or identity column generated always.



D—ROWID or identity column generated by default.

Fordat Specifies a subtype for a character string column. Valid values are as follows: ■

B—Bit Data. The contents of the column are treated as binary data for exchange with other systems. Do not specify B (Bit) for CLOB columns.



S—SBCS Data. The contents of the column are single byte characters.



M—Mixed Data. The contents of the column are mixed data. This provides access to double byte characters for use with alphabets containing many characters, such as Kanji.



(blank)—Default. The default data type is determined by the DB2 Install panel (DSNTIPF) value for mixed data.

Important! This option applies only to CHAR, VARCHAR, LONG VARCHAR, or CLOB column types. Do not use this clause with columns of any other data type, including any distinct types. See the IBM DB2 SQL Reference Guide for more information. PK Specifies the column's numeric position within the table's primary key. The value is blank if the column is not part of a primary key. You cannot use ROWID or LOB columns as a primary key (PK). The default value is none.

Chapter 20: Table 561

Table Create Screen

UK Specifies that the column is defined as part of Unique Constraint in the Unique Constraint Management Screen , Y displays in this field. FK Indicates if the column is defined as part of the foreign key, if Y displays. Otherwise, the field is blank. See Referential Integrity for more information. You cannot use ROWID or LOB columns as a foreign key (FK). The default value is none. You can view the following fields using the horizontal scrolling keys: Note: If the horizontal scrolling mode is set to Column (the default), the Comments field will not be displayed until the entire field can be displayed. Schema Specifies the high level qualifier of the column type (see the Column Type field). If Column Type is DISTINCT, this displays the schema of the distinct type. Otherwise, the value is SYSIBM. Note: When creating a table, the initial default value for schema can be set using the DEF (object definition defaults) primary command. Label Contains any label information (up to 30 characters) for the column. The default is none. Comments 1-50 Column comment information, up to 50 characters. To edit or enter more than the 50 characters displayed on the Table Screen, use the E (EXPLODE) line command. The Explode Screen lets you enter and edit the full 254 characters supported by DB2. Any editing changes made in this field affect the first 50 characters of the comment. All other characters after the first 50 characters are not affected. The default is none. FLDPROC Specifies the name of an edit routine that transforms or translates a field to or from its stored condition. If blank, the column does not have a field procedure. You can add or alter this field. The default is none. FLDPARM 1-50 Field procedure parameters. You can enter or modify a parameter list that will be passed to the FLDPROC routine. Allows entry of up to 50 characters as the parms to pass to the field procedure. This field can be up to 254 characters. See the Comments 1-50 field previously described for more information about entering more than 50 characters of information.

562 User Guide

Table Create Screen

Column Line Commands There are many commands you can use to define your columns.

ISPF Line Commands The column definition section of the table screens support standard ISPF line commands for defining and editing your table's columns. Some of the line and block commands supported are as follows: ■

I—Insert



C—Copy



D—Delete



R—Repeat



M—Move

Special line commands, Pnn and Fnn, are provided to define referential rules. For more information, see the Referential Integrity section in this chapter. The following describes additional line commands available: A (After) Place copied or moved columns after this target. B (Before) Place copied or moved columns before this target. Cnn Copy nn columns (including this one) to the location marked by A or B. If nn is omitted, one column is assumed. nn must be a numeric. CC Use paired CC commands to specify a block of columns to copy to the location marked by A or B. Dnn Delete nn columns (including this one). If nn is omitted, one column is assumed. nn must be a numeric. DD Use paired DD commands to specify a block of columns to delete from the current column to the location marked by A or B.

Chapter 20: Table 563

Table Create Screen

E Column Explode Detail permits all attribute editing for a column on one screen. For more information, see the Column Explode Detail (E) section following in this chapter. Fnn Define a column as part of the foreign key, enter Fnn, where nn is the number that represents the position of the column within the foreign key for a composite key. The Foreign Key Detail screen appears. Inn Insert nn columns following this column. If nn is omitted, one column is assumed. nn must be a numeric. Mnn Move nn columns (including this one) to a location marked by A or B. If nn is omitted, one column is assumed. nn must be a numeric. MM Use pared MM commands to specify a block of columns to move to the location marked by A or B. Pnn Define a column as part of the primary key, enter Pnn, where nn is the number that represents the position of the column within the primary key for a composite key. The PRIMKEY# field is updated to reflect the change. The order of the number is important. Rnn Repeat this column nn times and inset the duplicate columns immediately after this column. If nn is omitted, one column is assumed. nn must be a numeric. RR Use paired RR commands to specify a block of columns to repeat. RES Reset the value of the column to its original value. For more information, see RESET and UNDO. SRC Set this column to its Source definition. This command is valid for CA RC/Migrator compares only.

564 User Guide

Table Create Screen

T Select a data type for the column from a list of column types. For more information, see the Column Definition Fields section. TRG Set this column to its Target definition. This command is valid for CA RC/Migrator compares only. Unn Undo changes made to nn columns (including this one) and return them to their old definitions. If nn is omitted, one column is assumed. nn must be a numeric. For more information, see the RESET and UNDO section that follows in this chapter. UU Used paired UU commands to specify a block of columns to undo. V Display the Column Default Value Specifications screen, on which you can specify a default value for this column. For more information, see the Column Default Value Specifications Screen section. This command is not valid for ROWID or LOB columns.

Column Explode Detail (E) The Column Explode Detail screen presents all the available attributes for a column on a single screen. To display the Column Explode Detail Screen, enter E next to each column with which you want to work. The Column Explode option does not need to be used to edit a column's attributes. The benefit of the Column Explode Detail screen is that all attributes are on the screen. If more than one column has been selected, each column is processed individually, in the order of their appearance in the table. From this screen, two new primary commands are available: ■

TYPE—Lets you select a data type for the columns from a list of column types



VALUE—Lets you specify a default value for a new column.

The most current or new data for each column is always displayed, unless specified otherwise. When current data displays, NEW appears on the left side of the Column Detail Specifications for Table ===> display only field. If any column data is changed, the data associated with the column at the beginning of the session is considered OLD. Note: Newly inserted columns do not have old data. Therefore, OLD cannot be entered in this field for a newly inserted column.

Chapter 20: Table 565

Table Create Screen

Enter information in these fields exactly as in the Table Create, Template, or Alter screen (see Table Create). Invoke the Column Type Screen by entering an asterisk (*) or an invalid data type in the Column Type field. When finished with the Column Explode screen, press the PF3 (End) key to return to the Table Screen. Any changes made on the Explode screen are shown on the Table Screen. If changes were made on the Explode screen that should be canceled, press PF3 (End) to exit the screen and enter the RES (reset) line command next to the column on the Table Screen. This will reset the column back to its previous definition. If more than one column has been selected, the next column automatically appears when PF3 (End) is presented. Once all selected columns have been processed, pressing PF3 (End) displays the Table Screen. More information: Data Type Conversions (see page 571)

RESET and UNDO If you make changes to a column and you want to return the column to its original definition, enter U (UNDO) or RES (RESET) line command next to the column name. This retrieves the original definition of the column before any changes were made. To undelete a column that has been deleted, enter the C (COMPARE) command to invoke the compare screen. Find the deleted column and enter the U or RES command on the Column Deleted line. Note: For inserted columns, a Column Inserted line displays. If the RES command is entered on an inserted column, it is removed.

Primary Commands The following types of commands are available to make working with tables easier:

566 User Guide



Toggle commands (see page 567)



Scrolling commands (see page 567)

Table Create Screen

Toggle Commands This section describes the commands you can use to toggle the display: ■

HEADER or H—Toggle the screen header on and off. This is particularly useful in split screen mode.



COMPARE or C—Enables comparison of the current version of the table with the table as it existed at the beginning of the session. Toggle this information on and off by entering C in the command line.

Scrolling Commands The following commands control the scrolling of the column definition section on the table screen. For more information about the scrolling commands, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. ■

EXCLUDE and SHOW—The EXCLUDE command excludes an attribute from the column list on the Table Screen. The column attribute is redisplayed by entering the SHOW command. This can be helpful to limit the column attributes displayed on the screen.



FIND and RFIND—The FIND command finds a string within the column list. RFIND repeats the previous find. The FIND and RFIND can be column specific or global.



FREEZE, UNFREEZE, and MELT—The FREEZE command lets users freeze attribute columns for horizontal scrolling. The CMD, ### (column number), and COLUMN NAME attributes are automatically frozen. Use the MELT or UNFREEZE commands to remove column freezes.



SCROLLB and SCROLLC—SCROLLB sets the horizontal scrolling mode to BYTE. SCROLLC sets the horizontal scrolling mode to COLUMN (the default).



QPRINT and PPRINT—QPRINT prints the table's column list. PPRINT prints the columns displayed on the current page.



SORT—The SORT command is not functional for the column list.

Column Default Value Specifications Screen The Column Default Value Specifications screen lets you specify an initial (default) value for a new column on an altered or newly created table. The value you specify is dependent on the size of the column and the column's data type. User-defined data types are supported.

Chapter 20: Table 567

Table Create Screen

A default value can also be specified for an existing column when the Column Default Indicator (D field) is set to C (Constant). Note: For all Default Types (with the exception of C), the default value specified is used only when the table is unloaded. When the default type is C, the value specified is used by DB2 and will remain in effect for new rows inserted and all existing rows updated. To access the Column Default Value Specifications screen, enter V in the CMD field for a newly created column on the Table Create, Table Template, or Table Alter screen.

Inserting Columns from Other Tables Columns can be inserted from other tables, even if the column or table name is unknown. You can list the columns currently defined in the SYSIBM.SYSCOLUMNS table. For DB2 V6 and above, this includes user-defined data type (UDT) values. If a column is selected for inclusion into the new table, all attributes of the columns are copied into the table definition. The column copy feature makes it very easy to create standard column definitions that can be reused by different tables.

Insert a Column To insert a new column 1.

Insert a new column (or overwrite an existing column) on the Table Create, Alter, or Template screens.

2.

Type in the column name.

3.

Press Enter. The Column Type Selection screen appears. All possible data values are displayed. This information can be different depending on what version of DB2 you are running. The Creator/Schema type defaults to SYSIBM. For a description of the fields and possible column types, see Column Definition.

4.

Select a column type and press Enter. A pop-up dialog box provides you with possible ranges and default values for the column type you selected.

5.

568 User Guide

Enter the column size and press Enter.

Table Template

Insert a User-Defined Column To insert a user-defined column 1.

Insert a new column (or overwrite an existing column) from the Table Create, Table Alter, or Table Template screens.

2.

Specify a new column name and press Enter. The Column Type Selection screen appears. All column type values default to those provided within SYSIBM.

3.

In the Creator field, replace SYSIBM with an asterisk (*) and press Enter.

4.

Page down (PF8) past the SYSIBM defaults to view valid user-defined data types. For all user-defined data types, the schema, source schema, source type, and owner are displayed. For a description of the fields, see Column Definition.

5.

Select the user defined data type you want to use for your column type.

Table Template The template option lets you create a new table using an existing table as a template. A template session is actually a create session with the additional step of selecting a table as a starting point. You must change the table name, and you can also change other fields. Dependent objects are not included in the template operation. The Table Template screen displays the values used to create the template table. Change the fields for the new table according to the procedures outlined in Table Create. After changes have been made, press PF3 (End).

Table Alter You can alter a table using: ■

The TABLE ALTER statement



The Alter Table option

Detailed information is provided in the following sections.

Chapter 20: Table 569

Table Alter

TABLE ALTER Statement The DB2 ALTER TABLE command only supports the following actions: ■

Adding columns to the end of a table



Increasing a column's length



Changing a column's data type



Changing referential integrity rules



Changing the auditing attribute



Changing the VALIDPROC



Changing the data capture attribute



Renaming a table

DB2 does not support any other types of changes. To make any other changes, the table must be dropped and re-created with the new definition. Any supported changes, when combined with unsupported changes, also require the table to be dropped and re-created. Note: When the table is dropped, all data, dependents, and security are also dropped.

Alter Table Option The Alter Table Option fully supports the alteration of any DB2 table attribute. If a non-DB2 supported change to a table is requested, the RC/Alter facility is automatically invoked to perform a drop and re-creation (including the saving and restoring of all data, dependents, and security) of the table. This type of alteration must be executed in batch mode. The Table Alter screen displays the values used to create the table. Edit the information in the Table Alter screen as in a Table Create or Template screen. Use the COMPARE command to compare the current version of the table with the edited table. Once the changes have been made, press PF3 (End) to process. Note: For more information about the COMPARE command, see the online help.

570 User Guide

Table Alter

Online Schema Support Regarding Table Alterations The product provides the following support for online schema evolution (extended ALTER functionality introduced in DB2 V8): ■

Updates of column types and lengths through ALTER TABLE statements with the ALTER COLUMN column-name SET DATA TYPE clauses, with one exception: DROP and CREATE DDL will be generated for the table if a DECIMAL column is altered to a floating point data type and the column is used in an index.



Changing of the VOLATILE attribute to NOT VOLATILE (and vice versa).

To avoid versioning of objects due to the new ALTER extensions, you can use the Drop & Re-create analysis option to force the dropping and creating of DB2 objects as was done prior to DB2 V8. REORG requests are honored when requested for tablespaces that are placed in AREO status when an extended ALTER occurs. Setting the Drop & Re-create analysis option to N generates ALTER TABLE statements with ALTER COLUMN column-name SET DATA TYPE clauses (instead of dropping and re-creating the table). If you execute this ALTER, the following results can occur: ■

The tablespace can be left in Advisory Reorg Pending (AREO) status.



One or more indexes can be left in AREO or Rebuild Pending (RBDP) status.



If you are running DB2 V8 in Compatibility Mode (CM) or Enabling New Function Mode (ENFM), and you increase the length of a VARCHAR column that participates in an index, the index will be left in Rebuild Pending (RBDP) status.

Note: You can select the REORG analysis option TS, IX, or B to automatically generate the REORG TABLESPACE or REORG INDEX control cards in the analysis output DDL file and remove the pending status

Data Type Conversions Extensive data conversion capabilities are provided to automatically convert existing data when a column's data type has been altered. The data conversion is performed by the unload program at the time the data is unloaded from the table. Note: This section is provided for informational purposes only. No manual intervention is required during the alteration process.

Chapter 20: Table 571

Table Alter

The following table summarizes the data type conversions that can occur. The vertical axis represents the input type (from). The horizontal axis represents the output type (to). A Y indicates that CA Fast Unload conversion is supported. For all others scenarios, the Batch Processor unload is invoked to perform the work, and output is written in a format that CA Fast Load can use. Note: For more information about data conversions, see the CA Database Management Solutions for DB2 for z/OS Batch Processor Reference Guide.

S M A L L I N T .

X Y

X Y

X Y

XY

X Y

X Y

X Y

X Y

XY

X Y

X Y

X Y

X

X

X

X

X

X

X

X

X Y

X Y

X

X Y

X Y

X Y

X

X Y

X Y

X

X Y

X Y

X

X Y

X Y

X

X Y

X Y

X

X Y

X Y

X Y

X

X Y

X

X

X Y

X

X

X Y

Y

Y

X

X

Y

Y

X Y

X Y

Y

Y

X

X

Y

Y

X

X

Y

Y

FLOAT or REAL

X

CHAR

GRAPHIC

XY

X Y

X

VARGRAPHIC

XY

X Y

X

572 User Guide

X Y

X Y

X

Y

LONG VARCHAR

XY

X

X Y

V. G .

R O W ID

C| L O B

X

X Y

G R A P H

D B C L O B

B L O B

X

X

X

VARCHAR

T I M ES T A M P

T I M E

X

DECIMAL

L O N G V. G.

D AT E

X

INTEGER

L O N G V. C.

V. C.

D E C.

SMALL INTEGER

F L T. or R E A L

C H A R

I N T .

Table Alter

S M A L L I N T .

I N T .

F L T. or R E A L

D E C.

C H A R

V. C.

L O N G V. C.

LONG VARGRAPHIC

G R A P H

V. G .

X

X Y

L O N G V. G.

D AT E

T I M E

T I M ES T A M P

B L O B

C| L O B

D B C L O B

R O W ID

X

Y

DATE EXTERNAL

X

X

X Y

X Y

X

TIME EXTERNAL

X

X

X

X Y

X

X Y

X X Y

X

X

XY

Y TIMESTA MP EXTERNAL

X Y

X Y

X

BLOB

X Y

X Y

X

X Y

X Y

X Y

CLOB

X Y

X Y

X

X Y

X Y

X Y

DBCLOB

X

X

ROWID

X Y

X Y

X

X Y

If you change an existing column to a BLOB, CLOB, or DBCLOB or add a new LOB column to a table, you must also create the following supporting DB2 objects for each new LOB column that you create in your table: ■

LOB table space



Auxiliary table



Index on the auxiliary table

Chapter 20: Table 573

Table Alter

When a change is made from a CHAR, VARCHAR, or LONG VARCHAR column to a DATE, TIME, or TIMESTAMP data type, an edit mask must be entered that defines the data format within the character column. A Mask Specification screen automatically appears when one of these data type changes is entered. In the Mask field, enter a mask to describe the format of the TIME within the old, non-TIME type column. This mask is used to reformat the data to meet TIME column data restrictions. Use any of the following masks for data conversion: ■

Date Formats: (CC)YYDDMM (CC)YY.MM.DD (CC)YYDDD (CC)YYWWD (CC)YY.DDD (CC)YY.WW.D MMDD(CC)YY MM.DD.(CC)YY DDMM(CC)YY DD.MM.(CC)YY

where CC equals century, YY equals year, MM equals month, WW equals week, and DD equals day. ■

Time formats: HHMMSS HH.MM.SS HHMM HH.MM HHMM AM HH.MM.AM

where HH equals hours, MM equals minutes, SS equals seconds, and AM equals am or pm. ■

Timestamp formats: (CC)YYMMDDHHMMSS (CC).YY.MM.DD.HH.MM.SS (CC)YYMMDDHHMMSSNNNNNN (CC).YY.MM.DD.HH.MM.SS.NNNNNN

where NNNNN equals nano-seconds. Note: The century is optional in dates and timestamps. The period (.) can be replaced by the forward slash (/), colon (:), or dash (-) as valid delimiters.

574 User Guide

Table-Controlled Partitioning

To view the current edit mask for a column, enter the E (explode) line command next to the column name. The current mask for the column displays next to the TYPE prompt. More information: Column Explode Detail (E) (see page 565)

Changing the Table Type To alter one type of table into another type of table, do one of the following: ■

Template the original table and create a new table using a different name with the desired table type option.



Drop the original table and re-create it using the same name with the Table Type option setting you want.

Note: You cannot change an existing table to or from an auxiliary table.

Drop Considerations When a table is dropped in DB2, its data, dependents, and authorizations are also dropped. If the table has any referential integrity rules, all dependent tables' referential integrity rules are also removed (but not the tables). Under the rules of DB2, a table cannot be dropped if it is defined in a partitioned tablespace. However, CA RC/Migrator automatically drops the partitioned tablespace necessary for the table DROP and then drop the table. A table cannot be dropped while a DB2 utility has control of the table's tablespace.

Table-Controlled Partitioning Table-controlled partitioning (TCP) lets you control partition boundaries for a table using values defined in the CREATE TABLE statement. This contrasts with index-controlled partitioning (ICP), where partition boundaries are controlled by CREATE INDEX statement values. TCP is more flexible than ICP. With TCP, you can create more than one partitioned index in a tablespace, and a partitioning and clustering index are not required. Note: For a complete discussion of TCP, including the differences between TCP and ICP, see the IBM DB2 Universal Database for z/OS Administration Guide.

Chapter 20: Table 575

Table-Controlled Partitioning

When creating, altering, or templating a table, you can manage its TCP as follows: ■

Convert a table using ICP to use TCP.



Convert a table using TCP to use ICP.



Manage partitioning key columns.



Manage partitions and their limit values.



Manage relationships between partition limit values.

Furthermore, if your table uses ICP, you can effortlessly have DDL automatically generated for you so that DB2 will implicitly convert your table so that it uses TCP instead of ICP by simply doing any one of the following things from the Table Alter screen (assuming no other changes are included that would require a drop and recreate of the table): ■

Change the Partitioning option from NO to YES.



Enter the KEY command on the primary command line, causing the Table Partitioning Key Col Selection & Maint screen to display, and then enter CANCEL (or END without making any changes to the table's partitioning key.)



Enter the LIMITS command on the primary command line, causing the Table Partitioning & Limit Key Values screen to display, and then enter CANCEL (or END without making changes to the table's partitioning that would cause a reduction in its original count of partitions.)

Migration Strategy Considerations Note the following migration strategy considerations for TCP processing:

576 User Guide



If you migrate a tablespace for a TCP table that has had its partitions rotated, you must also include the table in that migration strategy. If you do not include the table, the tablespace partitions will not be reordered properly.



If a tablespace has been rotated, RC/Merger cannot be used to move or copy the tablespace. Do not perform rotations if you intend to use RC/Merger on the tablespace.

Table-Controlled Partitioning

Alteration Strategy Considerations Note the following alteration strategy considerations for TCP processing: ■

If an alter strategy adds one or more partitions to a table with TCP, the following conditions apply: –

If the tablespace and any type P or D indexes defined on the table are explicitly included in the strategy and the partitions are explicitly added to the tablespace and indexes, the tablespace and indexes are dropped and recreated.



If the tablespace and any type P or D indexes defined on the table are not explicitly included in the strategy, the partitions are added to the tablespace and indexes (using the attributes from the last logical partition). If an ALTER TABLE ADD PARTITION statement is generated, DB2 adds the partitions. If the table is dropped and recreated, CA RC/Migrator adds the partitions.

If the tablespace and any partitioned indexes are included in the strategy, you do not need to explicitly add the partitions to these objects. ■

If the ROTATE command is issued against a table with referential integrity and the table has DELETE RESTRICT applied, an ALTER ROTATE PARTITION FIRST TO LAST statement is generated. If the child table contains data when the statement is executed, an SQL-538 occurs. You must delete the data from the child table before executing the DDL.

Comparison Strategy Considerations Note the following comparison strategy considerations for TCP processing: ■

If you are comparing TCP tables, the source table might have more partitions than the target table. The results are as follows: –

If partitioned indexes are included in the compare, and PARTITIONS RULE for the indexes is Y, the indexes are dropped and recreated.



If the primary object type is tablespace or database, and PARTITIONS RULE for tablespaces is Y, the tablespace is dropped and recreated.

Use a compare ruleset that specifies N for the PARTITIONS RULE. Specifying N for the PARTITIONS RULE prevents the tablespace and partitioned indexes from being dropped and recreated and allows an ALTER TABLE ADD PARTITION statement to be generated (which implicitly adds a partition to the tablespace and/or partitioned indexes). ■

ALTER TABLE ROTATE PARTITION FIRST TO LAST statements are not generated during compare processing. Instead, table partitions are mapped by logical partition and the ALTER TABLE ALTER PARTITION statements are generated for differences in ending values.

Chapter 20: Table 577

Table-Controlled Partitioning



If a comparison strategy has imported target DDL that references a table that does not specify TCP, the following processing occurs: –

Index information is not imported.



The source table specifies TCP.



The target table is assumed to not be ICP.



An ALTER TABLE ADD PARTITION BY statement is generated. However, the table is an ICP table and the ALTER statement fails.

To convert from ICP to TCP in this situation, include the index in the imported target DDL. ■



If a type P or D index is imported during compare processing but the table it references is not imported, the following processing occurs: –

The number of partitions and the index type cannot be determined.



The compare report shows only partition information that was specified in the imported DDL.



If the referenced table is not imported for both the target and the source index, the resulting DDL can specify to drop and recreate the index.



The ALTER PARTITION statements cannot be generated because the number of partitions is unknown.

When importing DDL for compare processing, consider the following scenarios: –

The DDL contains a CREATE TABLE statement that does not specify partition information, a CREATE INDEX statement that defines a type 2 partitioning index, and a second CREATE INDEX statement that defines another partitioned index. For this type of DDL, executing the first CREATE INDEX statement results in ICP. Executing the second CREATE INDEX statement results in conversion to TCP. The first index is converted to a type P index and the second index is a type P or type D (DPSI) index.



The DDL contains a CREATE TABLE statement that does not specify partition information and a CREATE INDEX statement that specifies NOT CLUSTER and limit key values. For this type of DDL, when the CREATE INDEX statement is executed, the table is converted to TCP.

578 User Guide

Table-Controlled Partitioning

In these scenarios, the partition ending (limit key) values are associated with the table even though, in the imported DDL, the limit key values were specified on the index. If the DDL is compared with another set of objects representing TCP, the limit key values are only considered at the table level. To compare the limit key values, the tables must be included in the compare. A compare with a primary object type of index will never generate ALTER TABLE statements. ■

Imported DDL containing ALTER statements that result in a conversion from ICP to TCP when executed is not supported.

REORG Utility Restrictions If the REORG utility is launched for a table with TCP that has been rotated, a full tablespace reorg is performed (not a partition-level reorg).

Convert from ICP to TCP Although there are several methods that can be used to indicate that you want a table to be implicitly converted by DB2 to use TCP instead of ICP, this is the simplest direct method recommended that uses the Table Alter screens: To convert from ICP to TCP 1.

Go to the Table Alter screen, specifying the table that you want to convert. Note: See Accessing Table Functions if unsure of how to get to this screen.

2.

Verify that the Partitioning option is NO. Note: If the Partitioning option is YES, your table is already using TCP and the remainder of this procedure will not work.

3.

Make sure that the TS Parts field displayed to the right of the Partitioning option on the Table Alter screen displays an integer value indicating the number of partitions that are defined for the table's tablespace. Note: If the TS Parts field displays Unkn or NONE, your table does not reside in a partitioned tablespace and the remainder of this procedure will not work.

4.

Change the Partitioning option on the Table Alter screen from NO to YES and press Enter. Note: The message RO435W Your table will be converted to use TCP instead of ICP should display. If a different message displays, press HELP to get a detailed explanation as to the possible problems and correct. The PS column in the Table Column List will display the Partitioning Sequence of each column that will be a member of your table's partitioning key (derived from the table's clustering index key.)

Chapter 20: Table 579

Table-Controlled Partitioning

5.

Verify that the Operation Mode in the upper right portion of the screen is set to O, and enter END. The RC/Update Alter Confirmation screen should display, showing the generated ALTER TABLE statement(s) that will implicitly convert your table to use TCP.

6.

Press the Enter key to continue and to have the generated DDL executed online by the Batch Processor. (Depending on profile settings for your product, you may be presented with a DDL Execution Confirmation pop-up window. If this happens, respond with Y to execute the DDL.)

Convert a TCP Table to Use ICP Because DB2 provides no mechanism to cause an implicit conversion of an existing table from TCP to ICP, this procedure will generate DDL that will cause the table and its indexes to be dropped and then recreated: Important: The table must have a clustering partitioned index defined because this clustering partitioned index is re-used for the clustering index when the table is re-created. See Considerations when Converting a Table Object from TCP to ICP. To convert a TCP Table to Use ICP 1.

Go to the Table Alter screen, specifying the table that you want to convert. Note: See Accessing Table Functions if unsure of how to get to this screen.

2.

Verify that the Partitioning option is YES. Note: If the Partitioning option is NO, your table is not using TCP and the remainder of this procedure will not work.

3.

Change the Partitioning option on the Table Alter screen from YES to NO and press Enter. The PS column in the Table Column List will display blanks for each column that was previously shown as being a member of the table's partitioning key.

4.

Enter END. Regardless of the Operation Mode setting in the upper right portion of the screen, the RC/Update Alteration Analysis screen will display.

580 User Guide

Table-Controlled Partitioning

5.

Specify analysis options as needed, and press Enter. The DDL is generated and written to the output data set.

6.

Review the generated DDL, and execute the DDL using the Batch Processor. Note: If the generated DDL contains utility statements, such as UNLOAD and LOAD statements, it cannot be executed online and must be executed through a batch job.

Considerations when Converting a Table Object from TCP to ICP Changing the Partitioning option from YES to NO causes an implicit delete of all of your table's partitioning key columns and limit values; and, depending on the index objects originally defined for your table, it will (or may not) be converted to use ICP according to these following rules and processes: ■

An automatic complete conversion of your table from TCP to ICP, complete with a type-2 clustering index defined for the table, does NOT occur if your table does not have a type-P clustering index defined; in which case, the generate DDL will drop the table's tablespace and then recreate the table and its partitioned tablespace, only; no partitioned clustering index will be created and your table will have neither TCP nor ICP after executing the generated DDL.



If, however, your table was originally defined as using TCP and also has a type-P clustering index defined, the generated DDL will drop the table's tablespace and then recreate the partitioned tablespace, the table, and also redefine the type-P clustering index as a type-2 clustering index using the table's original partitioning information for the redefined index's key and limit values.

Important: If the type-P clustering index's key is a superset of the table's partitioning key, the extra key columns are included in the re-definition of the index from a type-P to a type-2, but with no limit values for the extra columns in the generated DDL. Notwithstanding the above considerations, if there are other additional type-P and/or type-D indexes on the table, DDL will be generated for recreating all these other index objects; however, the DDL for these other index objects will not be able to be successfully executed and the objects recreated because the partitioning information, keys and limit values for the table will have been lost because the table, after being re-created using the generated DDL, will no longer be using TCP.

Chapter 20: Table 581

Table-Controlled Partitioning

Additionally, when the table's partitioning key information is implicitly deleted by this method, subsequently changing the Partitioning option back to YES within the same Table Alter session will not cause the deleted information to be automatically reinstated. Instead, the Table Partitioning Key Col Selection & Maint screen automatically displays so that you can specify new key columns. If you want to reinstate the original partitioning information for the table without canceling and starting over again, use the RESET command on the Table Alter screen. This will reset the table object back to its original definition.

Manage Key Columns for a TCP Table You manage your table's partitioning key columns using the Table Partitioning Key Col Selection & Maint screen. This screen helps facilitate the selecting and arranging of your table's partitioning key columns. From this screen, you can: ■

Select columns to include in your table's partitioning key.



Move and re-arrange columns in the key.



Delete columns from the key.



Specify each key column's order as ascending or descending.

To access the Table Partitioning Key Col Selection & Maint screen, enter the KEY command on the Table Create, Table Template, or Table Alter screen. Note: If the table is using ICP, the table will be converted to use TCP, deriving its partitioning key columns and limit values from the table's clustering index. If the table's tablespace is not defined, or it is not defined as partitioned, you must first specify YES in the Partitioning field on the Table Create, Alter, or Template screen before entering the KEY command. This screen contains two dynamic areas that are scrollable UP and DOWN. The top list (Column Name Selection) contains all of the columns belonging to the table object that have not yet been selected for the key and that are also eligible for selection. The bottom list (Table Partitioning Key) displays the columns that compose your key.

582 User Guide

Table-Controlled Partitioning

To manage key columns for a TCP table 1.

Enter S in the Column Name Selection list next to each column to be included in your table's partitioning key, and press Enter. Note: You can select a block of lines at one time, using the Snn command (where nn specifies the desired number of columns) or a pair of SS commands. For more information, see the online Help. If no key columns were previously defined and the list at the bottom of the screen was empty, the columns you selected will have been automatically inserted; otherwise, a message will display indicating that your selection(s) are pending.

2.

Specify the appropriate insertion point in the Table Partitioning Key area as follows, and press Enter: ■

Specify A on a line after which you want the columns to be inserted.



Specify B on a line before which you want the columns to be inserted.



Columns are inserted according to your specification.

Note: The default ORDER for selected columns is always ASC (ascending.) If you want the column to be defined as descending, enter DESC in its ORDER field. 3.

(Optional) After you have selected all of the columns for your key, modify the arrangement of your key columns or delete unwanted key columns from the second list using the M (Move) and D (Delete) line commands. The line commands that are available for use in the second list are: A, B, Dnn, Mnn, Snn, DD, MM, and SS. For more information, see online help.

4.

Press the END key to process your work. The changes to the key columns are saved, and the screen from which you came is displayed again.

You can enter the L command on the primary command line to choose the display properties of the Column Name Selection List. By default, the Column Name Selection list displays only the columns that are eligible to be selected as key columns for your index. Entering L toggles the Column Selection List display mode so that ineligible columns (although not selectable) as well as columns that are already part of the key are displayed. For more information, see online help. You can use the HEADER command to toggle the header portions of both lists ON and OFF to provide additional space on the screen for both lists. Setting the Hide option, located in the upper right corner of the Column Name Selection List, to Y will hide the Column Name Selection List to provide the most space on the screen for the Table Partitioning Key List, making it easier to manage larger and more complex compound keys.

Chapter 20: Table 583

Table-Controlled Partitioning

Modify the Partitions and Limit Key Values of a TCP Table You manage your table's partitions and limit values using the Table Partitioning & Limit Key Values screen. This screen allows you to individually manage all of your table's partitions and limit values using one convenient scrollable list. From this screen, you can: ■

Copy, repeat and exchange limit values amongst partitions.



Add, copy, move, repeat, delete, and rotate partitions.



Compare any partition and limit value changes with the original partition organization and limit value settings.

To access the Table Partitioning & Limit Key Values screen, enter the LIMITS command on the Table Create, Table Template, or Table Alter screen. Note: If the table is using ICP, the table will be converted to use TCP, deriving its partitioning key columns and limit values from the table's clustering index. If the table is not using ICP, it must have a defined partitioning key before the LIMITS command is allowed. For more information, see Manage Key Columns for a TCP Table. The limit values for each column in the partitioning key are arranged horizontally across the screen. The partitions are arranged vertically, with one row for each partition in your table. You can scroll up and down through the partitions. If all columns in your table's partitioning key do not fit on the screen at one time, you may scroll the display left and right to see the other key columns. To modify the partitions and limit key values of a TCP table 1.

Modify the partitions and limit values as needed, and press Enter. You can directly enter limit values into any column for any partition on the screen. You can also use commands to facilitate the setting, moving, repeating, and clearing of values and partitions, depending on the maintenance mode to which the screen is set. For a complete list of line commands and primary commands that you can use to modify partitions and limit values, see the online help. Note: If you want to discard all changes that you made up to the point of the last explicit or implicit save, enter RESTORE. (For more information about the SAVE and RESTORE commands, see the online help.) If you want to undo changes that you made to a partition or limit key, enter the U (undo) command beside the partition. All unprotected limit values are reset to their original value. When COMPARE is ON, you can also recover a partition that was deleted. (See the online help for more information about how to protect and unprotect columns using the PRO (protect) and UNP (unprotect) commands.)

584 User Guide

Table-Controlled Partitioning

2.

When you are done making changes, enter END. Your changes are implicitly saved and you are returned to Table Create, Alter, or Template screen. Note: If you make changes that you do not want to save, enter CANCEL instead. All of your changes, up to the point of the last implicit or explicit save, will be discarded, and you will be returned to the previous screen.

Rotate Partitions If you want to logically rotate the first partition so that it is the last partition, you can use the ROTATE command. Note: The ROTATE command is not permitted when creating or templating a table or when the table's tablespace was not originally partitioned. To rotate partitions 1.

Enter ROTATE in the command line. The first partition is logically rotated to be the last partition and is redisplayed with its limit values set to blanks.

2.

Enter, at minimum, a limit value for the rotated partition's first key column. Note: If partition values are ascending, the new partitioning key for the rotated partition must be higher than the current high key limit. If partition values are descending, the new partitioning key must be lower than the current low key limit.

Change Maintenance Modes when Modifying Partitions and Limit Key Values While modifying partitions and limit key values, you might need to change maintenance modes, depending on the modifications you want to make. For example, you might want to permit limit value changes but prevent modifications to partitions. You can use any of the following modes when modifying partitions and limit key values: MAXVALUES Allows you to directly manage MAXVALUE and MINVALUE settings, only, for any key column in any partition without having to use commands. Note: With the exception of the ROTATE command, you cannot manipulate partitions in this mode.

Chapter 20: Table 585

Auxiliary Tables

PARTITIONS Allows you to manage partitions (such as adding, copying, moving, repeating, deleting, and rotating partitions) in addition to managing their limit values. VALUES ONLY Allows you to manipulate limit values for partitions (such as setting, clearing, repeating, copying, re-arranging, or exchanging limit values between partitions) independent of the logical arrangement or ordering of the partitions. Note: With the exception of the ROTATE command, you cannot manipulate partitions in this mode. To change the maintenance mode, enter P (for PARTITIONS mode), V (for VALUES ONLY mode), or M (for MAXVALUES mode) in the command line. The initial maintenance mode that is used when the Table Partitioning & Limit Key Values screen displays is PARTITIONS. Note: To change the default mode to VALUES ONLY, enter SAVESETTINGS in the command line when in VALUES ONLY mode. The next time the screen is displayed, it will initially display in VALUES ONLY mode. Only PARTITIONS and VALUES ONLY may be saved as default modes. It is not allowed for MAXVALUES mode.

Auxiliary Tables An auxiliary table is a table used to store LOB data for a LOB column belonging to a regular (base) table. The Auxiliary Table screens let you alter, create and template DB2 auxiliary tables. These screens appear when you specify A (auxiliary) in the Table Type field on the Table Create, Alter, or Template screens. The Aux Table screens let you alter, create, and template DB2 auxiliary tables. As with regular tables, you can: ■

Enter selection criteria to bring up lists of objects to choose from.



Apply user defaults to the table definition using the Apply Def command.



Display the original and current definitions of an object using the COMPARE command.

Note: See the previous sections of this chapter for more information about these functions.

586 User Guide

Auxiliary Tables

In addition, you can display a list of LOB columns in the base table, by specifying selection criteria in the Base Table field. From this list, you can select the LOB column for your table. When altering a table object of any type, you cannot switch from an auxiliary table to a standard table and vice-versa. However, you can change the type on a create or template. Note: For auxiliary tables, you must specify a LOB tablespace that resides in the same database as that of the base table in the Tablespace field. The Base Table, Creator, Column Name, and Part fields are unique to auxiliary tables and contain the LOB column information for the auxiliary table as follows: Base Table Indicates the name of the table that contains the LOB column for the auxiliary table. To select from a list, enter selection criteria. Creator Identifies the creator of the base table that contains the LOB column for the auxiliary table. Column Name Specifies the name of the LOB column in the base table for which the auxiliary table is to store LOB data. Part Specifies the partition of the base table for which the auxiliary table is to store the specified column's LOB data. TS Parts Indicates whether the tablespace is partitioned. A value is required when the tablespace is partitioned. Do not specify a partition when the tablespace is not partitioned. This field is optional when the specified base table or its tablespace is not found. Do not specify a partition number for an auxiliary table that already exists for the same partition, base table and LOB column. Note: For more information about these fields, see the online help.

Chapter 20: Table 587

Identity Columns

Identity Columns An identity column is any column that is defined with a data type of DECIMAL, INTEGER, or SMALLINT, or is a UDT column that is sourced on any of these types and whose column default indicator on the table is set to A or D. See the IBM SQL Reference or Administrator Guide for more information about identity columns. Note: Identity columns are supported only on DB2 V6.1 and above.

Create Identity Columns You can create identity columns from the Table Create screen. To create an identity column 1.

Insert a new column with a type of SMALLINT, INTEGER, or DECIMAL, and press Enter.

2.

Change the default indicator attribute to an A or D, and press Enter to create the identity column. ■

A—Generated Always as Identity



D—Generated by Default as Indentity

Note: You can also create an identity column from the Table Alter or Table Template screens.

Using the Value Command You can use the V (Value) command to view or update identity column attributes. The Value command lets you: ■

Specify a default value for a newly inserted column of an existing table.



Cast a default for a column, thus causing the DEFAULT WITH clause to be inserted into your DDL (when the column's default option is C,)



Specify the identity column attributes when the column's data type is DECIMAL, INTEGER, or SMALLINT, and the default option is A or D.

When you enter the Value command, one of the following screens appears where you can specify:

588 User Guide



Default values for old or new columns



Attributes for an identity column

Identity Columns

For non-identity columns, a maximum of 254 characters can be specified, depending on the data type. When the default indicator for the column is: ■

Y, N, or space—The column must be a newly inserted column, in which case, the default value is used only when the table is unloaded.



C—The column could be old or new, in which case the default value is used internally by DB2 for all new rows inserted and old rows updated.

View or Update Identity Column Attributes To view or update identity column attributes 1.

From the Table Create, Table Alter, or Table Template screens, enter V in the Cmd field next to an identity column, and press Enter. The Identity Column Value Specification screen appears. Note: Minvalue, Maxvalue, and Cycle are supported only on DB2 V7.1 and above.

2.

To specify the starting value of the identity column, enter a value in the Start With field. This can be any positive or negative value, including zero, which could be assigned to the column, based on its data type. The default is the value specified in the Minvalue field for an ascending sequence or the value specified in the Maxvalue field for a descending sequence. See Determining the Default Value for more information about the default value. Valid data types are: ■

DECIMAL—Any positive or negative value within the scope of the decimal number's defined precision that does not contain non-zero digits to the right of the decimal point. For example, if the precision is 6, the smallest value would be -999999 and the largest value would be 999999.



INTEGER—The smallest value would be -2147483648, and the largest value would be 2147483647.



SMALLINT—The smallest value would be -32768, and the largest value would be 32767.

Note: Start With is not necessarily the value that a sequence would cycle to after reaching the minimum or maximum value of the sequence. Start With can be used to start a sequence outside the range that is used for cycles. The range used for cycles is defined by the Minvalue and Maxvalue fields.

Chapter 20: Table 589

Identity Columns

3.

To specify the interval between consecutive values of the identity column, enter a value in the Increment By field. The value can be any positive or negative value that is not zero, and does not exceed the value of a: ■

Small integer constant for an identity column whose data type is SMALLINT



Large integer constant for an identity column whose data type is DECIMAL or INTEGER.

The default is 1. Valid data types are: ■

DECIMAL—Any positive or negative value that is not zero, does not exceed the value of a large integer constant, and that does not contain non-zero digits to the right of the decimal point. For example, if the precision is 15, the smallest value would be -2147483648 and the largest value would be 2147483647.



INTEGER—The smallest value would be -2147483648, and the largest value would be 2147483647.



SMALLINT—The smallest value would be -32768, and the largest value would be 32767.

Note: If the value is positive, the sequence of values for the identity column ascends. If the value is negative, the sequence of values descends. 4.

5.

590 User Guide

To keep some preallocated values in memory and improve performance when inserting rows into a table, specify a value in the Cache field. The value can be from 2 up to the largest value that can be represented by a large integer constant, or the string NO, as the following describes. The default is 20. ■

integer—Specifies the number of values of the identity column sequence that DB2 is to preallocate and keep in memory. During a system failure, all cached identity column values that are yet to be assigned are lost, and thus, will never be used. Therefore, this integer value also represents the maximum number of values for the identity column that could be lost during a system failure.



NO—Specifies that values for the identity column are not preallocated. In a data sharing environment, use NO to guarantee that identity values are generated in the order in which they are requested.

To specify the minimum value that is generated for the identity column, enter a value in the Minvalue field. This value can be any positive or negative value, including zero, which could be assigned to the column based on its data type, and must also be less than the value specified in the Maxvalue field.

Identity Columns

If this field is blank, the default for an ascending sequence is the value specified in the Start With field, or 1 if the Start With value is also blank. For a descending sequence, the default is the minimum value of the data type. See Determining the Default Value for more information about the default value. See step 2 for information about valid data types. Note: This field applies to DB2 V7.1 and above only. 6.

To specify the maximum value that is generated for the identity column, enter a value in the Maxvalue field. This value can be any positive or negative value, including zero, which could be assigned to the column based on its data type, and must also be greater than the value specified in the Minvalue field. If this field is blank, the default for an ascending sequence is the maximum value of the data type. For a descending sequence, the default is the value specified in the Start With field, or -1 if the Start With value is also blank. See Determining the Default Value for more information about the default value. See step 2 for information about valid data types. Note: This field applies to DB2 V7.1 and above only.

7.

To indicate whether the identity column should continue to generate values after reaching the minimum or maximum value (determined by the Minvalue and Maxvalue fields) of the sequence, enter a value in the Cycle field. Valid values are as follows: ■

YES—Specifies that values continue to be generated for the column after the minimum or maximum value has been reached. After an ascending sequence reaches the maximum, it generates its minimum value. After a descending sequence reaches its minimum, it generates its maximum value. The minimum and maximum values (specified in the Minvalue and Maxvalue fields) determine the range of the cycle.



NO—Specifies that values will not be generated for the identity column once the minimum or maximum value for the sequence has been reached. This is the default.

Note: This field applies to DB2 V7.1 and above only. 8.

When you have finished entering data, press Enter to save your changes.

Chapter 20: Table 591

Identity Columns

Determining the Default Value When the Start With, Minvalue, or Maxvalue fields are blanked out on the Identity Column Value Specifications screen at the time that Enter, End, or PF3 is pressed, a default value is automatically determined and substituted in place of the blanks. The default values that would otherwise be determined by DB2 at the time the DDL is executed are instead determined for you and displayed on the screen in place of the blanks so you can see what these values will be before strategy analysis and the generation of your DDL. See Viewing or Updating Identity Columns Attributes for more information about the Identity Column Value Specifications screen. To determine the default value, the following processing occurs: ■

The Increment By field is inspected first. If this field is blank, or contains any valid positive number for the data type, the sequence is assumed to be ascending; otherwise, it is descending.



When the Start With field is blanks:









For an ascending sequence, the Minvalue field value is substituted in place of the blanks. However, if Minvalue is also blank, 1 is used.



For a descending sequence, the Maxvalue field value is used. However, if Maxvalue is also blank, the maximum value of the data type (and precision, if DECIMAL) is used.

When the Minvalue field is blanks: –

For an ascending sequence, the Start With field value is substituted in place of the blanks. However, if Start With is also blank, 1 is used.



For a descending sequence, the minimum value of the data type (and precision, if DECIMAL) is used.

When the Maxvalue field is blanks: –

For an ascending sequence, the maximum value of the data type (and precision, if DECIMAL) is used.



For a descending sequence, the Start With field value is used. However, if Start With is also blank, -1 is used.

All fields are defaulted on newly inserted or defined identity columns.

For additional information concerning the determination of default values for identity column attributes, see the IBM DB2 SQL Reference Guide. Note: MINVALUE, MAXVALUE, and CYCLE are supported only on DB2 V7.1 and above. Depending on the product you are using, these values might not be available.

592 User Guide

Materialized Query Tables (MQTs)

Restart of Identity Column Numbering after a Table Reload When a table with an identity column is dropped and re-created during a comparison, the original table definition remains intact (including the original starting value for the column). However, this process might lead to duplicate rows when additional rows need to be inserted. To avoid potential conflicts with duplicate identity column rows, you can do the following: ■

Install the Table Process Exit (RMRTPE) stored procedure. RMRTPE allows the resetting of identity column sequences for tables involved in a comparison strategy.



Add new entries to Model Services to ensure that after a table is dropped, recreated, and reloaded, any inserted identity columns begin from the highest value that existed before the table was dropped.

Any sequences that are created during this process are automatically dropped by CA RC/Migrator processing after the new starting value is obtained. Note: Instructions for installing RMRTPE and making the model entries are available as a product-specific customization task in the post-installation process. For information about how to perform post-installation processing, see the CA Database Management Solutions for DB2 for z/OS Implementation Guide.

Materialized Query Tables (MQTs) A materialized query table (MQT) contains data that is derived from one or more source tables specified by a fullselect. A source table is a base table, view, table expression, or user-defined table function. Note: A unique index cannot be created on an MQT. MQTs can contain frequently requested information. MQTs are often used in data warehousing applications to improve SQL efficiency. However, keep the following points in mind: ■

To ensure that data is current, MQTs must be periodically refreshed (which can be expensive).



MQTs use storage.

Chapter 20: Table 593

Materialized Query Tables (MQTs)

MQT Restrictions When you are using MQTs with CA RC/Migrator and CA RC/Compare, several restrictions apply, including the following: ■

Restriction regarding FULLTREE setting in the MIGRATOR parmlib member (see page 594)



Restrictions regarding imported DDL that manipulates a table or MQT (see page 594)



Restrictions regarding converting a table to an MQT (see page 595)



Restrictions for an MQT with altered column definitions of a result set (see page 596)



Restriction when globally changing table column names (see page 596)

Restriction Regarding FULLTREE Setting in the MIGRATOR Parmlib Member The MIGRATOR parmlib member contains the option FULLTREE(NO|YES). When FULLTREE(NO) is in effect, the object tree that is built is limited to only the databases that are involved in the strategy. The limited tree processing in CA RC/Migrator and CA RC/Compare does not support MQTs. The MIGRATOR parmlib member must specify FULLTREE(YES).

Restrictions Regarding Imported DDL That Manipulates a Table or MQT If a CA RC/Compare strategy imports DDL that creates an MQT, converts a table to an MQT, or creates a table using the “CREATE TABLE AS fullselect WITH NO DATA” syntax, strategy analysis can result in the following situations: ■

The limit key values for a table-controlled partitioning (TCP) MQT might not be formatted properly in the generated DDL. To correct this, you can manually edit the limit key values in the generated DDL.



Unload and Load utility control statements for data conversions might be generated incorrectly when an existing table or MQT is dropped and recreated as a user-maintained MQT. This can occur when the source is imported DDL, the target is a DB2 subsystem, and the column definitions between the old and new object change. To avoid this issue, use the MQT REFRESH analysis option instead of the Data Unload analysis options. This will cause a REFRESH TABLE DDL statement to be generated instead of the Unload and Load utility statements.

594 User Guide

Materialized Query Tables (MQTs)

Restrictions Regarding Converting a Table to an MQT In a CA RC/Migrator or CA RC/Compare strategy, if a table was converted to an MQT, and the result set for the MQT fullselect does not match the table’s column definitions, strategy analysis can produce certain situations as follows: ■

When DDL is generated to drop a table and create an MQT, the following issues might occur: –

The limit key values for a TCP MQT might not be formatted properly in the generated DDL. You can manually edit the limit key values in the generated DDL to properly format them.



The Unload and Load utility control statements for data conversions might be generated incorrectly when the MQT is created as usermaintained, causing the data conversion to fail. To avoid this, use the MQT REFRESH analysis option instead of the Data Unload analysis options. This will cause a REFRESH TABLE DDL statement to be generated instead of the Unload and Load utility statements.

Two additional workarounds are available as follows: ■





Do one of the following: –

Alter the table’s column definitions to match the MQT fullselect result set before changing the Table Type to MQT.



Enter a MQT fullselect whose result set will match the table’s current/altered column definitions.

Use two strategies. In the first strategy, alter the table’s column definitions and execute the generated script. Then create the second strategy to convert the table to an MQT.

When an ALTER table DDL statement is generated (to convert a table to an MQT), and the column definitions of the table do not match the MQT’s fullselect result set, execution of the generated statement will fail. To avoid this, force a drop/create of the table by performing one of the following: –

Supply the optional column name list followed by the AS keyword in the materialized query definition.



Alter the table’s column definitions to match the MQT fullselect result set before changing the Table Type to MQT.

CA RC/Migrator and CA RC/Compare will generate a DROP of the table and a CREATE for the MQT.

Chapter 20: Table 595

Materialized Query Tables (MQTs)

Restrictions for an MQT with Altered Column Definitions of a Result Set In a CA RC/Migrator or CA RC/Compare strategy, if you edit an MQT and change the fullselect so that the column definitions of the derived result set are changed, strategy analysis will result in a DROP/CREATE of the MQT, resulting in the following situations: ■

The limit key values for a TCP MQT might not be formatted properly in the generated DDL. You can manually edit the limit key values in the generated DDL to properly format them.



The Unload and Load utility control statements for data conversions might be generated incorrectly when the MQT is created as user-maintained, causing the data conversion to fail. To avoid this, use the MQT REFRESH analysis option instead of the Data Unload analysis options. This will cause a REFRESH TABLE DDL statement to be generated instead of the Unload and Load utility statements.



Column name changes in the fullselect result set will not be propagated to dependent objects (for example, views and indexes). To avoid this, complete the steps of the following alternate method regarding the MQT’s Table Type.

As an alternate method for preventing the problem, when editing the MQT, you can do the following: 1.

Change the MQT’s Table Type to Regular.

2.

Alter the column definitions.

3.

Change the Table Type back to MQT.

4.

Modify the fullselect to match the altered column definitions.

Restriction when Globally Changing Table Column Names Globally changing a table’s column names can cause the column list to be out of sync with the fullselect result set when converting a table to an MQT. In this situation, we recommend that global changes of column names not be used.

596 User Guide

Materialized Query Tables (MQTs)

Access MQT Functions from a Migration Strategy You can access MQT functions from within each strategy type in CA RC/Migrator. The following steps discuss how to access panels on which you can create and manage MQTs as part of a migration strategy. Note: For information about using CA RC/Update to create and manage objects, see the CA RC/Update User Guide. For more information about managing objects in a migration strategy, see the "Migration Strategies" chapter. To access MQT functions from a migration strategy 1.

Enter 1 in the OPTION field on the CA RC/Migrator Main Menu. The Strategy Services panel appears.

2.

Do one of the following: ■

Enter C in the O field and complete the other fields to create a strategy, and then select objects on the Create Migration Strategy and object selection panels.



Enter U in the O field next to an existing strategy.

The Implode/Explode Services panel appears. 3.

Do one of the following: ■

Begin the creation by typing U in the New Objects field and then entering S next to Table on the Object Creation Services panel. Note: Unlike the creation process that occurs in CA RC/Update, an alter panel appears (instead of a create panel).



Begin the alteration by entering E in the S field next to the name of an MQT included in the strategy. Note: Only primary and dependent objects can be altered. Dependent objects are altered by entering S next to an object (under Explode Options on the Implode/Explode Services panel) and then editing the object shown on the dependent object selection panel.



Begin the templating by entering S next to an object (under Explode Options) and then entering T in the S field of the dependent object selection panel next to the name of the MQT. Note: Only dependent objects can be templated.

The appropriate panel appears. When you are finished with your work, you can implement the changes as part of the strategy. Note: Objects cannot be dropped in a migration strategy.

Chapter 20: Table 597

Materialized Query Tables (MQTs)

Access MQT Functions from an Alteration Strategy You can access MQT functions from within each strategy type in CA RC/Migrator. The following steps discuss how to access panels on which you can create and manage MQTs as part of an alteration strategy. Note: For information about using CA RC/Update to create and manage objects, see the CA RC/Update User Guide. For more information about managing objects in an alteration strategy, see the "Alteration Strategies" chapter. To access MQT functions from an alteration strategy 1.

Enter 1 in the OPTION field on the CA RC/Migrator Main Menu. The Strategy Services panel appears.

2.

Do one of the following: ■

Enter C in the O field and complete the other fields to create a strategy.



Enter U in the O field next to an existing strategy.

The Alteration Strategy Services panel appears. 3.

Complete the following fields on the Alteration Strategy Services panel: ■

Type C, A, T, or D in the Option field. Note: If you enter C in the Option field (to create an MQT), an alter panel appears instead of a create panel.



Type T in the Object field.



Specify an MQT name in the Name field.



Specify a creator in the Creator field.

Note: You can specify * for Name and Creator to choose from a selection list. Press Enter. The appropriate panel appears. When you are finished with your work, you can implement the changes as part of the strategy.

598 User Guide

Materialized Query Tables (MQTs)

Access MQT Functions from a Comparison Strategy You can access MQT functions from within each strategy type in CA RC/Migrator. The following steps discuss how to access panels on which you can create and manage MQTs as part of a comparison strategy. Note: For information about using CA RC/Update to create and manage objects, see the CA RC/Update User Guide. For more information about managing objects in a comparison strategy, see the "Compare Strategies" chapter. To access MQT functions from a comparison strategy 1.

Enter 1 in the OPTION field on the CA RC/Migrator Main Menu. The Strategy Services panel appears.

2.

Do one of the following: ■



Enter C in the O field and complete the other fields to create a strategy, which then requires you to: –

Choose a method on the Compare Option Menu.



Complete the Create Compare Strategy panel.



Choose primary objects.

Enter U in the O field next to an existing strategy.

The Compare Explode Services panel appears. 3.

Enter U in the Create/Drop Objects field of the Compare Explode Services panel. The Create/Drop Object Selection panel appears.

4.

Perform one of the following: ■

Begin the creation by typing C in the Option field, typing T in the Object field, and then pressing Enter.



Begin the drop process by typing D in the Option field, typing T in the Object field, and then pressing Enter to display a selection panel, from which you can select the MQT.



Begin the alteration by entering E next to the name of an MQT included in the strategy. Note: You can also make this selection on the Dependent Object Mapping panel.

The appropriate panel appears. When you are finished with your work, you can implement the changes as part of the strategy. Note: Objects cannot be templated in comparison strategies.

Chapter 20: Table 599

Table Check Constraints List Screen

Isolation Level Considerations for MQTs MQT access can be affected by the isolation level that was in effect when the MQT was created. The isolation level controls the type and duration of locks on DB2 objects. When you create an MQT or convert a base table to an MQT, the ISOLATION column in SYSIBM.SYSVIEWS is set to the isolation level being used when the DDL is executed to create the MQT. An MQT is only usable in query rewrite when the isolation level from SYSIBM.SYSVIEWS is equal to or higher than the isolation level of the dynamic query being considered for rewrite. Thus, to ensure successful queries against an MQT, you can use the Batch Processor .ISOLEVEL command to set the isolation level to a higher value. Note: For more information about the .ISOLEVEL command and how the Batch Processor uses the isolation level, see the CA Database Management Solutions for DB2 for z/OS Batch Reference Guide. For general information about isolation levels, see the IBM DB2 SQL Reference guide. During analysis, CA RC/Migrator may determine that an MQT needs to be created or re-created. To ensure that the MQT is usable in query rewrite, CA RC/Migrator inserts an .ISOLEVEL command in the input stream to set the appropriate isolation level. The isolation level will be one of the following values (in descending order): ■

For DDL import, the value specified from an input stream .ISOLEVEL statement



The isolation level specified on the MQT Create or MQT Alter panel



The isolation level from the DB2 catalog for the dropped MQT



The default CA RC/Migrator value for newly created MQTs

Table Check Constraints List Screen The Table Check Constraints List screen is for naming sets of values defining constraints for the table, and is used with the SQL Editor screen. Access this screen by entering U in the Check Const field of the Table Create, Alter, or Template screen. Note: If you are creating, altering, or templating an MQT, and you have specified Initially Deferred in the Data field, the Check Const field is unavailable. DB2 does not support check constraints for MQTs. Initially Deferred is the default value (unless overridden by object definition defaults). The current table name appears in the Check Constraints for Table (display only) field. The constraints appear in the Constraint Name column.

600 User Guide

SQL Editor Screen

To specify the action you want to take for the current line, specify a value in the S column as follows: ■

(blank)—(Default) Create DDL to apply this check constraint to the current table. All check constraints in the list are active if the Check Const field is set to Y on the Table Create, Alter, or Template screen.



C—Create a new check constraint (valid on first line only). When you specify the check constraint name and press Enter, an SQL Editor session is opened where the check constraint text is entered. See SQL Editor Screen for more information.



S—Edit the check constraint. An edit session is opened where the check constraint text is entered.



D—Delete the check constraint. If the constraint already exists for the table, it is dropped when the alteration DDL is generated. If not, it is simply marked as deleted in the display, and no DDL is generated. During the current edit session, a check constraint marked as deleted can be restored using the U command.



U—Undelete a check constraint that was marked with a D. Not valid after exiting the Table Check Constraints List screen.



R—Reset the text for this check constraint to the value on the Table Check Constraints List screen at the beginning of the edit session. Valid only for pre-existing check constraint names.

Creator Displays the creator ID of the check constraint. Constraint Name Name of the constraint, up to 18 characters. Beginning of Constraint Text The first 49 characters of the check constraint. Display only. More Information: SQL Editor Screen (see page 601)

SQL Editor Screen The SQL Editor screen is where you enter and save the DDL to be associated with a check constraint name on the Table Check Constraints List screen. The DDL you enter here is inserted as a CHECK clause to create or alter the table.

Chapter 20: Table 601

Referential Integrity

Enter SQL Editor line commands in the line command area. In the text area enter the DDL to associate with the check constraint name being edited. Press PF3 (End) to save the text and return to the Table Check Constraints List screen. More Information: Table Check Constraints List Screen (see page 600)

Referential Integrity Referential Integrity is the state in which all values of all foreign keys are valid. DB2 helps ensure referential integrity between your tables when you define Referential Constraints. This section describes how to manage referential integrity including Unique Constraints and Referential Constraints using the CA RC/Migrator Table screens.

Referential Integrity Screen Flow The following illustration shows all the table referential integrity screens and how they are invoked:

602 User Guide

Referential Integrity

Referential Integrity Fields on the Table Screens This section describes the fields on the Table Create, Table Alter, and Table Template screens that pertain to referential integrity. Forgn Key Create or update foreign key definitions. Valid values are as follows: ■

N—No foreign key definition exists



Y—A foreign key has been defined. Enter Y to create a foreign key. The Table Referential Constraints screen appears. See Listing Referential Rules for more information.



U—Enter U to update an existing foreign key definition. The Table Referential Constraints screen appears. See Listing Referential Rules for more information.

Note: If you are creating, altering, or templating an MQT, and you have specified Initially Deferred in the Data field, the Forgn Key field is unavailable. An MQT cannot be a parent or child in a referential integrity relationship. Initially Deferred is the default value (unless overridden by object definition defaults). Column CMD Create a primary or foreign key definition on a column by entering a referential integrity line command. Valid values are as follows: ■

Fn—To define a column as part of the foreign key, enter Fn, where n is the number representing the position of the column within the foreign key for a composite key. The Foreign Key Detail screen appears. See Foreign Key specifications for more information.



Pn—To define a column as part of the primary key, enter Pn, where n is the number representing the position of the column within the primary key for a composite key. The PK column is updated to reflect the change. The order of the number is important.

Table Screen Main CMD Enter UC or UniqueConst to invoke the Unique Constraints Management Screen.

Chapter 20: Table 603

Referential Integrity

Table Screen Column Headings The column headings on the Table Screen are as follows: ■

PK—If the column is defined as part of the primary key, the column's key sequence number displays in this field. Enter a new number to update the primary key value.



UK—(Display only) If the column is defined as part of a unique constraint in the Unique Constraint Management Screen, Y displays in this field.



FK—(Display only) If the column is defined as part of a foreign key, Y displays in this field.

Unique Constraints A Unique Constraint is a rule that prevents duplicate values in one or more columns in a table. Unique Constraints are Primary and Unique Keys. Note: An MQT cannot have unique constraints.

Create a Primary Key From a Table screen, enter Pn in the CMD area, where n is the number representing the position of the column within the primary key for a composite key.

Create a Unique Constraint The Unique Constraints Management screens let you create, alter, or delete primary and unique key constraints from a DB2 table. It also lets you insert, rearrange, or delete a DB2 Table's primary key or unique constraint's columns. You access these screens by entering UC or UniqueConst. To create a unique constraint 1.

Insert a line at the CMD line.

2.

Enter a constraint name.

3.

Enter a constraint type. Valid values are as follows:

4.

604 User Guide



U (Unique Key)



P (Primary Key)

Enter S or E at the command line to select the constraint for editing.

Referential Integrity

5.

When you see your constraint name displayed at the top right of the Unique Constraints Management screen, you can begin inserting the columns that you want included in your Constraint. Enter I in the command line to insert columns. Alternatively, enter * (an asterisk) under the Column field to display the list of available columns for selection.

6.

Press PF3 (End) to return to the Create/Alter Table screen. Note: If your table has Unique Constraints, a Y appears on the Table Screen below the UK option for each of the columns that apply.

Update a Unique Constraint Note: This procedure applies to both Primary Keys and Unique Keys. To update a unique constraint 1.

Enter UC or UniqueConst in the command line. The Unique Constraints Management screen appears. This screen displays existing constraints for the table. It also lets you delete or create new unique constraints. See Unique Constraints Management for more information.

2.

Press PF3 (End) to finish the unique constraint definition and return to the Table screen.

Valid Line Commands on the Unique Constraint Management Screen The following list describes the line commands you can use on the Unique Constraint Management screen: ■

Dnn—Delete nn constraints, including this one. If nn is omitted, 1 is assumed.



E—Place display into Edit Mode = COLUMN for this constraint so you can edit the constraint's columns. Press PF3 (End) when you are done and the display automatically returns to Edit Mode = CONSTRAINT.



Inn—Insert nn blank constraints immediately after this constraint. If nn is omitted, 1 is assumed.



Rnn—Repeat this constraint nn times. Creates nn iterations of this constraint and inserts them immediately after this constraint. If nn is omitted, 1 is assumed.



RES—Reset this constraint back to its old definition. When this command is entered for a newly inserted constraint that has no old definition, the constraint is removed. When COMPARE is ON and this command is entered for a newly deleted constraint, the deleted constraint is reinserted into the list.



S—Select this constraint for edit. The S line command behaves the same way as the E line command.

Chapter 20: Table 605

Referential Integrity



SRC—Set this constraint to its Source definition. This command is valid only for CA RC/Migrator Compares.



TRG—Set this constraint to its Target definition. This command is valid only for CA RC/Migrator Compares.



Unn—Undo nn constraints (including this one) and return them to their old definitions. If nn is omitted, 1 is assumed. This command performs the same function as the RES command.



DD—Use paired DD commands to specify a block of constraints to delete.



RR—Use paired RR commands to specify a block of constraints to repeat.



UU—Use paired UU commands to specify a block of constraints to undo.

Referential Constraints A referential constraint is the rule that the non-null values of a foreign key are valid only if they also appear as values of its parent key (Primary or Unique Key). The table that contains the parent key is also called the parent table of the referential constraint, and the table that contains the foreign key is a dependent of that table.

Create a Foreign Key You can create a foreign key. To create a foreign key 1.

Do one of the following from a table screen: ■

Enter Fn in the CMD area, where n is the number that represents the position of the column within the foreign key.



Enter Y in the Foreign Key field, then on the Table Referential Constraints screen, enter C in the option field and enter the relation name, parent table information, and the delete rule. Note: If you are creating, altering, or templating an MQT, and you have specified Initially Deferred in the Data field, the Forgn Key field is unavailable. An MQT cannot be a parent or child in a referential integrity relationship. Initially Deferred is the default value (unless overridden by object definition defaults).

The Foreign Key Detail screen appears. 2.

Enter I to insert a column. The Column Selection screen appears.

3.

Select the columns that form the foreign key, then press PF3 (End). The foreign key definition is finished, and you are returned to the table screen.

606 User Guide

Referential Integrity

Update a Foreign Key You can update a foreign key. To update a foreign key 1.

Enter U in the Foreign Key field on a table screen. Note: If you are creating, altering, or templating an MQT, and you have specified Initially Deferred in the Data field, the Forgn Key field is unavailable. An MQT cannot be a parent or child in a referential integrity relationship. Initially Deferred is the default value (unless overridden by object definition defaults). The Table Referential Constraints screen appears.

2.

Select a rule to be updated. The Foreign Key Detail screen appears.

3.

Move, insert, or delete columns in the foreign key definition, then press PF3 (End). The foreign key definition is completed, and you are returned to the table screen.

Display Referential Rules To display a list of referential rules that have been defined for a table 1.

Enter Y or U in the Foreign Key field of the Table Create, Table Template or Table Alter screen. Note: If you are creating, altering, or templating an MQT, and you have specified Initially Deferred in the Data field, the Forgn Key field is unavailable. An MQT cannot be a parent or child in a referential integrity relationship. Initially Deferred is the default value (unless overridden by object definition defaults). The Table Referential Constraints screen appears, listing the foreign keys by relation rule name that have been defined on the table. The following describes the fields that appear on this screen: Relation Name Specifies the referential rule name. If you are creating a new rule, enter a name (maximum of eight characters) in this field. If no name is entered, a rule name is generated based on the first column in the foreign key. The generated name uses the first character of the first foreign key column, followed by seven random characters (A-Z, 0-9). Parent Table Creator Enter the ID of the parent table's creator. This field accepts SQL selection criteria.

Chapter 20: Table 607

Referential Integrity

Parent Table Name Enter the name of the parent table. This field accepts SQL selection criteria. Note: If selection criteria are entered in the Table Name and Creator fields, a Table Selection screen appears, letting you select from a list. Delete Rule For existing referential rules, the delete rule displays. If creating a new referential rule, enter a delete rule. Choose one of the following Delete Rules: ■

Restrict—If there is data in the child key, the parent key cannot be deleted. This is the default.



Cascade—If the parent is deleted, the child is deleted, regardless of data.



Null—If columns in the child are nullable, then the values are set to null when the parent is deleted.



No Action (Default)—If parent row is deleted, no action is taken in the child.

Column Name For existing relations, the names of the columns used in the key are listed. Column Type For existing relations, the data types of the columns used in the key are listed. 2.

608 User Guide

Enter one of the following commands in the O (Option) column to create, update, or delete a foreign key constraint: ■

C—Create a new foreign key. Valid only on the first line. Information must be entered in the parent table name and creator fields before pressing Enter.



S—Select a foreign key for updating. If you select a foreign key, the Foreign Key Detail screen for that foreign key appears. See Foreign Key Specifications for more information.



D—Delete the foreign key.

Referential Integrity

Foreign Key Specifications You can define foreign key specifications using the Table Foreign Key Detail screen. Columns can be added or deleted, and existing columns can be changed. All fields (with the exception of the CMD field) are protected. The screen contains two scrollable areas. The first scrollable area shows those columns currently contained in the foreign key identified by foreign key # (FK#), column name, coltype, size, null, fldproc, and parent column. Use the PF7 and PF8 keys to scroll this area. For DB2 V6 and above, user-defined distinct types are also supported. The second scrollable area shows index information for the parent table identified by index name, coltype, size, null, fldproc, and primary key. Use the PF10 and PF11 keys to scroll this area. Enter an S next to an index to pair the index columns to the foreign key columns. If there is no column in the foreign key for the pairing, the column is added to both the foreign key and the base table. Any new columns are added to the end of the table. Note: You can change the parent table by entering a new name and creator information in the Parent Table Name and Creator fields. If selection criteria are specified, a table selection screen appears. If a new table is specified, the new column information appears at the bottom of the screen. Tables created in batch mode are considered invalid. Press PF3 (End) to save the foreign key definition and return to the table screen.

Valid Line Commands Modification of the foreign key definition is accomplished using various line commands. In the first scrollable area, the following line commands are valid: ■

# or n—Enter the parent table columns number next to the current table. This changes the columns definition in the table, but does not change the column name. The option makes it easy to help ensure that column definitions in the foreign key match those in the primary key.



I—Insert a column. This displays the Column Selection screen, which lists all columns in the current table.



M or Mnn—Move the column or column block within the foreign key to a location marked by A (AFTER this line) or B (BEFORE this line). The move command only affects the column's position within the foreign key.



D or Dnn—Delete the column or column block from the foreign key.



U or UU—Undelete a column or column block from the table or foreign key.

If multiple commands are entered, all are processed in turn according to the foreign key number order.

Chapter 20: Table 609

Referential Integrity

Foreign Key Column Selection List The Foreign Key Column Selection List displays when you specify I next to a column in the first scrollable area of the Foreign Key Detail screen and press Enter. To select columns to add to the foreign key rule, enter an S or a number in the S (selection) column to denote the column's position in relation to the other selected columns or within the foreign key. Note: LOB and ROWID columns are displayed, but cannot be selected. Once all columns for the key have been selected, press PF3 (End) to save the selections and return to the Foreign Key Detail screen.

610 User Guide

Chapter 21: Indexes This section contains the following topics: Product Features for Maintaining Indexes (see page 611) Accessing Index Functions (see page 612) Create Index Option (see page 614) Template Index Option (see page 632) Alter Index Option (see page 632) Automatic Partitions Management (see page 638) Calculate Space Requirements for Indexes (see page 639) Auxiliary Indexes (see page 641) Data-Partitioned Secondary Indexes (DPSIs) (see page 642) Drop Considerations (see page 645) DDL Execution (see page 645)

Product Features for Maintaining Indexes The index object options let you create, template, alter, and drop indexes. Index object options include: Object Selection You can enter selection criteria in many fields to bring up lists of objects to choose from. Fields that support such selection criteria include the Table Name for your index, STOGROUP (storage group,) and VCAT. Auxiliary Indexes You can create indexes on auxiliary tables for LOB columns. By entering the name of an auxiliary table for the index you want to create, an alternate Aux Index Create screen displays. The ability to Alter and template indexes on auxiliary tables is also supported. VSAM Definition If you need to create an explicit VSAM data set for the index, you can request the VSAM Definition Facility. Column Selection The columns that form the index are selected from a list of the table's columns. If you want to add columns to your definition, the column selection list is automatically displayed when you issue the KEY command on the primary command line, or the K line command in the key-column list.

Chapter 21: Indexes 611

Accessing Index Functions

Limit Key Values For partitioned indexes, a facility is provided for entering and maintaining limit key values. Table-Controlled Partitioning You may have DB2 convert a table object that is using index-controlled partitioning to use table-controlled partitioning. To do so, you can alter the table object's clustering index to be NOT CLUSTER or create a partitioned index or data-partitioned secondary index (DPSI) using ALTER or CREATE statements. Space Calculator Facility A sophisticated space calculation feature is present for estimating the space required by an index. You can also see the affects of different subpage and free space decisions on the index pages and levels.

Accessing Index Functions Review the following regarding accessing index functions from within the strategy types: ■

Accessing index functions from an alteration strategy (see page 612)



Accessing index functions from a migration strategy (see page 612)



Accessing index functions from a compare strategy (see page 613)



Selecting indexes (see page 613)

Alteration Strategy To create, alter, template, or drop an index through an alteration strategy, enter C, A, T, or D in the Option field and I in the Object field of the RC/M Alteration Strategy Services panel. The appropriate index screen appears.

Migration Strategy To create an index through a migration strategy, enter U in the New Objects field of the RC/M Implode/Explode Services. The Object Creation Services screen appears. Enter an S under Index and press Enter. To alter an index through a migration strategy, enter E in the Selection field next to the name of an index included in the strategy on the Implode/Explode screen or the Dependent Object Selection screen. Only primary and dependent objects can be altered in a migration strategy.

612 User Guide

Accessing Index Functions

To template an index through a migration strategy, enter T in the Selection field next to the name of the index to be templated on the Dependent Object Selection screen. The appropriate index screen appears. Only dependent objects can be templated in a migration strategy, and they cannot be dropped.

Compare Strategy To create or drop an index through a compare strategy: 1.

Enter U in the Create/Drop Objects field of the RC/M Compare Explode Services screen and press Enter. The RC/M Create/Drop Object Selection screen appears.

2.

Enter I in the Object field, and do one of the following depending on the task you want to perform: ■

To create an index, enter C in the Option field, and press Enter. The Index Create screen appears.



To drop an index, enter D in the Option field, and press Enter. A selection screen appears. Select the object to be dropped.

To alter an index through a compare strategy, enter E next to the name of an index included in the strategy on the RC/M Compare Explode Services screen or the RC/M Dependent Object Mapping screen. The Index Alter screen appears. Objects cannot be templated in compare strategies.

Selecting Indexes When altering, dropping, or creating (by template) an index, a selection screen is presented for selecting the indexes if not already specified. Make the index selection list more specific by specifying selection criteria for the Item (index) Name and Creator ID prompts in the header. Use the EQF facility to further specify the indexes displayed. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about EQF. The selection screen displays most of the fields available in the SYSIBM.SYSINDEXES index to make selection of the indexes easier. For more information about these fields, see the online help. All selection screens support the standard scrolling commands.

Chapter 21: Indexes 613

Create Index Option

Create Index Option The Create Index option lets you create an index (and implicitly, indexspace). Indexes can be created for existing tables or for tables that have not been created. When the Index Create screen appears, an index name and creator must be specified. The name and creator of the table for which the index is to be created must then be specified. If a valid table name and creator are entered in the Item Name and Creator fields on the Index Create screen, the Column Selection screen for that table displays. If search criteria are entered, a table selection list displays. Once a table is selected, a list of columns is presented for that table. Select the columns and their order in the index. If you are creating an index for a table that has not been created, you cannot select columns from a list; you must enter them manually. Once the information is complete, review the DDL and decide whether to process the create, edit the DDL, or cancel the create. If a table has been created in the current session (batch mode), but the DDL has not been executed, an index can be created based on any of these tables. The table information is retained, enabling tables and index creation in the same batch job. Tables created in batch mode in the current session are listed at the top of the Table Selection screen and CREATE appears in the Database column. Note: The Item Name and Creator fields of the header pertain to the index, not to its base table. Enter information for tables on which indexes should be defined in the Table Name and Creator fields of the Index Create screen. If a valid table name and creator ID are entered, the column selection screen for that table appears. If valid selection criteria is entered in the Table Name and Creator fields, an Index Table Selection Screen appears. An index can be partitioned or non-partitioned. If the index refers to a table stored on a partitioned tablespace, the index must also be partitioned. Non-partitioned indexes can be clustered.

614 User Guide

Create Index Option

Create Non-Partitioned DB2 Indexes To create a non-partitioned DB2 index 1.

Go to the Index Create screen. If you are unsure how to access this screen, see the Accessing Index Functions section for procedures.

2.

Enter data in the following fields to define some basic information: ■

Index Name (and its corresponding Creator field)



Table Name (and its corresponding Creator field)

Other fields contain default specifications. Note: Use the DEF command to set defaults for fields. You cannot use the DEF command to set defaults for the following fields: Index Name, Comment, Table Name, Defer Build, Piecesize, GBP Cache, and Copy. See the “Object Definition Defaults” chapter for more information. 3.

Press Enter. The Index Column Selection & Key Maintenance screen appears.

4.

Select the columns that compose the index key, and then press Enter.

5.

Enter storage related information about the indexspace in the Partition Information fields. Note: Use the DEF command to set defaults for fields. You cannot use the DEF command to set defaults for the Erase field. See the “Object Definition Defaults” chapter for more information.

6.

Press PF3 (End) to process the creation.

More information: Index Column Selection & Key Maintenance (see page 628)

Create Partitioned DB2 Indexes A partitioned index is used whenever the table to which it refers is stored on a partitioned tablespace. A partitioned index must also be a clustering index.

Chapter 21: Indexes 615

Create Index Option

You can create a partitioned DB2 index using the Index Create screen. To create a partitioned DB2 index 1.

Go to the Index Create screen. If you are unsure how to access this screen, see the Accessing Index Functions section for procedures.

2.

Enter data in the following fields to define some basic information: ■

Index Name (and its corresponding Creator field)



Table Name (and its corresponding Creator field)

Other fields contain default specifications. Note: Use the DEF command to set defaults for fields. You cannot use the DEF command to set defaults for the following fields: Index Name, Comment, Table Name, Defer Build, Piecesize, GBP Cache, and Copy. See the “Object Definition Defaults” chapter for more information. 3.

Press Enter. The Index Column Selection & Key Maintenance screen appears.

4.

Select the columns that compose the index key, and then press Enter.

5.

Enter storage related information about each partition in the Partition Information fields. Note: Use the DEF command to set defaults for fields. You cannot use the DEF command to set defaults for the Part and Erase fields. See the “Object Definition Defaults” chapter for more information.

6.

Press PF3 (End). The Index Partitions Limit Key Values screen appears.

7.

Enter a limit key value for the first partition, and then press Enter to process the information and go to the next partition. (See Index Partitions Limit Keys Values Screen for more information.)

8.

Once information has been entered for all partitions, press PF3 (End) to process the creation.

More information: Index Column Selection & Key Maintenance (see page 628)

616 User Guide

Create Index Option

Index Alter Screen The Index Alter screen permits entry of information about the index and the (implicitly created) indexspace. The following describes the fields on this screen: Index Name Enter the name of the index. Table Name Enter the name of the table on which the index is being created. Do one of the following: ■

To display a selection list from which you can select a table, enter valid selection criteria.



To display a specific table, enter a valid table name to display the Index Column Selection & Key Maintenance screen.

If an invalid table name is entered, no selection lists are displayed and the column information fields remain blank. (Blanks are interpreted as the asterisk (*) wildcard.) If you are creating an index for a table that has not yet been created, column information must be entered manually. If the name of the table is changed, the columns listed disappear, and a new column selection list displays. This is to prevent the creation of indexes with columns that do not exist in the selected table. Comment Enter Y or U in the Comment field to display the Comment On Index screen. You can enter comments up to 254 characters in length. Note: You can also create and maintain comments from the alter and template options. Buffer Pool Specifies the buffer pool to be associated with the index. A valid buffer pool name must be entered or an SQL error results. Default: BP0 Note: If you want to use the default buffer pool for indexes in the database, specify DEFAULT.

Chapter 21: Indexes 617

Create Index Option

Partitioned Indicates whether the index is partitioned. Valid values are as follows: ■

N—No. The index is not partitioned. This is the default.



Y—Yes. The index is partitioned.

If the table's tablespace is not partitioned, the index cannot be partitioned. If the index is partitioned, you must enter partition limit information. Piecesize Specifies the size of the data sets that make up a non-partitioned index. Valid values are as follows: ■

256 KB



512 KB



1024 KB (or 1 MB)



2048 KB (or 2 MB)



4096 KB (or 4 MB)



8192 KB (or 8 MB)



16384 KB (or 16 MB)



32768 KB (or 32 MB)



65536 KB (or 64 MB)



131072 KB (or 128 MB)



262144 KB (or 256 MB)



524288 KB (or 512 MB)



1048576 KB (or 1024 MB or 1 GB)



2097152 KB (or 2048 MB or 2 GB)



4194304 KB (or 4096 MB or 4 GB)

For indexes backed by non-LARGE tablespaces, the default is 2G (2GB). For indexes backed by LARGE tablespaces, the default is 4G (4GB). For partitioned indexes and for all indexes created in a DB2 release prior to version 5, the piecesize value is zero (0). Copy Indicates whether the copy utility is allowed for the index. Valid values are as follows:

618 User Guide



N—No. Do not allow full image or concurrent copies or the use of the recover utility on the index. This is the default.



Y—Yes. Allow full image or concurrent copies and the use of the recover utility on the index.

Create Index Option

Creator (Index) Enter an ID for the index creator here. Creator (Table) The ID of the table creator. (Blanks are interpreted as the asterisk (*) wildcard.) Cluster Specifies whether the index is the clustering index for the table. If cluster was used in the definition of an existing index on the table, do not specify YES. Valid values are as follows: ■

YES—Make the index the clustering index for the table.



NO—Do not make the index the clustering index for the table.

Note: When limits are not yet defined, and you want to use indexcontrolled partitioning (ICP), the first partitioning index on the table must also be defined as the clustering index; otherwise, the table uses tablecontrolled partitioning (TCP). GBP Cache Specifies what index pages are written to the group buffer pool in a datasharing environment. In a non-data-sharing environment, you can specify this option, but it is ignored. Valid values are as follows: ■

CHANGED—Cache only changed pages in the group buffer pool. This is the default.



ALL—Cache changed and unchanged pages in the group buffer pool as they are read in from DASD.



NONE—Do not cache any pages to the group buffer pool. DB2 uses the group buffer pool only for cross-invalidation.

For a partitioned index, the value will reflect the value of the first partition. The values of the remaining partitions can be viewed and changed using the G prefix command for the appropriate partition. To reset the values for all the partitions at once, enter A in this field or leave it blank. If the partitions have different settings, use the prefix command to set each one as desired.

Chapter 21: Indexes 619

Create Index Option

Padded Specifies how varying-length string columns are stored in the index. For indexes that do not contain varying-length columns, this option is ignored, because these indexes are always created as physically padded indexes. Valid values for Padded are as follows: ■

Yes—Specifies that varying-length string columns within the index are to be padded to their maximum length (using the default pad character). The length information for a varying-length column is stored with the key.



No—Specifies that varying-length string columns are not to be padded to their maximum length in the index. The length information for a varying-length column is stored with the key.



Default—Specifies that when the index contains at least one varyinglength column, the index is to be padded according to the PAD INDEXES BY DEFAULT specification on the installation panel DSNTIPE.

Note: For a create, specifying Default causes the PADDED clause to be omitted from the generated DDL. Defer Build Indicates whether to defer the index build. Valid values are as follows: ■

YES—Create the index name and allocate the data set, but do not build the index. (You can use utilities to build it later). If the table is populated, the index is placed in a rebuild pending status and DB2 issues a warning indicating the index must be rebuilt.



NO—Create and build the index. This is the default. NO should always be specified for indexes on temporary and auxiliary tables.

Note: With YES or NO, the description of the index and its indexspace are always added to the catalog. If the table is empty and YES is specified, the index is neither built nor placed in a rebuild pending status. See the IBM DB2 Administration Guide for more information about using DEFER. Unique Rule Indicates whether the index column is unique. Valid values are as follows: ■

YES—Index columns are unique. For an index on an auxiliary table, YES is the default and cannot be changed. NO—Index columns are not unique.



UNN—Index columns are unique where not null. With this option, a single-column key column can have multiple null values, but every non-null value must be unique.

Important! Do not specify YES or UNN for an index on a materialized query table (MQT).

620 User Guide

Create Index Option

Close Dataset Indicates whether to close the data sets when the index is not in use and the limit of open data sets is reached. Valid values are as follows: ■

YES—The index is eligible for closing. The CLOSE YES clause is inserted into your generated DDL.



NO—The index is not eligible for closing. The CLOSE NO clause is inserted into your generated DDL.

Note: If DSMAX is reached and there are no CLOSE YES page sets to close, CLOSE NO page sets will be closed. For an index on a declared temporary table, DB2 uses CLOSE NO regardless of the value specified. Index Type Specifies the type of index. Valid values are as follows: ■

2—Type 2 index



D—Data-Partitioned Secondary Index (DPSI)



P—Partitioning Index

Note: Unless otherwise specified in your Object Definition Defaults, 2 is the default during index creation, regardless of the DB2 version. For information about Object Definition Defaults, you can use the DEFAULTS primary command.

Chapter 21: Indexes 621

Create Index Option

Define Specifies whether to defer the physical allocation of DB2-managed data sets. This can be useful when performance is important, or when a DASD resource is constrained. Valid values are as follows: ■

YES—Do not defer the physical allocation of DB2-managed data sets. This specification builds the DEFINE YES clause and inserts it into the generated DDL. The index is defined, and the associated data sets are immediately allocated. Note: Unless otherwise specified in your Object Definition Defaults, YES is the default, regardless of the DB2 version. For information about Object Definition Defaults, you can use the DEFAULTS primary command.



NO—Defer the physical allocation of DB2-managed data sets. This specification builds the DEFINE NO clause and inserts it into the generated DDL. The index is defined, but DB2 does not allocate the associated data sets until a row is inserted into the table on which the index is defined. The DB2 catalog table SYSIBM.SYSINDEXPART contains records of the created tablespace and an indication that the data sets are not yet allocated.

Note: You cannot specify DEFINE NO for auxiliary indexes, indexes on declared temporary tables, or for user-managed data sets (which, are defined with the USING VCAT clause).

Column Information Fields The following fields display information about the selected columns on the Index Create, Index Alter, or Index Template screens. If you are creating an index for a table that does not yet exist, column information must be entered in these fields. Cmd Manipulate the columns by entering standard ISPF line commands. Valid values are as follows:

622 User Guide



A—Place the column to be moved after this line.



B—Place the column to be moved before this line.



D—Delete the column. To delete more than one column, specify Dnn, where nn identifies the number of columns to be deleted. You can also use paired DD commands to select a block of key columns to delete.



I—Insert new key columns. To insert more than one new key column, specify Inn, where nn identifies the number of new blank key columns to be inserted.

Create Index Option



K—Display a list of available columns to choose from that exist in the table on which the index is being created. When specified, the Index Column Selection & Key Maintenance screen appears. Select one or more columns to insert immediately after this key column.



KA—Performs the same function as the K command.



KB—Display a list of available columns to choose from that exist in the table on which the index is being created. When specified, the Index Column Selection & Key Maintenance screen appears. Select one or more columns to insert immediately before this key column. See Index Column Selection & Key Maintenance for more information.



M—Move the column. To move more than one column, specify Mnn, where nn identifies the number of columns to be moved. You can also use paired MM commands to select a block of key columns to move.



RES—Reset or restore this key column back to its old definition.





When specified for a newly inserted key column that has no old definition, the column is removed.



When COMPARE is on and this command is specified for a newly deleted column, the deleted column is reinserted into the key. For a partitioned index, the column's limit values are also reset in all the partitions.

U—Undo key columns and return them back to their old definitions. To undo more than one key column, specify Unn, where nn identifies the number of key columns to undo. You can also use paired UU commands to select a block of key columns to undo.

The following commands are valid only for compares: ■

SRC—Set this key column to its source definition. For a partitioned index, the column's limit values are also reset in all the partitions.



TRG—Set this key column to its target definition. For a partitioned index, the column's limit values are also reset in all the partitions.

See Index Key List Fields for more information about the other columns.

Partition Information Fields The partition information fields appear at the bottom of the Index Create, Index Alter, or Index Template screens. These fields let you enter storage related information about each partition in the indexspace or the whole indexspace (non-partitioned). To manipulate this data, see Manipulating Partition Information.

Chapter 21: Indexes 623

Create Index Option

The partition information fields include the following: VCAT Defines the VSAM catalog for the indexspace or indexspace partition. See VSAM Define Screen for more information. STOGROUP Specify a storage group name or enter selection criteria to view a selection list. If specified, the storage group is used as an alternative to the VSAM catalog identified in the Vcat field. This lets DB2 define the data sets for the indexspace using space from the storage group. The default is SYSDEFLT. PRIQTY When creating or altering an index, you can use the PRIQTY field to specify the index's minimum primary space allocation for a DB2-managed data set. The PRIQTY field has a valid range of 12 to 4194304 kilobytes, or you can specify the keyword DEFAULT. When creating an index or a index template, entering the keyword DEFAULT in the Index screen's PRIQTY field causes the PRIQTY clause to be omitted on a CREATE INDEX statement. When altering an existing index, entering the keyword DEFAULT in the Index Alter screen's PRIQTY field causes the PRIQTY -1 clause to be inserted on an ALTER INDEX statement. Note: For DB2 versions prior to v8, the clause PRIQTY 12 is inserted on an ALTER INDEX statement if DEFAULT is entered in the PRIQTY field. In user-managed data sets (when you specify VCAT), PRIQTY is set to 0 and cannot be overridden. SECQTY When creating or altering an index, you can use the SECQTY field to specify the index's minimum secondary space allocation. The SECQTY field has a valid range of 0 to 4194304 kilobytes, or you can specify the keyword DEFAULT. Note: If you specify a user-managed data set by supplying a value in the VCAT field, SECQTY is set to 0 and cannot be overridden. When creating an index or an index template, entering the keyword DEFAULT in the Index Create screen's SECQTY field causes the SECQTY clause to be omitted on a CREATE INDEX statement. When altering an existing index, entering the keyword DEFAULT in the Index Alter screen's SECQTY field causes the SECQTY -1 clause to be inserted on an ALTER INDEX statement. Note: For DB2 versions prior to v8, the clause SECQTY 12 is inserted on an ALTER INDEX statement if DEFAULT is entered in the SECQTY field.

624 User Guide

Create Index Option

Erase Specify whether the DB2-defined data sets should be erased if the indexspace is dropped. Valid values are as follows: ■

YES—Erase the DB2-defined data sets if the indexspace is dropped.



NO—Do not erase the DB2-defined data sets if the indexspace is dropped.

Frpage Specify the number of pages that must be filled before a free page is inserted. Valid entries are integers from 0 to 255. The default is 0. %FR Specify what percentage of each page is left as free space when the table is loaded or reorganized. The default is 10. Changing Partition Information for an Indexspace If you specify partition information and the indexspace is changed to non-partitioned, all lines except the first are deleted. If the indexspace is returned to a partitioned indexspace, the old partition values are returned. See Alter Index Option for more information about changing from one type of indexspace to another. Manipulating Partition Information Note: You can use standard ISPF line commands to create a number of partitions quickly (copy, delete, move, and insert). After copying a partition, change the information necessary to complete its definition. To manipulate the partition information on the Index Create, Index Alter, or Index Template, enter a standard ISPF line command or a line command pertaining to a partition (for partitioned indexspaces) or indexspace (for non-partitioned indexspaces). The following commands are supported for partitioned and non-partitioned indexspaces except as noted: ■

A—Place the partition to be copied or moved after this line. This command applies to partitioned indexspaces only.



B—Place the partition to be copied or moved before this line. This command applies to partitioned indexspaces only.



C, Cnn, or CC—Copy this partition, number of partitions, or block of partitions to a location marked by A or B. These commands apply to partitioned indexspaces only.



D, Dnn, or DD—Delete this partition, number of partitions, or block of partitions. These commands apply to partitioned indexspaces only.

Chapter 21: Indexes 625

Create Index Option



G—View or enter Group Bufferpool Cache information for this partition. When specified, the Group Bufferpool Cache Setting popup appears. See Group Bufferpool Cache Setting for more information.



I or Inn—Insert a partition or number of partitions after this partition. These commands apply to partitioned indexspaces only.



L—Edit the limit key values for this partition. When specified, the Index Partitions Limit Keys Values screen appears, which displays all columns for the partition horizontally across the screen. To enter limit key values for a specific partition, enter LIMITS on the command line, and press Enter. See Index Partitions Limit Keys Values Screen for more information. Note: Only the partition on which you entered the command is unprotected. All other partitions are automatically protected. To unprotect all other columns on all other partitions, enter the UNPROTECT * command on the primary command line.

626 User Guide



LC—Generate and browse IDCAMS LISTCAT for VSAM data set. For more information, see the IBM IDCAMS documentation.



M, Mnn, or MM—Move this partition, number of partitions, or block of partitions to a location marked by A or B. These commands apply to partitioned indexspaces only.



R, Rnn, or RR—Repeat this partition, number of partitions, or block of partitions after this partition. These commands apply to partitioned indexspaces only.



RES—Reset the partition to its old definition.



S—Perform space calculations for this partition. When specified, the Space Calculation screen appears.



SO—Perform space calculations for this partition. When specified, the Options screen appears, which lets you change the space calculator options before going to the space calculator.



SRC—Set all values for this partition to its source definition values. On a partitioned index, the limit values for all columns in the partition are also reset. This command is valid for compares only.



TRG—Set all values for this partition to its target definition values. On a partitioned index, the limit values for all columns in the partition are also reset. This command is valid for compares only.



U, Unn, or UU—Undo this partition, number of partitions, or block of partitions and return them back to their old definitions. This command performs the same function as the RES command.



V—Edit the VSAM cluster definition for this partition. See VSAM Define Screen for more information.

Create Index Option

Group Bufferpool Cache Setting The Group Bufferpool Cache Setting popup screen appears when you issue the G line command next to an indexspace partition on the Index Create, Alter, or Template screen. To specify what pages of the indexspace are written to the group buffer pool in a data sharing environment, enter one of the following values in the GBP Cache for partition field: ■

A—All. Cache both changed and unchanged pages in the group buffer pool.



C—Changed (Default). Cache only changed pages in the group buffer pool.



N—None. Do not cache any pages in the group buffer pool. DB2 uses the group buffer pool only for cross-invalidation. If you specify N, the tablespace or partition must not be in a recover pending status and must be in the dropped state.

Note: In a non-data sharing environment, you can specify this information, but it is ignored. More information: Change Non-Partitioned to Partitioned (see page 634)

Index Table Selection Screen The Index Table Selection screen appears when creating a new index, or when selection criteria are entered in the Table Name field on the Index Create, Index Alter or Index Template screen. This screen lets you select the tables on which indexes should be created. Tables created as part of the strategy appear at the top of the screen. For newly created tables, *CREATE* displays in the Database column. To view referential integrity relationships in the Status field, use the M (Max) scroll command (enter M in the command line and press PF20) to scroll all the way right. This field indicates whether the table has a primary index already created. Select the tables to work with by entering S next to the names and pressing Enter. If you are creating an index, the Index Column Selection & Key Maintenance screen appears; otherwise the Index Template or Index Alter screen appears.

Chapter 21: Indexes 627

Create Index Option

Index Column Selection & Key Maintenance You can select, delete, move, and modify key columns and index keys quickly and easily from the Index Column Selection & Key Maintenance screen. This screen appears when you: ■

Enter K, KA, or KB line commands next to a key column on the Index Create or Index Alter screen. The A (after) or B (before) command is inserted automatically for you on this screen on the corresponding line from the Index Create or Index Alter screen. Select the columns that you want to insert after this key column from the Column Name Selection List.



Enter the KEY primary command on the Index Create or Index Alter screen.



Alter, create, or template on the Index Create or Index Alter screens, and after you press Enter it is determined that key columns are defined for the index.

By default, the Column Name Selection list only displays the columns that are eligible to be selected as key-columns for your index. When you select a column, it is removed from this list and inserted into the Index Key list at the bottom of the screen. See Selecting Columns for more information. Note: To display ineligible columns (although not selectable) as well as columns that are already part of the key, enter the L primary command to toggle the Column Selection List display mode. See Column Name Selection List Fields and Index Key List Fields for more information about this screen. More information: Create Non-Partitioned DB2 Indexes (see page 615) Create Partitioned DB2 Indexes (see page 615)

628 User Guide

Create Index Option

Column Name Selection List Fields This section describes the column name selection list fields on the Index Column Selection and & Key Maintenance screen: Hide Specifies whether the Column Name Selection list information appears. By hiding the Column Name Selection list, you can make more screen area available for displaying your Table Partitioning Key or Index Key, if needed. Valid values are as follows: ■

N—Do not hide the Column Name Selection list.



Y—Hide the Column Name Selection list. Only the banner line appears.

Note: To display more information on the screen, you can use the H (header) primary command to toggle the header portion of the Column Name Selection and Index Key lists on and off. COL# Displays the column's physical position in the table for which you are creating or altering an index. PS Identifies the column's partitioning sequence (numeric position) within the table's partitioning key. Note: If the column is not part of a partitioning key, or if the table is not using table-controlled partitioning (TCP), no value is displayed. Column Name Displays the name of the table's column. Coltype Displays the columns built-in or user-defined (UDT) type. Srctype Displays the column's source type. This is the DB2 built-in type on which a user-defined type (UDT) is sourced. If the column's type is not a UDT, this field displays blanks. Size Displays the size of the column. N Displays the column's null indicator. Valid values are as follows: ■

Y—Indicates that the column is nullable.



N—Indicates that the column is not nullable.

Chapter 21: Indexes 629

Create Index Option

Index Key List Fields This section describes the index key list fields on the Index Column Selection and & Key Maintenance screen. Use the PF10 and PF11 keys to scroll this information independently of the Column Name Selection list. Note: To provide more room on the screen for working with the index key columns, you can optionally hide the column selection list by setting the Hide field to Y (yes). See Column Name Selection List Fields for more information. Seq# Identifies the order (sequence) of the column within the key. The sequence number is updated as the lines are manipulated. PS Identifies the column's partitioning sequence (numeric position) within the table's partitioning key. PS helps quickly determine whether the key for your index is a matching or superset of the table object's partitioning key. Note: If the column is not part of a partitioning key, or if the table is not using table-controlled partitioning (TCP), no value is displayed. Key Column Name Identifies the column name. See Index Column Selection & Key Maintenance for more information. Order Indicates the order in which the data is stored. Valid values are as follows: ■

ASC—Ascending. This is the default.



DESC—Descending.

Important! If the key is for a partitioned table or a partitioned index, modifying this field might invalidate your limit values. Coltype Specifies the data type of the column. See Index Partitions Limit Keys Values Screen for more information. Srctype Displays the columns source type for UDTs; otherwise, it is blank.

630 User Guide

Create Index Option

Size Specifies the size of the column. You can specify up to 64 columns in an index key. To select a column for an index: ■

Specify the number that denotes the column's position within the key.



Select the columns without specifying an order. See Index Partitions Limit Keys Values Screen for more information.

N Specifies the column's null indicator. Valid values are as follows: ■

Y—Indicates that the column is nullable.



N—Indicates that the column is not nullable.

Select Columns To select a column to work with on the Index Column Selection & Key Maintenance screen 1.

Enter one of the following in the CMD column under the Column Name Selection list: ■

Snn—Select nn column names (including this one) and move them to the location marked by A or B in the Index Key list. If nn is omitted, 1 is assumed.



SS—Block select. Use paired SS commands to delimit a block of column names to move to the location marked by A or B in the Index Key list.

Note: When using these commands, only eligible columns will be included in the selection. Columns that are displayed but are not selectable (marked by three dashes) are not included in the selection or the count specified by Snn. 2.

Enter A (after) or B (before) in the CMD column under the Index Key list next to the Index Key where you want to place the column. All entries are put in the index in ascending order by default. If S and numbers are used in the same column selection, the columns selected with S will come first in the index key, in the order of their column number. The numbered keys will follow the S keys, in the order of the entered numbers. To insert blank key columns, specify I (insert) in the CMD column under the Index Key list. See the online help for other valid line commands.

3.

Once all columns have been selected, press Enter.

Chapter 21: Indexes 631

Template Index Option

Processing Considerations The CREATE INDEX statement cannot be executed while a DB2 utility has control of the tablespace that contains the identified table. If the named table contains data, CREATE INDEX creates the index entries for it. If the table does not yet contain data, CREATE INDEX creates a description of the index, and the index entries are created when the table is loaded.

Confirming the Creation After all information has been entered, press PF3 (End) to process the create. A Create Confirmation screen appears. Accept, edit, or reject the DDL that is used to create the index.

Template Index Option The Template Index option lets you create a new index using an existing index as a template. In fact, a template session is actually a create session with an additional step: an index can be selected as a starting point. The other fields can be changed, but the name of the templated index must be changed. The Index Template screen displays the values used to create the template index. Change the fields for the new index according to the procedures outlined in Create Index Option. Once changes have been made, press PF3 (End) to process the template. Note: To view the IDCAMS System Services LISTC Report and view space amounts for user-defined data sets, enter LC in the CMD field for the data set. For more information about the specifics of this report, see the IBM IDCAMS documentation.

Alter Index Option The Alter Index option lets you alter any characteristic of the index, even those to which DB2 does not allow changes. You can also make changes not allowed by DB2 by dropping and re-creating the index. The DB2 ALTER INDEX command is fully supported. The following information can be altered in DB2.

632 User Guide



Buffer Pool



Close data set



Free Page



Percent Free



Using (data set)

Alter Index Option



Primary Quantity



Secondary Quantity



Erase Rule



Padded



Cluster

To alter an index, access the Index Alter screen and make changes according to the procedures outlined in Create Index Option. After you make changes, press PF3 (End) to process the alter.

Processing Considerations When altering an index, take the following into consideration. ■

An index cannot be altered while a DB2 utility has control of the index or its associated tablespace.



A change to the CLOSE rule is effective immediately.



A change to the buffer pool assignment has no effect on the index until the next time its data sets are opened.



A change to FREEPAGE or PCTFREE has no effect until index entries are stored by a load operation or the index is reorganized.



If altering the number of partitions, be sure to change the partitions in the tablespace first. DB2 does not allow changes to the index before the tablespace.

Chapter 21: Indexes 633

Alter Index Option

Online Schema Support Regarding Index Alterations The product provides the following support for online schema evolution (extended ALTER functionality introduced in DB2 V8): ■

Adding columns to an index using ALTER INDEX with the ADD COLUMN clause (instead of dropping and re-creating the index).



Altering the PADDED attribute by either of the following in the analysis output:





ALTER INDEX creator.indexname PADDED



ALTER INDEX creator.indexname NOT PADDED

Altering the CLUSTER attribute by way of the ALTER INDEX with the CLUSTER or NOT CLUSTER clause (instead of dropping and re-creating the index).

Note: If you execute alterations that use ADD COLUMN, PADDED, or NOT PADDED, the index is left in Rebuild Pending (RBDP) status. If the RECOVER INDEX analysis option is set to Y, REBUILD INDEX and RECOVER INDEX statements are included in the analysis output DDL file. Execution of the ALTER INDEX NOT CLUSTER statement can lead to table-controlled partitioning if the index is the partitioning index for a table that uses index-controlled partitioning. To avoid the RBDP status and versioning of the index due to the new ALTER extensions, you can use the Drop & Re-create analysis option to force the dropping and creating of DB2 objects as was done prior to DB2 V8

Change Non-Partitioned to Partitioned To change an index from non-partitioned to partitioned

634 User Guide

1.

Access the Index Alter screen.

2.

For Partitioned, specify YES.

3.

For Cluster, specify YES.

4.

Use the R, Rn, or RR commands to repeat the first partition (in Partition Information section of screen) to give as many partitions as desired.

5.

Change the partition information fields as necessary (PRIQTY, SECQTY, Frpage, and so on).

Alter Index Option

6.

Specify Limit Keys for each partition. See the Index Partitions Limit Keys Values Screen section for more information.

7.

Press PF3 (End) to process the alter. A Confirmation screen appears. Accept, edit, or reject the DDL that is used to alter the indexes. See DDL Execution for more information.

More information: Partition Information Fields (see page 623)

Index Partitions Limit Keys Values Screen The Index Partitions Limit Key Values screen contains a scrollable list of partitions with all key columns displayed horizontally across each row in the list. From this screen, you can modify, copy, repeat, move, and exchange limit values for your index between partitions. Depending on how you accessed this screen, the header information displays a set of instructions for you to modify or enter limit key values. See Modifying Limit Key Values and Specifying Limit Key Values for more information. ■

The following header information appears when you enter the LIMITS command from the Index Create, Index Alter, or Index Template screens: Modify your Limit Key Values. A constant must be present for the first index key column of each partition. Unspecified columns will be defaulted by DB2. Press PF3 after you have completed your changes.



The following header information appears when you alter, create, or template an index and when you press PF3 it is determined that no limit key values exist for any of the index's columns for any partitions: Enter Limit Key Values. At minimum, a constant must be present for the first index key column of each partition. Unspecified columns will be defaulted by DB2. Press PF3 after you have completed your changes.

Limit Key Requirements Note the following limit key requirements: ■

Each limit key must have the same data type as its corresponding column.



The precision and scale of a decimal limit key cannot be greater than the column's.



The highest value of the key in any partition must be lower than the highest value of the key in the next partition.

Chapter 21: Indexes 635

Alter Index Option



The highest value of the key in the last partition is always the highest possible value of the key.



If changes are made to the key after defining limit keys, the limit key values are deleted, and must be redefined. A message displays to this effect.

Modify Limit Key Values A constant must be present for the first index key column of each partition. Unspecified columns will be defaulted by DB2. Press PF3 after you have completed your changes. To modify the limit key values 1.

Enter L next to a partition or the LIMITS command on the Index Create, Index Alter, or Index Template screen.

2.

Press Enter. The Index Partitions Limit Key Values screen appears. Note: This screen can use MAXVALUES mode or VALUES ONLY mode. In MAXVALUES mode, you can manage MAXVALUE settings for key columns. In VALUES ONLY mode, you can manage the limit values for partitions, regardless of partition arrangement. For complete information about these modes (including changing modes), see the online help.

3.

636 User Guide

Enter values as follows in the CMD column for the partition's key columns. These columns are displayed, from left to right, in the order in which they were defined for the index. Each column type is type sensitive. ■

A—Replace or exchange the limit key values for the partitions after this line with the limit key values of the partitions selected with the copy (C, Cnn, CC) or exchange (X, Xnn, XX) commands.



B—Replace or exchange the limit key values for the partitions before this line with the limit key values of the partitions selected with the copy (C, Cnn, CC) or exchange (X, Xnn, XX) commands.



C, Cnnn, or CC—Copy the limit key, number of limit keys, or block of limit key values to the location marked by A or B.



PR, PRnn, or PPR—Protect the limit key values from being directly or indirectly altered by user input or by certain commands. This command is similar to the PROTECT primary command, with the exception that it works on a row-by-row basis instead of a columnar basis. These settings stay in effect for the duration of the immediate editing session only and are discarded upon leaving the Index Partitions Limit Key Values screen. See the online help for more information.



R, Rnnn, or RR—Repeat the limit key values of this partition into the partition after this partition.



CMAX—Clear all unprotected occurrences of MAXVALUE for this partition (replacing with blanks).

Alter Index Option

4.



RES—Reset the limit key values of this partition to its old definition.



SMAX—Set all unprotected limit values for this partition to MAXVALUE.



SMAB—Set all unprotected blank limit values for this partition to MAXVALUE only.



SMAF—Set only the first unprotected blank limit value for this partition to MAXVALUE.



SRC—Set the limit key values of this partition to its source definition values. This command is valid for compares only.



TRG—Set the limit key values of this partition to its target definition values. This command is valid for compares only.



UN, UNnn, or UUN—Unprotect the limit key values for the specified partitions so that they can be directly or indirectly altered by user input or through the use of certain commands. This line command is similar to the UNPROTECT primary command, with the exception that it works on a row-by-row basis instead of a columnar basis. These settings stay in effect for the duration of the immediate editing session only and are discarded upon leaving the Index Partitions Limit Key Values screen. See the online help for more information.



X, Xnnn, or XX—Exchange the limit key values for the specified partitions with the limit key values of the partitioned marked by A or B, or another block of identical size marked by another X, Xnn, or XX command.

To validate the partition key columns content, press Enter, PF3 or End.

Specify Limit Key Values When it is determined that no limit values exist for any of the index's columns for any partitions or you enter the LIMITS command on the Index Create, Index Alter, or Index Template screen, you can specify limit key values. To specify limit key values 1.

Do one of the following on the Index Partitions Limit Key Values screen: ■

Enter limit key values for index partition number nnn below.



Enter limit key values.

Note: Minimally, a constant must be present for the first index key column of the partition. Unspecified columns will be defaulted by DB2. Press PF3 after you have completed your changes. 2.

Press PF3 after you have completed your changes.

Chapter 21: Indexes 637

Automatic Partitions Management

Protecting Limit Values You can optionally protect limit values for one or more columns across all partitions with the PROTECT command. You can also protect limit values for all columns in a specific partition with the P line command so that they cannot be inadvertently modified when using certain data modifying commands, such as copy, exchange, and so on.

Automatic Partitions Management Automatic partitions management is controlled using the AUTOPARTS primary command. The AUTOPARTS (or AP) command lets you automatically manage the displayed list of partitions on the Index Create, Index Alter, and Index Template screens such that the number of partitions displayed in the partition information fields always matches the number of partitions in the tablespace of the table for your index. The AUTOPARTS option is only applicable for partitioned indexes, where: ■

The tablespace of the table, for which the index is being altered, created, or templated, is known.



The tablespace is partitioned



The number of parts in the tablespace is also known.

Note: By default, this option is off; however, you can enable it and save the settings so that is default setting is enabled or on.

AUTOPARTS Command Syntax The AUTOPARTS command syntax follows: AUTOPARTS ON|OFF|SAVE or AP ON|OFF|SAVE

Where: ON Enables automatic partitions management. The number of partitions in the tablespace of the table for the index determines the number of partitions that are required for your index. The number of partitions displayed on the screen is always equal to the number of partitions in the table's tablespace.

638 User Guide

Calculate Space Requirements for Indexes

OFF Disables automatic partitions management. You, not the tablespace of the table for the index, determine the number of partitions required for your index. SAVE Saves the current automatic partitions management setting. The saved setting is used as the default setting the next time you create, alter, or template a partitioned index. The saved setting is also remembered across multiple sessions. Note: To display the current command setting, specify AUTOPARTS alone without any options.

Usage Notes When automatic partitions management is enabled, a list of partitions that matches the number of partitions in the tablespace of the table for your index displays on the Index Create, Index Alter, or Index Template screens automatically. When AUTOPARTS ON is specified, automatic partitions management is immediately enabled only when the index is partitioned and the tablespace for the table is known and is also partitioned. Otherwise, this option is temporarily disabled until these criteria are met. Note: When AUTOPARTS is ON and blank partitions are interspersed through the list, you can automatically remove the blank partitions by specifying the AUTOPARTS OFF command followed by the AUTOPARTS ON command. ON. The first command displays all blank and non-blank partitions, and then because the automatic partitions management option is off for a moment, all the blank partitions are automatically deleted the next time you press the Enter key, or before executing the second command, which turns the auto parts option back on.

Calculate Space Requirements for Indexes The Space Calculation facility calculates the primary and secondary space quantities needed for your indexspaces. This eliminates time consuming calculations.

Chapter 21: Indexes 639

Calculate Space Requirements for Indexes

You can create a stand-alone indexspace strategy that saves space requirements for an index. You can also see the affects of different sub-page and free space decisions on the index pages and levels. To calculate space requirements for indexes 1.

Do one of the following: ■

Type SS (Space Calculator) in the Option field on the CA Products for DB2 for z/OS Main Menu and press Enter.



Type SSC from any CA database management productfor DB2 for z/OS and press Enter.

The SpaceCalc Strategy Select panel appears. The strategies are sorted by database name, space name, creator, and name. Stand-alone space strategies always appear at the top because the database name is blank. Object-linked space strategies appear indented under the name of the object to which they are linked. Depending on your video attributes, standalone and object-linked space strategies appear in low-intensity text. Actualized space strategies are highlighted. 2.

Do one of the following: ■

Type CI, the strategy name, the indexspace name, and the index name on the create line to create a new stand-alone indexspace strategy.



Press Enter to see a list of existing strategies and then type E next to the strategy that you want to edit. Selection criteria can be specified.

Press Enter. The Index Strategy panel appears. Note: This panel has the same fields as the Index Alter, Index Create, and Index Template panels. 3.

Select an index, specify a VCAT or storage group name in the VCAT or Stogroup fields, and press Enter. The Index Space Calculation panel appears and shows the index name, number of partitions, and key length. The control parameters default to the values last used on the Index Create and Index Alter panels.

4.

Edit the index information fields and control parameters as needed and press Enter. Note: All fields must contain a value before the results can be calculated. The Summary and Detailed Space Statistics are calculated and updated to reflect your changes on the Index Space Calculation panel. The scrolling position remains when you press Enter so that you can make changes, press Enter, and immediately see the effects on all fields.

640 User Guide

Auxiliary Indexes

5.

Press F3 (End) when you have completed your calculations. The Index Space Calculation panel is refreshed and shows the calculated space statistics. If you accessed space calculation from CA RC/Migrator or CA RC/Update, you are returned to the Index Create, Index Template, or Index Alter panel. The calculations are updated on these panels and the information is used for the selected indexspace or partition.

6.

Type S and an eight-character strategy name or object link in the SSTRAT field to save the strategy and press Enter. Note: You can enter the name of a new strategy or reference an existing (previously saved) strategy. The SpaceCalc Strategy Save panel appears.

7.

Verify the strategy attributes (database name, space name, creator, strategy name, and share option) and press Enter. The space calculation panel reappears. A message confirms that you have successfully saved the strategy, the action code in the SSTRAT field is reset to N, and the space strategy is saved with the specified attributes. If you made changes to the statistics and saved them, an object-linked space strategy is created.

More information: Locate Free Space (see page 539)

Auxiliary Indexes If a column is defined as LOB in a table, it requires its own auxiliary tablespace and index. When you select an auxiliary table, the appropriate Auxiliary Index screen (create, alter, or template) displays. An informational message appears indicating that the index you are creating is on an auxiliary table. Note: Because indexes on an auxiliary table are implicitly unique, the Unique Rule field is always set to YES and cannot be changed. The Aux Index screens let you alter, create, and template DB2 indexes on auxiliary tables. An index's primary purpose is to provide more efficient access to a table.

Chapter 21: Indexes 641

Data-Partitioned Secondary Indexes (DPSIs)

As with indexes on regular tables, there are many useful features available from within these screens to help facilitate the creation and overall management of these special DB2 index objects. From this screen, you can: ■

Apply user defaults to the index definition using the Apply Def command.



Display the original and current definitions of an object using the Compare command.



Enter selection criteria in many fields to bring up lists of objects to choose from. Note: For more information about these fields, see the online help.



Create an explicit VSAM data set for the index through the VSAM definition facility.



Estimate the space required by an index using the Space Calculator facility. You can also see the affects of different sub-page and free space decisions on the index pages and levels.

Data-Partitioned Secondary Indexes (DPSIs) On a partitioned tablespace, you can implement a data partitioned secondary index (DPSI) that clusters the data within each partition. The use of a DPSI can reduce or eliminate contention between jobs that target different partitions of a tablespace. Note: Because it is a partitioned index, a DPSI can be created only on a partitioned tablespace. For information about DPSI restrictions and for general information about secondary indexes, see the IBM DB2 Universal Database for z/OS Administration Guide.

Create a DPSI A DPSI can only be created for a table that is defined in a partitioned tablespace that is using TCP or ICP. If the table is using ICP, creating a DPSI for the table will cause DB2 to implicitly convert the table so that it uses TCP. To create a data-partitioned secondary index: To create a DPSI

642 User Guide

1.

Go to the Index Create screen. (See Accessing Index Functions if unsure of how to get to this screen.)

2.

Enter a name and creator for your index in the Index Name and Creator fields if not already done so. Do not press Enter yet.

Data-Partitioned Secondary Indexes (DPSIs)

3.

Verify that the Partition option is set to YES. Do not press Enter yet.

4.

Enter a valid table for your index in the Table Name and Creator fields. (The table must be defined in a partitioned tablespace and must be using TCP or ICP.) Press Enter. The Index Column Selection & Key Maintenance screen for that table should display. Note: If selection criteria are entered and more than one table matches the selection criteria, the Table Selection screen displays with a list of all matching table objects from which you need to select the table for your index; otherwise, the table is auto-selected and the Index Column Selection & Key Maintenance screen displays.

5.

Select the columns and their order for the index key. When you are done, enter END. You are returned to the Index Create screen. The columns that you selected for your index's key should display in the Key-Column List at the top of the screen. Important: It is crucial that your key is not a matching or superset of the table's current partitioning or clustering index key; otherwise, a type-P index will be assumed instead of a type-D. If the table is using TCP, the PS column in the Column Name Selection list will show the partitioning sequence number of the column within the table's current partitioning key. If the table is using ICP, PS will be filled in after selecting your key columns and will display only in the Index Key list containing the key you are constructing, thus showing you the relationship of the DPSI key columns with that of the table's (yet to be created) partitioning key after being converted to use TCP by DB2 when the generated DDL is finally executed and the DPSI created.

6.

Verify that the Partitioned option is set to YES and that the number of partitions correctly displays for the table's tablespace to the immediate right of the Partitioned field. The Partition List at the bottom of the screen should display an initial list of 10 empty (defaulted) partitions. Note: If AutoParts is ON, the Partition List will initially display a number of partition lines equal to the number of partitions in the table's tablespace. See Automatic Partitions Management for more information.

7.

Verify that the index type is D. If the index type is not D, even after verifying that the Partitioned option to YES, then it is likely that you created a key that is either a matching or superset of the table's partitioning key (if the table is using TCP) or the table's type-2 clustering index (if the table is using ICP.) Make corrections directly on the Index Create screen in the Key-Column List; or, enter the KEY command to display the Index Column Selection & Key Maintenance screen and make the corrections there.

Chapter 21: Indexes 643

Data-Partitioned Secondary Indexes (DPSIs)

8.

Enter the indexspace information for at least one partition in the Partition List at the bottom of the screen. You may enter selection criteria in VCAT or STOGROUP to display a selection list of available VCAT or STOGROUP names to choose from for each indexspace partition. You may also use some common ISPF commands (such as A, B, C, D, I, M, and R) to copy, delete, insert, move, and repeat partitions. To see all available commands and descriptions of each, see the online help and tutorials. Notes: VCAT or STOGROUP must be specified for the other fields to retain their values; otherwise, they will automatically reset to their default values each time Enter is pressed. You need only enter indexspace information for one partition if all partitions for your DPSI are to be defined the same. If you define more than one partition, the first most common definition will be used for the global using block in the generated DDL. Unless overridden using Object Definition Defaults, if you leave all partitions blank without specifying either VCAT or STOGROUP, one screen display partition will be automatically defined for you using the following defaults which will then be used for the global using block in the generated DDL:

9.



VCAT will be set to blanks.



STOGROUP will be set to SYSDEFLT.



PRIQTY will be set to DEFAULT.



SECQTY will be set to DEFAULT.



ERASE will be set to NO.



FRPAGE will be set to 0.



%FR will be set to 10.

(Optional) Modify any other fields on the screen as desired. When you are done, enter END. The RC/Update Creation Confirmation screen displays with the generated DDL for creating your index.

10. Review the generated DDL displayed on the RC/Update Creation Confirmation screen. From this screen, you may immediately execute the DDL online through the Batch Processor, edit the generated DDL, CANCEL and return to the Index Create screen; or, depending on the RC/Update Profile settings for your user ID, build the DDL with RC/Alter so you can specify utilities and extended DDL generation and analysis options.

644 User Guide

Drop Considerations

Drop Considerations Under the rules of DB2, an indexspace cannot be dropped if the index is defined on a table in a partitioned tablespace. The partitioned tablespace is automatically dropped before dropping the index. If the primary index of a table with a primary key is dropped, the table is in an incomplete definition state. Note: For information about how to drop an object with the various drop options (S, SO, R, RO), see the CA RC/Update User Guide.

DDL Execution A confirmation screen appears before the DDL is executed, where you can accept, edit, or reject the DDL to be used to complete the request. Note: If your changes are complex, require dropping and recreating objects (and their dependencies), or the current RC/Update Operation Mode is set to A (RC/Alter), you can perform a complete analysis of your changes that includes rebuilding the DDL and optionally including utility statements and extended DDL generation and analysis options.

Chapter 21: Indexes 645

Chapter 22: View This section contains the following topics: Product Features for Maintaining Views (see page 647) Accessing View Functions (see page 648) Selection Screens (see page 649) Text Command (see page 651) Editing or Browsing View Data (see page 652) Commands (see page 652) Create View (see page 652) Template View (see page 655) Alter View (see page 656) ALL Command (see page 656) Commands (see page 657) Drop Considerations (see page 658)

Product Features for Maintaining Views The View object options fully support the DB2 CREATE and DROP VIEW statements. RC/Objects also lets you change a view. The View option offers the following functionality. ■

Table and Column Selection Help. Instead of specifying specific table and columns names, you can select a table from a table selection list. Enter selection criteria to make the selection list more specific. After you select a table, all columns for that table are displayed in a separate scrollable column area. Select columns from this list for the view.



Column Area. All columns from every table referenced are displayed in a separate scrollable area. Select columns to include in the view from this list. After selecting the columns, appropriate SQL is added to include the column in the view.



SELECT Statement Boilerplate. A boilerplate SELECT statement is included to assist in writing the view SQL. This boilerplate includes place holders for column names. Select the columns and they are included appropriately in the select statement.



Interactive SELECT statements. As SELECT statements are entered, RC/Objects returns the results in a table selection screen or the column area. Select the items to include, and RC/Objects updates the SQL that is used to create the view.



Alter Option. Although DB2 does not provide an ALTER VIEW statement, RC/Objects lets you change any characteristic of a view. RC/Objects makes the change by dropping and re-creating the view.

Chapter 22: View 647

Accessing View Functions

Accessing View Functions You can access view functions from either of the following: ■

CA RC/Update (see page 648)



CA RC/Migrator (see page 648)

From CA RC/Update View functions can be accessed from CA RC/Update by requesting to create, alter, template, or drop a view. To create a view, enter C in the Option field and V in the Object field of the main header and press Enter. To alter, template, or drop a view, enter A, T, or D in the Option field and V in the Object field of the main header and press Enter. A view name can also be entered in the Item Name field or a user ID in the Creator field to get a more specific selection list. From the selection list, select the views to alter, template, or drop. The appropriate RC/Objects View screen appears.

From CA RC/Migrator View functions can be accessed within each strategy type.

Alteration Strategy To create, alter, template, or drop a view through an alteration strategy, enter C, A, T, or D in the Option field and V in the Object field of the RC/M Alteration Strategy Services panel. The appropriate RC/Objects View screen appears.

Migration Strategy To create a view through a migration strategy, enter U in the New Objects field of the Implode/Explode Services panel. The Object Creation Services screen appears. Enter an S under View and press Enter. To alter a view through a migration strategy, enter E in the Selection field next to the name of a view included in a strategy on the Implode/Explode screen or the Dependent Object Selection screen. Only primary and dependent objects can be altered in a migration strategy. To template a view through a migration strategy, enter T in the Selection field next to the name of the view to be templated on the Dependent Object Selection screen. Only template dependent objects can be templated in a migration strategy. Objects cannot be dropped in a migration strategy.

648 User Guide

Selection Screens

Compare Strategy To create or drop a view through a compare strategy, enter U in the Create/Drop Objects field of the Compare Explode Services screen. The Create/Drop Object Selection screen appears. To create a view, enter C in the Option field and V in the Object field. The RC/Objects View Create screen appears. To drop a view, enter D in the Option field and V in the Object field. A selection screen appears. Select the object to be dropped. To alter a view through a compare strategy, enter E next to the name of a view included in a strategy on the Compare Explode Services screen or the Dependent Object Mapping screen. The View Alter screen appears. Objects cannot be templated in compare strategies. Note: All screens in this chapter are from CA RC/Update.

Selection Screens When altering, dropping, or creating (by template) a view, a selection screen is presented to select the view if not already specified. Make the view selection list more specific by specifying selection criteria for the Item (view) Name and Creator ID prompts in the header. Use the EQF facility to further specify the views displayed. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about EQF. For more information about selection criteria, see Selection Criteria in the “Storage Group” chapter.

Screen Layout The View Selection screen displays all the fields available in the SYSIBM.SYSTABLES table. This information displays to make selection of the views easier. All RC/Objects selection screens support the standard scrolling commands. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about the scrolling commands. To choose items from the listing, type an S for Select next to the items to select, and press Enter.

Chapter 22: View 649

Selection Screens

VIEW NAME The name of the view. CREATOR The user ID of the view creator. DATABASE For a view of tables, the name of the database that contains the tablespace named in TSNAME. For a view of a view, the value is DSNDB06. TSNAME For a view of one table, the name of the tablespace that contains the table. For a view of more than one table, the name of the tablespace that contains one of the tables. For a view of a view, the value is SYSVIEWS. COLCOUNT Number of columns in the view. RECLEN Not applicable. OBID For views, the OBID is always 0. The following fields can be displayed by scrolling right. DBID For views, the DBID is always 0. LABEL Not applicable. EDPROC Name of the edit procedure associated with the view. VALPROC Name of the validation procedure associated with the view. CARD Not applicable. NPAGES Not applicable. PCTPAGES Not applicable.

650 User Guide

Text Command

PARENTS Not applicable. CHILDREN Not applicable. KEYCOLS Not applicable. STATUS Not applicable. LOCATION Not applicable. TBCREATOR Not applicable. TBNAME Not applicable.

Text Command The T (text) command displays the text of the view while the selection screen displays. While viewing a View Selection screen, enter T (text) in the command line. The text of the first view (and any other views that fit) displays. The display of the selection screen is changed as shown in the preceding screen. VIEW NAME The name of the view. CREATOR The user ID of the view creator. VIEW TEXT The text of the view is the SQL used to create the view. Scroll down to display more view text. For faster display, move the view of the text to display to the top of the selection list by moving the cursor to that view, and scrolling down with scroll type DATA before entering the T (text) command. The T (text) command works as a toggle; enter T to turn text off.

Chapter 22: View 651

Editing or Browsing View Data

Editing or Browsing View Data Edit or browse data in views by using RC/Edit. See the CA RC/Update User Guide for more information.

Commands The Compare and Header commands can make working with views easier. Following is a brief description of how to use these commands. Note: For more information about these commands, see the online help. ■

Compare—Compare is useful when you are templating or altering a view. The C (compare) command can be entered in the command line to see a summary of all changes made to the view. The Compare screen shows the old and new versions of the view. Use the RESET command to reset changed attributes to their original status.



Header—The H (header) command toggles the header on and off. Enter H in the command line to toggle the header.

Create View The Create View option lets you create a view through a series of easy to use screens. These screens include a Table Selection screen and Column Selection help.

View Create Screen The View Create screen provides an easy way to supply the information necessary for view creation. [1] CAPS The status of the CAPS feature. For more information, see the “ISQL” chapter in the Value Pack Reference Guide. [2] NULLS The status of the NULLS feature. For more information, see the “ISQL” chapter in the Value Pack Reference Guide.

652 User Guide

Create View

[3] View Name and Select Statement The default SELECT statement used to create the view. [4] Check Option The Check option lets you add the DB2 WITH CHECK OPTION statement to the view syntax. This option indicates all inserts and updates against the view are to be checked against the view definition (the search condition of the WHERE clause) and rejected if the inserted or updated row does not conform to that definition. If the view does not have a WHERE clause this is ignored. [5] CMD (Command) Enter ISPF line commands here to insert or update the SELECT statement. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information. Enter the View Name and Creator ID in the appropriate fields. If this information was supplied in the Item Name and Creator fields of the header, the information is carried to this screen.

SELECT Statement The syntax for creating a view requires a SELECT statement that begins AS SELECT. The boilerplate statement provided with the Create View screen is ( @ ) AS SELECT @ FROM

The at sign (@) serves as a place holder for column names selected from the list of columns in the separate column scrollable area. The SELECT statement provided as a boilerplate for all SELECT statements includes two at signs. The first (before the SELECT) will hold the place of the name assigned to the columns in the view. The second (after the SELECT) holds the names of the columns within the table. Include @ signs anywhere in the SELECT statement to hold the place of column names. If there is no @ sign and columns are selected, the columns are placed in the SELECT statement before the from of the first SELECT.

Chapter 22: View 653

Create View

Table Selection Access a table selection list by entering table selection criteria with PARSE on. (PARSE on is the default. Note that the asterisk [*] is not valid.) For example, to get a listing of all tables created by PTITO, enter this SELECT statement: ( @ ) AS SELECT @ FROM PTITO.%

A table selection screen will appear. Tables created in batch mode in the current session are listed at the top of the Table Selection screen and CREATE appears in the Database column. They are selected like any other table. Select the table from which columns should be selected. The table name enters the SQL statement and the column names appear in the column scrollable area. (When tables are selected, the column listing at the bottom also adjusts.)

Column Area Columns are displayed in a separate scrollable area at the bottom of the screen. The Column Area displays the column names for any tables that appear in a FROM clause in the SELECT statement. The Column Area is scrolled using the ISPF left (PF10) and right (PF11) commands. The Column Area is a scrollable area separate from the scrollable area in which the SQL is entered. To scroll the Column Area, use the PF10 and PF11 keys. Table Name The name of the table displays here. If a correlation letter was specified in the SELECT statement, that letter displays here. Column Name The names of the columns are displayed directly below the table names. The columns in the scrollable area are identified by number. Refer to this number in the SELECT statement instead of using the whole column name. Use PF7 and PF8 to scroll the data in the SQL area. Use the PF10 and PF11 to scroll the data in the column scrollable area. Select columns from the column scrollable area by entering S next to each column to select. The column names are placed in the SELECT statement wherever a place holder (@) appears, in accordance with the rules outlined in the previous section. Note: If a column is added to the SELECT portion of the statement using the @ place holder, the FROM TABLE portion of the statement must still be updated.

654 User Guide

Template View

If a column is selected without using a place holder, the column name is added to the column list with the SELECT column and FROM table portion of the statement updated automatically.

Using Correlation Letters If correlation letters were included in the SELECT statements, the correlation letter can be used as an abbreviation for the table name in subsequent SQL. RC/Objects will also refer to table names using correlation letters, if specified.

Using Column Numbers Every column displayed in the Column Area is assigned a number. Use this number in the SELECT statement as a column abbreviation. Use the column number preceded by a colon. For example, to refer to PTITO.DEMO2.NAME, refer to :1; use :5 to refer to PTITO.EDIT_DEMO.NAME. When Enter is pressed, the column abbreviation is expanded to the full column name.

ALL Command The ALL command can be used to SELECT all the columns of a table.

Confirming the Creation The Creation Confirmation screen enables users to accept, edit, or reject the DDL to be used to create the view.

Template View The template option lets you create a new view using an existing view as a template. A template session is actually a create session with the additional step of selecting a view as a starting point. The name of the templated view must be changed. The other fields can be changed. The view's dependent objects are not included in the template operation. The View Template screen displays the values that were used to create the template view. Notice that the fields for this screen are similar to those on the View Create screen. Change the fields for the new view according to the procedures outlined in Create View. Once changes have been made, press PF3 (End) to process the template. Use the ALL command to select all the columns of a table. See ALL Command for more information. A confirmation screen appears. Accept, edit, or reject the DDL to be used to create the views. See DDL Execution for more information.

Chapter 22: View 655

Alter View

Alter View The Alter View option lets you change any characteristic of a view. DB2 does not provide an ALTER VIEW statement, so RC/Objects drops and re-creates the view. The screen flow for an Alter session is similar to the Template session. The View Alter screen is similar to the View Template screen. When the screen appears, all columns from every table referenced are displayed in the column scrollable area. Change fields as necessary, according to the procedure outlined in the Create View section. When finished, press PF3 (End) to process the alter. There is no DB2 ALTER VIEW statement. All view alterations are made by dropping and re-creating the view. Use the ALL command to select all the columns of a table. The Alter Confirmation screen appears. Accept, edit or reject the DDL to be used to alter the view.

ALL Command The ALL primary command can be entered on the View Create, View Alter, and View Template screens to select all the columns of a table at once. Using the ALL command is much faster than the alternative, selecting each column by placing an S in the line command area before the column name. The View Create screen below shows the SELECT statement before column names have been selected. SELECT Statement Select all the columns in a table at once by entering ALL at the command line. All column names are added to the SELECT statement. Any previously selected columns will still be included in the SELECT statement. If the ALL command is entered twice, the column names are added to the SELECT statement two times.

656 User Guide

Commands

The following illustrates the effect of the ALL command on the SELECT statement. PTVCRC --- (CAPS ON) COMMAND ===>

------ View Create ----- (NULLS ON)

--SCROLL ===> CSR

Option ==> C Object ==> V Mode ==> O ONLINE Item Name ==> EMPVIEW Creator ==> USER01 Where ==> N SSID: D51A------------------------------------------------------------- USER01 View Name ==> EMPVIEW Creator ==> USER01 Check Option ==> N CMD CREATE VIEW USER01.EMPVIEW ___ ( EMPNO , L_NAME , F_NAME , ADDRESS1 , ADDRESS2 , CITY , STATE , ___ ZIP_FOUR , PHONE_RES ) AS SELECT USER01.NEW_EMP.EMPNO , ___ USER01.NEW_EMP.L_NAME , USER01.NEW_EMP.F_NAME , USER01.NEW_EMP.ADDRESS1 ___ , USER01.NEW_EMP.ADDRESS2 , USER01.NEW_EMP.CITY , USER01.NEW_EMP.STATE ___ , USER01.NEW_EMP.ZIP_FOUR , USER01.NEW_EMP.PHONE_RES FROM ___ USER01.NEW_EMP ******************************* BOTTOM OF DATA ******************************** ******************************* BOTTOM OF DATA ********************************

The SELECT statement now includes all the columns in table USER01.NEW_EMP.

Commands There are many commands available to assist with a View Creation session. These commands are explained in detail in the “ISQL” chapter in the Value Pack Reference Guide. A brief description is presented here. CAPS Turns caps lock on and off. COLS Controls the display of a second scrollable area at the bottom of the screen called the Column Area. FORMAT The FORMAT (FO) command lets you format the view text into a more readable format with indentation. TE Text Entry command lets you enter SQL statement text without regard to cursor position. When specified, the CMD area is removed and automatic cursor skip will occur upon reaching the end of the text line. When you press Enter, TE is removed and you are placed back into standard text entry. If words are split between lines, and PARSE is on, the split is fixed when Enter is pressed.

Chapter 22: View 657

Drop Considerations

WW Word wrap command turns word wrap on and all lines are restructured to fit as much on a line as possible. Enter the WW command to reflow fragmented statement text into a uniform text lines. WS Word split command separates the SQL statement text into tokens and places each token on a separate line. After entering the WS command and performing any desired edits, enter the WW (Word Wrap) command to reflow the tokens into uniform text lines. Nulls Works as a toggle, turning on and off the NULLS feature. When NULLS is on, space at the beginning or end of the line is considered null. When NULLS is off, space at the beginning or end of the line is considered blank spaces. By default, NULLS is ON. PARSE Turns on and off the parsing feature of the editor. When PARSE is on, RC/Objects parses the entered SQL statement looking for special characters. Specify PARSE ON or OFF.

Drop Considerations When a view is dropped, DB2 invalidates application plans dependent on the view and revokes the privileges of users authorized to use it. Note: For information about how to drop an object with the various drop options (S, SO, R, RO), see the CA RC/Update User Guide.

658 User Guide

Chapter 23: Sequence This section contains the following topics: Overview of Sequences (see page 659) Access Sequence Functions from a Migration Strategy (see page 659) Access Sequence Functions from an Alteration Strategy (see page 660) Access Sequence Functions from a Comparison Strategy (see page 661)

Overview of Sequences A sequence is a user-defined object that generates an ordered arrangement of numeric values, in ascending or descending order according to the user's specification. Using sequences, DB2 users can request and specify a unique value for a given column (presumably a key column). You can manage sequences by performing any of the following activities: ■

Creating a sequence



Templating a sequence



Altering a sequence



Dropping a sequence

Note: For information about using CA RC/Update to create and manage objects, see the CA RC/Update User Guide.

Access Sequence Functions from a Migration Strategy You can access sequence functions from within each strategy type in CA RC/Migrator. The following steps discuss how to access panels on which you can create and manage sequences as part of a migration strategy. Note: For information about using CA RC/Update to create and manage objects, see the CA RC/Update User Guide. For more information about managing objects in a migration strategy, see the "Migration Strategies" chapter.

Chapter 23: Sequence 659

Access Sequence Functions from an Alteration Strategy

To access sequence functions from a migration strategy 1.

Enter 1 in the OPTION field on the CA RC/Migrator Main Menu. The Strategy Services panel appears.

2.

Do one of the following: ■

Enter C in the O field and complete the other fields to create a strategy, and then select objects on the Create Migration Strategy and object selection panels.



Enter U in the O field next to an existing strategy.

The Implode/Explode Services panel appears. 3.

Do one of the following: ■

Begin the creation by typing U in the New Objects field and then entering S next to sequence on the Object Creation Services panel. Note: Unlike the creation process that occurs in CA RC/Update, an alter panel appears (instead of a create panel).



Begin the alteration by entering E in the S field next to the name of a sequence included in the strategy. Note: Only primary and dependent objects can be altered. Dependent objects are altered by entering S next to an object (under Explode Options on the Implode/Explode Services panel) and then editing the object shown on the dependent object selection panel.



Begin the templating by entering S next to an object (under Explode Options) and then entering T in the S field of the dependent object selection panel next to the name of the sequence. Note: Only dependent objects can be templated.

The appropriate sequence panel appears. When you are finished with your work, you can implement the changes as part of the strategy. Note: Objects cannot be dropped in a migration strategy.

Access Sequence Functions from an Alteration Strategy You can access sequence functions from within each strategy type in CA RC/Migrator. The following steps discuss how to access panels on which you can create and manage sequences as part of an alteration strategy. Note: For information about using CA RC/Update to create and manage objects, see the CA RC/Update User Guide. For more information about managing objects in an alteration strategy, see the "Alteration Strategies" chapter.

660 User Guide

Access Sequence Functions from a Comparison Strategy

To access sequence functions from an alteration strategy 1.

Enter 1 in the OPTION field on the CA RC/Migrator Main Menu. The Strategy Services panel appears.

2.

Do one of the following: ■

Enter C in the O field and complete the other fields to create a strategy.



Enter U in the O field next to an existing strategy.

The Alteration Strategy Services panel appears. 3.

Complete the following fields on the Alteration Strategy Services panel: ■

Type C, A, T, or D in the Option field. Note: If you enter C in the Option field (to create a sequence), an alter panel appears instead of a create panel.



Type SQ in the Object field.



Specify a sequence name in the Name field.



Specify a creator in the Creator field.

Note: You can specify * for Name and Creator to choose from a selection list. Press Enter. The appropriate sequence panel appears. When you are finished with your work, you can implement the changes as part of the strategy.

Access Sequence Functions from a Comparison Strategy You can access sequence functions from within each strategy type in CA RC/Migrator. The following steps discuss how to access panels on which you can create and manage sequences as part of a comparison strategy. Note: For information about using CA RC/Update to create and manage objects, see the CA RC/Update User Guide. For more information about managing objects in a comparison strategy, see the "Compare Strategies" chapter. To access sequence functions from a comparison strategy 1.

Enter 1 in the OPTION field on the CA RC/Migrator Main Menu. The Strategy Services panel appears.

Chapter 23: Sequence 661

Access Sequence Functions from a Comparison Strategy

2.

Do one of the following: ■



Enter C in the O field and complete the other fields to create a strategy, which then requires you to: –

Choose a method on the Compare Option Menu.



Complete the Create Compare Strategy panel.



Choose primary objects.

Enter U in the O field next to an existing strategy.

The Compare Explode Services panel appears. 3.

Enter U in the Create/Drop Objects field of the Compare Explode Services panel. The Create/Drop Object Selection panel appears.

4.

Perform one of the following: ■

Begin the creation by typing C in the Option field, typing T in the Object field, and then pressing Enter.



Begin the drop process by typing D in the Option field, typing T in the Object field, and then pressing Enter to display a selection panel, from which you can select the sequence.



Begin the alteration by entering E next to the name of a sequence included in the strategy. Note: You can also make this selection on the Dependent Object Mapping panel.

The appropriate panel appears. When you are finished with your work, you can implement the changes as part of the strategy. Note: Objects cannot be templated in comparison strategies.

662 User Guide

Chapter 24: Synonyms This section contains the following topics: Overview of Synonyms (see page 663) Product Features for Maintaining Synonyms (see page 663) Accessing Synonym Functions (see page 663) Synonym Selection Screens (see page 665) Create Synonym Option (see page 666) Template Synonym Option (see page 667) Alter Synonym Option (see page 667) Compare Command (see page 668) Drop Considerations (see page 668) DDL Execution (see page 668)

Overview of Synonyms In DB2, a synonym is an alternate name for a table or view. You can create synonyms to refer to tables by names that are easier to remember. These alternate names can also be used in applications to reference tables without tying the source code to the physical object. T

Product Features for Maintaining Synonyms The Synonym options let you create, template, alter, and drop synonyms. The Synonym option includes the following features. ■

Table Selection Help. Instead of entering a specific table name, you can enter selection criteria to receive a list of tables that meeting the criteria.



Create Synonyms for Multiple Users. Create synonyms for multiple users by listing the user IDs. SET CURRENT SQLID statements are generated for each user ID specified.

Accessing Synonym Functions You can access synonym functions from within each of the following strategy types: ■

Alteration strategy (see page 664)



Migration strategy (see page 664)



Compare strategy (see page 664)

Chapter 24: Synonyms 663

Accessing Synonym Functions

Alteration Strategy To create, alter, template, or drop a synonym through an alteration strategy, enter C, A, T, or D in the Option field and S in the Object field of the RC/M Alteration Strategy Services panel. The appropriate RC/Objects Synonym screen appears.

Migration Strategy To create a synonym through a migration strategy, enter U in the New Objects field of the RC/M Implode/Explode Services. The RC/M Object Creation Services screen appears. Enter an S under Synonym and press Enter. To alter a synonym through a migration strategy, enter E in the Selection field next to the name of a synonym included in the strategy on the RC/M Implode/Explode screen or the Dependent Object Selection screen. You can alter only primary and dependent objects in a migration strategy. To template a synonym through a migration strategy, enter T in the Selection field next to the name of the synonym to be templated on the Dependent Object Selection screen. You can template only dependent objects in a migration strategy. Objects cannot be dropped in a migration strategy.

Compare Strategy To create or drop a synonym through a compare strategy, enter U in the Create/Drop Objects field of the RC/M Compare Explode Services screen. The RC/M Create/Drop Object Selection screen appears. To create a synonym, enter C in the Option field and S in the Object field. The RC/Objects Synonym Create screen appears. To drop a synonym, enter D in the Option field and S in the Object field. A selection screen appears. Select the object to be dropped. To alter a synonym through a compare strategy, enter E next to the name of a synonym that was included in the strategy on the RC/M Compare Explode Services screen or the RC/M Dependent Object Mapping screen. The Synonym Alter screen appears. Objects cannot be templated in compare strategies. Note: All screens in this chapter are from CA RC/Update.

664 User Guide

Synonym Selection Screens

Synonym Selection Screens When altering, dropping, or creating (by template) a synonym, a selection screen is presented for selecting the synonyms. Make the synonym selection list more specific by specifying selection criteria for the Item (synonym) Name /or Creator ID prompts in the header. Use the EQF facility to further specify the synonyms displayed. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about EQF. For more information about selection criteria, see Selection Criteria in the “Storage Group” chapter.

Screen Layout The Synonym Selection screen displays all the fields available in the SYSIBM.SYSSYNONYMS table. This information displays to make selection of the synonyms easier. All RC/Objects selection screens support the standard scrolling commands. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information. To choose items from the listing, type an S next to the items to select, and press Enter. Sel Enter S next to each synonym to select and press Enter. SYNONYM NAME The name assigned to the synonym. CREATOR The user ID of the synonym creator. TABLE NAME The name of the table for which the synonym was created. CREATOR The user ID of the table creator.

Chapter 24: Synonyms 665

Create Synonym Option

Create Synonym Option The Create Synonym option lets you create a synonym for a table through a series of easy to use screens. You do not have to remember the database and table name; a table selection list is provided. After selecting the table, the user assigns a synonym name and can specify other user IDs for synonym creation. A User ID selection screen is available to assists in the process. Specify the IDs for which synonyms should be created on the Create screen and RC/Objects generates the necessary SET CURRENT SQLID statements. To create a synonym for another user, that user's ID must be one of your secondary IDs.

Table Selection Screen To create a synonym, first indicate the tables for which synonyms should be created. A Table Selection screen will appear before the Synonym Create screen is presented. (Tables created as part of the current strategy appear at the top of the selection list.) To identify them as newly created tables, CA RC/Migrator displays *CREATE* in the Database field. Select tables by typing S next to the names and pressing Enter. Each table selected is processed in turn, in the order of their appearance on the selection list.

Create Screen The Synonym Create screen lets you enter information about the new synonym. Synonym Enter the synonym name. Creator Enter the user ID of the synonym creator. CMD (line command area) Use the standard ISPF line commands (copy, move, insert, delete, block mode) to help manipulate the user IDs. Although the move command is supported, the order of the IDs is not important. USERID To create the synonym for more than one user, enter multiple user IDs in the User ID field. View a User ID Selection screen by entering selection criteria instead of a User ID.

666 User Guide

Template Synonym Option

Specifying Other User IDs To specify other user IDs for synonym creation, you must have the appropriate privileges. The privileges required depend on how the user ID is specified in the DDL. A SET SQLID statement is issued for each user ID. All the users specified must be on your secondary ID list.

User ID Selection Screen The USERID Selection List screen assists in designating multiple user IDs for synonym creation. Select one or more user IDs by entering S next to each ID to select and press Enter. Selected user IDs are queued. Use the S (Shrink) command to view the queue. Once the user IDs have been selected, press the PF3 (End) key to process and return to the Synonym screen. Once all information has been entered on the Create screen, press PF3 (End) to process the creation.

Template Synonym Option Although the Template option does not copy the user ID list with the synonym selected, it is included for product consistency. Enter a user ID list for the templated synonym if desired. The Synonym Template screen displays below. Notice that the fields for this screen are similar to those on the Synonym Create screen. Change the information or enter user IDs according to the procedures outlined in Create Synonym Option. When all information has been entered, press PF3 (End) to process the template.

Alter Synonym Option Although DB2 does not permit synonym alterations, RC/Objects does. Change the name of the synonym or the table it references, or add new user IDs. DB2 alters the synonym by dropping and re-creating it under the user ID of the original creator. Like the Create and Template sessions, an Alter Synonym session allows selection of tables and user IDs. The screen flow for an alter session is similar to a template session. Use the Synonym Alter screen to change the values used to create the synonym. Change the information or enter additional user IDs, according to the procedures outlined in Create Synonym Option. After all information has been entered, press PF3 (End) to process the Alter.

Chapter 24: Synonyms 667

Compare Command

Compare Command The Compare Command is useful when templating or altering a synonym. To see a summary of all changes made to the synonym, enter C (COMPARE) command on the command line. When working with a migration or alteration strategy, the Compare screen shows the old and new versions of the synonym. Use the RESET command to reset changed attributes to their original status. When working with a compare strategy, the Compare screen shows the source, target, and current versions of the synonym. Use the SOURCE and TARGET commands to reset changed attributes to the source or target values.

Drop Considerations According to DB2 rules, a synonym can be dropped only by its creator. However, RC/Objects lets users drop synonyms created by other users. To drop a synonym for another user, that user ID must be one of your secondary IDs.

DDL Execution A confirmation screen appears before the DDL is executed, where you can accept, edit, or reject the DDL to be used to complete the request. Note: If your changes are complex, require dropping and recreating objects (and their dependencies), or the current RC/Update Operation Mode is set to A (RC/Alter), you can perform a complete analysis of your changes that includes rebuilding the DDL and optionally including utility statements and extended DDL generation and analysis options.

668 User Guide

Chapter 25: Alias This section contains the following topics: Overview of Aliases (see page 669) Product Features for Maintaining Aliases (see page 669) Accessing Alias Functions (see page 670) Selection Screens (see page 671) Editing or Browsing Alias Data (see page 672) Commands (see page 672) Alias Create (see page 673) Alias Template (see page 674) Alias Alter (see page 675) Alias Drop (see page 675) DDL Execution (see page 676)

Overview of Aliases Like a DB2 synonym, a DB2 alias is an alternate name for a table or view. However, an alias can name remote (and local) tables or views, whereas synonyms can only name local tables or views. Synonyms and aliases also differ in that synonyms can be accessed only by their creators. Aliases allow flexibility and familiarity by letting all users access them. Different DB2 subsystems can connect and communicate with each other. Aliases can be used to simplify the remote name of a table or view.

Product Features for Maintaining Aliases The RC/Objects alias option includes the following features. ■

Table Selection Help—Instead of entering a specific table name, enter selection criteria (*, %, _) to receive a list of tables meeting the criteria.



Alter Alias—RC/Objects permits alteration of existing aliases. With DB2, only comment and label fields can be altered. There is no ALTER ALIAS statement within DB2.



Template Alias—This option lets you create a new alias based on an existing alias.



Compare Feature—The COMPARE mode of alias lets you check present changes to the original alias to see exactly what has been modified.



Drop Alias—This option lets you drop an existing alias.

Chapter 25: Alias 669

Accessing Alias Functions

Accessing Alias Functions You can access alias functions from either of the following: ■

CA RC/Update (see page 670)



CA RC/Migrator (see page 670)

From CA RC/Update Alias functions can be accessed from CA RC/Update by requesting to create, alter, template, or drop an alias. To create an alias, enter C in the Option field and A in the Object field of the main header and press Enter. To alter, template or drop an alias, enter A, T or D in the Option field and A in the Object field of the main header and press Enter. Enter an alias name in the Item Name field or a user ID in the Creator field to get a more specific selection list. From the selection list, select the aliases to alter, template, or drop.

From CA RC/Migrator From CA RC/Migrator, you can access alias functions from within each strategy type.

Alteration Strategy To create, alter, template, or drop an alias through an alteration strategy, enter C, A, T, or D in the Option field and A in the Object field of the RC/M Alteration Strategy Services panel. The appropriate RC/Objects Alias screen appears.

Migration Strategy To create an alias through a migration strategy, enter U in the New Objects field of the RC/Migrator Implode/Explode Services. The Object Creation Services screen appears. Enter an S under Alias and press Enter. To alter an alias through a migration strategy, enter E in the Selection field next to the name of an alias included in the strategy on the Implode/Explode screen or the Dependent Object Selection screen. Only primary and dependent objects can be altered in a migration strategy. To template an alias through a migration strategy, enter T in the Selection field next to the name of the alias to be templated on the Dependent Object Selection screen. Only dependent objects can be templated in a migration strategy. Objects cannot be dropped in a migration strategy.

670 User Guide

Selection Screens

Compare Strategy To create or drop an alias through a compare strategy, enter U in the Create/Drop Objects field of the Compare Explode Services screen. The Create/Drop Object Selection screen appears. To create an alias, enter C in the Option field and A in the Object field. The RC/Objects Alias Create screen appears. To drop an alias, enter D in the Option field and A in the Object field. A selection screen appears. Select the object to be dropped. To alter an alias through a compare strategy, enter E next to the name of an alias included in the strategy on the Compare Explode Services screen or the Dependent Object Mapping screen. The Alias Alter screen appears. Objects cannot be templated in compare strategies. Note: All screens in this chapter are from CA RC/Update.

Selection Screens When altering, dropping, or creating (by template) an alias, a selection screen is presented for selecting the aliases if not already specified. Make the alias selection list more specific by specifying selection criteria for the Item (alias) Name or Creator ID prompts in the header. Use the EQF facility to further specify the aliases displayed. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information. For more information about selection criteria, see Selection Criteria in the “Storage Group” chapter. The Alias Selection screen displays all the fields available in the SYSIBM.SYSSYNONYMS table. This information displays to make selection of the aliases easier. All RC/Objects selection screens support the standard scrolling commands. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about the scrolling commands. To choose items from the listing, enter S next to the items. Press Enter to register the selection. ALIAS NAME The name of the alias. CREATOR The user ID of the alias creator.

Chapter 25: Alias 671

Editing or Browsing Alias Data

TBNAME The base table name that the alias is referencing. TBCREATOR The user ID of the base table creator. LOCATION Where the base table is located. This field is blank if the table is local. If you select more than one alias from the Alter Alias or Template Alias Selection screens, CA RC/Migrator processes the selections in the order the selected aliases display on the selection screen. CA RC/Migrator processes each selected alias one at a time. Start this process by confirming the first selected alias. When the Batch Processor is complete, press PF3/15 (End). The Alter Alias or Template Alias screen immediately appears with the next alias. The Create, Template, and Alter Alias screens display a Table/View Selection screen when you enter selection criteria in the Table Name and Creator fields. You can select only one table or view for each alias.

Editing or Browsing Alias Data Edit or browse data in aliases by using RC/Edit. See the CA RC/Update User Guide for more information.

Commands The Header and Compare commands can make working with aliases easier. Following is a brief description of how to use these commands.

672 User Guide



Compare—Useful when you are templating or altering an alias. The C (compare) command can be entered in the command line to see a summary of all changes made to the alias. The Compare screen shows the old and new versions of the alias. Use the RESET command to reset the attributes to their original status.



Header—The H (header) command toggles the header on and off. Enter H in the command line to toggle the header.

Alias Create

Alias Create Create Alias lets you create an alternative name for an existing table or view. The Create Alias screen has seven blank fields. Select the table or view for the alias to reference. If selection criteria are entered in the Table Name or Creator fields, RC/Objects simplifies this step by displaying a Table Selection screen. The Table Selection screen lists the tables and views and their creators. Select one table or view from the selection screen. After selecting the base table, complete the alias definition by filling in the remaining blank fields. A Confirmation screen asks for a decision: accept, edit, or reject the alias being created.

Create Screen The Alias screen provides an easy way to supply the information necessary for the alias creation. Alias Enter the new alias name. Creator Enter the user ID of the alias creator in the top Creator field. Table/View Enter the base table name that the alias will reference. Or, enter selection criteria and press Enter for the Table Selection screen. Creator Enter the user ID of the base table creator in the second Creator field. Or, enter selection criteria and press Enter for the Table Selection screen. Location Enter the location of the base table. DB2 needs the location name to be specified if you are accessing a table not in your local subsystem. You will receive an error message during the DDL execution if you have not identified the location of a remote table. If you do not know the location, you can enter an asterisk (*) or a question mark (?) in the Location field. The DB2 SSID/Location Selection screen will appear. Note: For more information, see the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide. The alias screen returns with your selected location in the Location field.

Chapter 25: Alias 673

Alias Template

Label Enter a description of the table or view (optional). Comment Enter any further description (optional). After information has been entered for all fields, press PF3/15 (End) to process the alias creation. The Creation Confirmation screen appears.

Confirming the Alias Creation The Creation Confirmation screen shows the DDL to be used to create an alias. Use the scrolling keys (PF7 or PF8) to view all the DDL. Accept the DDL to be used to create the alias by pressing Enter. Edit the DDL by entering E for Edit in the command line. Reject the DDL by pressing PF3 or PF15 (End). The DDL is executed if Enter is pressed. When the Batch Processor is complete, press PF3 or PF15 (End) to return to the CA RC/Migrator Main Menu.

Alias Template The Alias Template option lets you create a new alias using an existing alias as a template. In fact, a template session is actually a create session with the additional step of being able to select an alias as a starting point. The name of the templated alias must be changed. The other fields can be changed. The Alias Template screen displays the values used to create the template alias. Change the fields for the new alias according to the procedures outlined in Alias Create. Once the changes have been made, press PF3 (End) to process the template. If multiple aliases are chosen, the selected aliases are processed in the same order as they appear on the selection screen. After the processing of the first alias has been confirmed, press PF3/15 (End) for the next templated alias. After entering all the changes in the alias fields and pressing PF3/15 (End), the Confirmation screen appears. Accept, edit, or reject the DDL to be used to drop and re-create the aliases. The DDL is executed if Enter is pressed. When the Batch Processor is complete, press PF3/15 (End) to return to the CA RC/Migrator Main Menu.

674 User Guide

Alias Alter

Alias Alter Alter Alias lets you alter existing aliases. Use Alter Alias to alter an alias's name, location, label, or comment. DB2 does not have an ALTER ALIAS statement. For DB2 to make alias changes to fields other than the label and comments, the alias must be dropped and re-created. RC/Objects makes changes by dropping and re-creating the alias. A table/view or alias listing can be accessed using selection criteria. The screen flow for an Alter session is similar to a Create session. The Alias Alter screen displays the values used to create the alias. Change fields according to the procedure outlined in Alias Create. After changes have been made, press PF3 (End) to process the alter. If several aliases were chosen, they are processed in the same order as they appear on the selection screen. After the processing of the first alias has been confirmed, press PF3/15 (End) for the next alias. After making changes and pressing PF3/15 (End), the Confirmation screen appears. Accept, edit, or reject the DDL to be used to drop and re-create the aliases. Note: If more than one alias was selected, each alias is processed individually. Processing occurs in the same order as the aliases are listed on the selection screen. After confirming the processing of the first alias, press PF3/15 (End) for the Alter Alias screen with the next alias. The DDL is executed if Enter is pressed. When the Batch Processor is complete, press PF3/15 (End) to return to the CA RC/Migrator Main Menu.

Alias Drop According to DB2 rules, an alias can be dropped only by its creator or by a user with SYSADM or SYSCTRL authority. RC/Objects enables users to drop aliases created by other users. To drop an alias for another user, that user ID must be one of your secondary IDs. Note: For more information about dropping an object, see the CA RC/Update User Guide.

Chapter 25: Alias 675

DDL Execution

DDL Execution A confirmation screen appears before the DDL is executed, where you can accept, edit, or reject the DDL to be used to complete the request. Note: If your changes are complex, require dropping and recreating objects (and their dependencies), or the current RC/Update Operation Mode is set to A (RC/Alter), you can perform a complete analysis of your changes that includes rebuilding the DDL and optionally including utility statements and extended DDL generation and analysis options.

676 User Guide

Chapter 26: Triggers This section contains the following topics: Overview of Triggers (see page 677) Accessing Trigger Functions (see page 678) Selection Screens (see page 679) Commands (see page 680) Create Trigger (see page 680) Template Trigger (see page 683) Alter Trigger (see page 683) Drop Trigger (see page 683)

Overview of Triggers A trigger is a schema object that defines a set of actions (SQL statements) that are to be executed when a specific SQL data change operation occurs on a specified table. Triggers provide automatic execution of a set of SQL statements whenever a specified event occurs. These SQL statements can validate and edit database changes, read and modify the database, and invoke functions that perform operations both inside and outside the database. Triggers provide several improvements to the development and execution of DB2 applications: ■

Faster application development. Because triggers are stored in the database, the actions performed by triggers do not have to be coded in each application.



Code reusability. A trigger can be defined once and then used by any application that accesses the table on which it is defined.



Easier maintenance. If a business policy changes, only a change to the corresponding triggers is needed, instead of changes to each application program.

Chapter 26: Triggers 677

Accessing Trigger Functions

Accessing Trigger Functions From CA RC/Migrator, you can access trigger functions from within each of the following strategy types: ■

Alteration strategy (see page 678)



Migration strategy (see page 678)



Compare strategy (see page 678)

Alteration Strategy To create, alter, template, or drop a trigger through an alteration strategy, enter C, A, T, or D in the Option field and TG in the Object field of the RC/M Alteration Strategy Services panel. The appropriate Trigger screen appears.

Migration Strategy To alter a trigger through a migration strategy, enter E in the Selection field next to the name of a trigger included in the strategy on the Implode/Explode screen or the Dependent Object Selection screen. Only primary and dependent objects can be altered in a migration strategy. To template a trigger through a migration strategy, enter T in the Selection field next to the name of the trigger to be templated on the Dependent Object Selection screen. Only dependent objects can be templated in a migration strategy. Objects cannot be dropped in a migration strategy.

Compare Strategy To create or drop a trigger through a compare strategy, enter U in the Create/Drop Objects field of the Compare Explode Services screen. The Create/Drop Object Selection screen appears. To create a trigger, enter C in the Option field and TG in the Object field. The Trigger Create screen appears. To drop a trigger, enter D in the Option field and TG in the Object field. A selection screen appears. Select the object to be dropped. To alter a trigger through a compare strategy, enter E next to the name of a trigger included in the strategy on the Compare Explode Services screen or the Dependent Object Mapping screen. The Trigger Alter screen appears. Objects cannot be templated in compare strategies.

678 User Guide

Selection Screens

Selection Screens When altering, dropping, or creating (by template) a trigger, a selection screen is presented for selecting the trigger if not already specified. Make the trigger selection list more specific by specifying selection criteria for the Item (trigger) Name or Creator ID prompts in the header. Use the EQF facility to further specify the triggers displayed. See the CA Database Management Solutions for DB2 for z/OS General Facilities Reference Guide for more information about EQF. For more information about selection criteria, see Selection Criteria in the “Storage Group” chapter. To choose items from the listing, type an S next to the items to select. Press Enter to register the selection. TRIGGER Name of the trigger and trigger package. SCHEMA Name of the schema of the trigger and collection ID of the trigger package. TBOWNER Qualifier of the name of the table to which this trigger applies. TBNAME Name of the table to which this trigger applies. If more than one trigger is selected from the Alter Trigger or Template Trigger Selection screens, the selections are processed in the order the selected triggers are displayed on the selection screen. Each selected trigger needs to be processed one at a time. Start this process by confirming the first selected trigger. When the Batch Processor is complete, press PF3 or PF15 (End). The Alter Trigger or Template Trigger screen immediately appears with the next trigger.

Chapter 26: Triggers 679

Commands

Commands The Compare and Header commands can make working with triggers easier. Following is a brief description of how to use these commands. ■

Compare—Useful when you are templating or altering a trigger. Enter C (compare) in the command line to see a summary of all changes made to the trigger. The Compare screen shows the old and new versions of the trigger. Use the RESET command to reset the attributes to their original status.



Header—Toggles the header on and off. Enter H in the command line to toggle the header.

Create Trigger Creating a trigger defines a trigger in a schema and builds a trigger package at the current server. Select the schema and table for the trigger to reference. If selection criteria are entered in the Table Name or Creator fields, RC/Objects simplifies this step by displaying a Table Selection screen. The Table Selection screen lists the tables and views and their creators. Select one table from the selection screen. The Trigger screen provides an easy way to supply the information necessary for the trigger creation. The following describes the fields that appear on this screen: Trigger Names the trigger. The name is implicitly or explicitly qualified by a schema. The name, including the implicit or explicit schema name, must not identify a trigger that exists at the current server. The name is also used to create the trigger package; therefore, the name must also not identify a package that is already described in the catalog. The schema name becomes the collection ID of the trigger package. Table Identifies the triggering table with which the trigger is associated. The name must identify a base table at the current server. It must not identify a temporary table, an auxiliary table, an alias, a synonym, or a catalog table.

680 User Guide

Create Trigger

When Specify the trigger type: ■

AFTER—DB2 executes the triggered action after it applies any changes caused by an insert, delete, or update operation on the triggering table.



BEFORE—DB2 executes the triggered action before it applies any changes caused by an insert, delete, or update operation on the triggering table. It also specifies that the triggered action does not activate other triggers because the triggered action of a before trigger cannot contain any updates.

FOR EACH Specifies that the DB2 executes the triggered action for one of the following values: ■

STATEMENT—Executes the triggered action only once for the triggering SQL operation. Even if the triggering SQL operation does not modify any rows, the triggered action is executed once.



ROW—Executes the triggered action for each row of the triggering table that the triggering SQL operation modifies. If the triggering SQL operation does not modify any rows, the triggered action is not executed.

OLD AS Specifies the correlation name that identifies the state of the row prior to the triggering SQL operation. NEW AS Specifies the correlation name that identifies the state of the row as modified by the triggering SQL operation and by any SET statement in a before trigger that has already been executed. Schema Name of the schema of the trigger and collection ID of the trigger package. Creator Authorization ID creating the trigger.

Chapter 26: Triggers 681

Create Trigger

Event Specify the trigger type: ■

INSERT—Specifies an insert trigger. DB2 executes the triggered action whenever there is an insert operation on the triggering table.



DELETE—Specifies a delete trigger. DB2 executes the triggered action whenever there is a delete operation on the triggering table.



UPDATE—Specifies an update trigger. DB2 executes the triggered action whenever there is an update operation on the triggering table. If you do not specify a list of column names, an update operation on any column of the triggering table, including columns that are subsequently added with the ALTER TABLE statement, activates the triggered action.

Mode Specifies the mode of the trigger. Currently, DB2 supports only MODE DB2SQL. OLD TABLE AS Specifies the name of a temporary table that identifies the state of the complete set of rows that are modified rows by the triggering SQL operation prior to any actual changes. NEW TABLE AS Specifies the name of a temporary table that identifies the state of the complete set of rows as modified by the triggering SQL operation and by any SET statement in a before trigger that has already been executed. Columns For an Update Event Type, specify Yes and select column names of the triggering table. An update operation on any of the selected columns activates the triggered action. Remarks Specifies the Remarks option for the trigger. Enter one of the following values: ■

Y—Displays the Trigger Comment screen



N—Erases any trigger comments. This is the default.



U—Enter over a Y to update trigger comments.

TRIGGER TEXT Specifies the action to be performed when the trigger is activated. The triggered action is composed of one or more SQL statements and by an optional condition that controls whether the statements are executed. After information has been entered for all fields, press PF3 or PF15 (End) to process the trigger creation.

682 User Guide

Template Trigger

Template Trigger Template Trigger lets you create a new trigger using an existing trigger as a template. In fact, a template session is actually a create session with the additional step of being able to select a trigger as a starting point. The name of the templated trigger must be changed. The other fields can be changed. The Trigger Template screen displays the values used to create the template trigger. Change the fields for the new trigger according to the procedures outlined in Create Trigger. After the changes have been made, press PF3 (End) to process the template. If multiple triggers are chosen, the selected triggers are processed in the same order as they appear on the selection screen. After the processing of the first trigger has been confirmed, press PF3 or PF15 (End) for the next templated trigger.

Alter Trigger Alter Trigger lets you alter existing triggers or trigger value. RC/Objects makes changes by dropping and re-creating the trigger. The screen flow for an Alter session is similar to a Create session. The Trigger Alter screen displays the values used to create the trigger. Change fields according to the procedure outlined in Create Trigger. Once changes have been made, press PF3 (End) to process the alter. If several triggers were chosen, they are processed in the same order as they appear on the selection screen. After the processing of the first trigger has been confirmed, press PF3 or PF15 (End) for the next trigger. Note: If more than one trigger was selected, each trigger is processed individually. Processing occurs in the same order as the triggers are listed on the selection screen. Press PF3 or PF15 (End) for the Alter Trigger screen with the next trigger.

Drop Trigger According to DB2 rules, a trigger can be dropped by a privilege set that is defined below and must include at least one of the following: ■

Ownership of the trigger



The DROPIN privilege for the schema or all schemas



SYSADM or SYSCTRL authority

Chapter 26: Triggers 683

Drop Trigger

The authorization ID that matches the schema name implicitly has the DROPIN privilege on the schema. See the CA RC/Update User Guide for more information about dropping an object.

684 User Guide

Chapter 27: Routines This section contains the following topics: User Defined Functions (see page 685) Stored Procedures (see page 685) Routine Processing (see page 686) DDL Requirements (see page 686) Migrate a Routine (see page 690) Migrating an SQL Stored Procedure (see page 692)

User Defined Functions User defined functions (UDFs) are routines registered to DB2 using CREATE FUNCTION DDL. A user-defined function can be an SQL function, an external function, or a sourced function. A UDF is in contrast to a built-in function that DB2 supplies. Functions extend the database system and are used in SQL statements. A UDF is uniquely determined by its name, schema, routine-type (UDF versus stored procedure), and the data types of its first 30 parameters. Note: You can reference routines by a trigger, a view, or application logic (for example, external program and SQL procedure statements).

Stored Procedures Stored procedures (SPs) are user-written routines registered to DB2 using the CREATE PROCEDURE statement. An SQL statement can invoke a stored procedure. An SP is uniquely determined by its name, schema, and routine-type (stored procedure versus UDF). Note: You can reference routines by a trigger, a view, or application logic (for example, external program and SQL procedure statements).

Chapter 27: Routines 685

Routine Processing

Routine Processing CA RC/Migrator provides support for the migration of routines only. Create, Template, Alter, and Compare operations for routines are not provided. A UDF/SP is treated as if it is composed of two components. One component is the UDF/SP definition component (for example, declaration or DB2 registration piece). The other component is the UDF/SP implementation component (for example, the UDF/SP text or body). CA RC/Migrator supports migration of the definition component. For SQL scalar functions and sourced functions, migration of the implementation component is also supported. If an SQL stored procedure's implementation text is not available in the catalog, the definition component of the SQL stored procedure is generated as comments. Comments are used to view the SP's attributes but to prevent interference with the usual methods (JCL, SQL procedure processor DSNTPSMP, IBM Stored Procedure Builder) used to create an SQL procedure. Note: ■

Global changes for routines and edits to routines within a strategy are not currently supported.



VSAM and PDS access are not supported when accessing SYSROUTINES_SRC and SYSROUTINES_OPTS.



The EXTERNAL NAME clause is removed to enable DSNTPSMP to generate an external name.

DDL Requirements When a routine is defined to DB2, it can accept zero or more table parameters. However, when the routine is migrated, a table using a table parameter might not exist. To generate the proper routine definition, CA RC/Migrator must generate and commit CREATE TABLE DDL for all transient table parameters. The transient table columns must match in data type, length, precision, scale, and encoding scheme to the description of the UDF/SP table parameter's columns used when the UDF/SP was originally created. The UDF/SP CREATE DDL syntax prohibits the use of a declared temporary table. In addition, the maximum record size of the table and the CCSID of string data columns in the table must be considered.

686 User Guide

DDL Requirements

Size Considerations The maximum record size of a table depends on the page size of the tablespace. To handle any possible table size, CREATE TABLE DDL in a tablespace that uses the largest page size is needed. CA RC/Migrator does not have any knowledge of whether such a tablespace is present on the target subsystem. Therefore, to generate a CREATE TABLE, CREATE TABLESPACE having the largest possible page size is needed to contain the TABLE. Note: An implicit creation of a tablespace using a CREATE TABLE is unreliable. An implicitly created tablespace resides in the default database (DSNDB04) and will “inherit” the page size (buffer pool) specified for DSNDB04. This inherited value might be inadequate to accommodate the maximum record size needed by the table.

Encoding Scheme Considerations The CCSID clause of CREATE TABLE specifies the encoding scheme for string data (columns) stored in a table. The value must agree with the encoding scheme for the tablespace. This restriction is handled by explicitly including a CCSID clause in the same CREATE TABLESPACE statement that is generated to address the maximum record size concern. A tablespace is needed for each CCSID required by the UDF/SP table parameters selected for migration.

Additional Considerations The generation of CREATE TABLE and CREATE TABLESPACE DDL introduces additional concerns: ■

Generated TABLE and TABLESPACE keys must be unique.



The largest possible page size, as determined by the buffer pool name specified in a CREATE TABLESPACE, must identify an activated buffer pool on the target subsystem.

Generating multiple unique TABLE and TABLESPACE keys is handled by requiring that the key's CREATOR-component (for tables) and DBNAME-component (for tablespaces) be specified (through the MIGRATOR parmlib member), under which any table or tablespace name can be freely created and destroyed by CA RC/Migrator. The generated table names follow the sequence T1, T2, and so on as needed by the UDF/SP. The generated tablespace DBNAME-components are CATSA, CATSE, and CATSU for ASCII, EBCIDIC, and Unicode encoding schemes respectively.

Chapter 27: Routines 687

DDL Requirements

Using a user-specified database requires that a transient CREATE DATABASE statement be generated. The generated statement uses a specified buffer pool (through the MIGRATOR parmlib member) that satisfies the largest possible page size requirement and that is activated on the target subsystem. Note: CA RC/Migrator assumes that CURRENT RULES is DB2 so that creates of tables that contain LOB columns does not result in the implicit creation of LOB tablespaces, auxiliary tables, and indexes on auxiliary tables. To allow for the possibility of a large number of table parameters to define a specific UDF/SP, the generated transient tables are dropped after each UDF/SP has been created. After all UDF/SPs selected for migration have been created, the generated transient database (and tablespaces) is dropped.

688 User Guide

DDL Requirements

DDL Statement Generation Sample To migrate one or more UDF/SPs, a sequence of DDL statements similar to the following are generated: CREATE DATABASE BUFFERPOOL ; CREATE TABLESPACE IN DEFINE NO CCSID ASCII CREATE TABLESPACE IN DEFINE NO CCSID EBCDIC CREATE TABLESPACE IN DEFINE NO CCSID UNICODE CREATE TABLE .… IN . CREATE TABLE .… IN . : CREATE TABLE .