Creating, altering, or dropping Db2 objects
Creating, altering, or dropping Db2 objects in ALTER or
BMC AMI Change Manager for Db2
is a three-stage process: specification, analysis, and execution.
Specification
Specify the changes that you want to make to the objects.
Analysis
Analyze the specified changes for accuracy and completeness. The result of the analysis stage is a worklist that contains the SQL and the information that is necessary to change the data structures and preserve all dependent objects.
Execution
Execute the worklist that is generated during the analysis stage.
For more information, view the Quick Course CHANGE MANAGER for DB2 - Performing Specification . |
The following example illustrates these stages by showing you how to use the Task List feature of Change Manager to quickly and easily change the length of a column in a table in your database.
Before you begin a set of tasks to achieve a particular goal, you should allocate your JCL data sets for analysis and execution, ensure that you are using the correct Db2 subsystem, and define your job card with the correct account information.
To modify objects
- Start the Task List feature.The Task List feature of Change Manager enables you to achieve various goals by taking you step-by-step through a series of tasks.
On the BMC AMI Change Manager for Db2 Main Menu (see Main Menu), select Task List and press Enter.
ALUFTASK ------------------------- Task List Menu -----------------------------
Command ===>
Select a task. Then press Enter.
1 1. Create, alter, or drop Db2 objects
2. Migrate Db2 objects using Specification
3. Migrate Db2 objects using scope rules from a Migrate Profile
Commands: HELP ENDOn the Task List Menu, select Create, alter, or drop DB2 objects and press Enter.
ALUFPALT -------------------- Create, Alter, or Drop Db2 Objects --------------
Command ===>
Specify an Alter WORKID.
If the WORKID does not exist, the Create WORKID panel will be displayed.
To see a list of WORKIDs, type a wildcard pattern. (For example BM*.*)
Alter WORKID: RDACRJ.RCB0831E
Type S to select processing options. Then press Enter to continue.
_ Create or edit a WORKID
_ Specify changes to Db2 objects
_ Analyze the changes to create a worklist
_ Execute the worklist to process the changes
Commands: HELP END
- Specify an alter-type work ID.A work ID enables you to identify, control, and track a unit of work. The alter-type work ID is used to store the changes to the Db2 objects that you specify.
On the Create, Alter, or Drop DB2 Objects panel, type the name of an alter-type work ID, type S to select all of the processing options, and press Enter.The Create WORKID panel is displayed.
ALUFWRKC -------------------------- Create WORKID ----------- WORKID NOT FOUND
Command ===>
WORKID . . . . . . : RDACRJ.RCB0831E
Type . . . . . . . . 1 1. Alter
2. Migrate
3. Receive
Comment . . . . . .
Select additional panels to display for Migrate type WORKID. Then press Enter.
_ WORKID Migrate Options
_ WORKID Change Rules
Commands: HELP END CANCELOn the Create WORKID panel, select Alter for the Type. Then, press Enter.
ALUSOS TER ---------------------- Object Specification ----------------------
Command ===>
WORKID . . . : RDACRJ.RCB0831E _ Changed Objects List
Specify the object type(s) to be included in a list.
Stogroup. . (SG Name)
Database. . R1BAS504 (DB Name)
Tablespace (DB.TS Name)
Table . . . (Own.TB Name)
Check Cnst (Own.TB.Chk )
Foreign Key (Own.TB.Rel )
Index . . . (Own.IX Name)
Unique Cnst (Own.TB.Uniq)
View. . . . (Own.VW Name)
Trigger . . (Sch.TR Name)
Alias . . . (Own.AL Name)
Synonym . . (Own.SY Name)
Permission (Sch.RP Name)
Mask. . . . (Sch.MK Name)
The following objects are retrieved independently of all other Db2 objects.
Sequence. . (Sch.SQ Name)
Stored Proc (Sch.SP Name)
- Specify the changes that you want to make to the objects.The current values of the objects are displayed on panels. You can modify the attributes for objects by specifying new values or by typing new values over the existing values. All of your changes are stored in Db2 tables.
On the Object Specification panel, type the name of your database, table space, and table. Then, press Enter.From the Mixed List panel, you begin the process of specifying changes to the objects that are listed.
ALUSMXL ER --------------------------- Mixed List ---------------------------
Command ===> Scroll. . CSR
WORKID . . . . : RDACRJ.RCB0831E Commands: CANCEL
Type action next to object and press Enter.
E=Edit L=Like D=Drop U=Undo
Objects 1 to 21 of 28
More: +
Act Object-Type Objects
************************************ TOP **************************************
DB . . . . . . R1BAS504
TSR. . . . . R1BAS504 T05APBR
TBT. . . . R1BAS504 T_T05APBR
IXT. . . R1BAS504 I_T05APBR<>RTITIONED
IXCT . . R1BAS504 I_T05APBR<>TITIONING
IX . . . R1BAS504 I_T05APBR2
VW . . . R1BAS504 V_T05APBR1
VW . . R1BAS504 V_T05APBR2
TSG. . . . . R1BAS504 T06APBG
TB . . . . R1BAS504 T_T06APBG
IXUC . . R1BAS504 I_T06APBG1
IX . . . R1BAS504 I_T06APBG2
IX . . . R1BAS504 I_T06APBG3
TSG. . . . . R1BAS504 T07APBG
TB . . . . R1BAS504 T_T07APBG
CK . . . R1BAS504 T_T07APBG C_T07APBG
IXC. . . R1BAS504 I_T07APBG_1
TSR. . . . . R1BAS504 T08APBR
TBT. . . . R1BAS504 T_T08APBR
IXT. . . R1BAS504 I_T08APBR<>RTITIONED
IXCT . . R1BAS504 I_T08APBR<>TITIONINGOn the Mixed List panel, in the Act field type E next to the table that you want to edit and press Enter.
ALUS2TB ER -------------------------- Table Detail --------------------------
Command ===>
WORKID . . . . : RDACRJ.RCB0831E
New Values
TB Owner : R1BAS504 .
TB Name : T_T05APBR .
Database Name . : R1BAS504 . . :
Tablespace Name : T05APBR . . :
Audit . . . . . : NONE . . . (NONE,ALL,CHANGES)
Validproc . . . : . . .
Editproc . . . : . . .
With Row Attr . : . . . (Y,N)
Data Capture . : N . . . (Y,N)
Restrict Drop . : N . . . (Y,N)
Obid . . . . . : 3 . . .
Volatile . . . : N . . . (N,Y)
Append . . . . : N . . . (N,Y)
Label: . . .
Link History TB : . . . (N,Y,E)
Link Archive TB : . . . (N,Y)
Table Access . : . . . (C,R,B,blank)
CCSID . . . . . : EBCDIC Partitions . . : 4 (Table Controlled)
Key Label . . . : . . .
_ Convert to Index Controlled Partitioning
_ Convert to Materialized Query Table
Select additional panels to display then press Enter.
_ Table Column List _ Table Comment
_ Primary Key Columns _ Auxiliary Objects List
_ Partitioning Key Columns _ Parts List and LimitKey Values
_ MQT Parameters _ Implicit TS Dssize
_ History Table Information _ Archive Table Information
Commands: HELP END CANCEL PF4=ZOOMOn the Table Detail panel, type S to select the Table Column List, and press Enter.The Table Columns List panel displays the current column attributes for the table. In this example, you will change the length of a column.
ALUSTBC ER ----------------------- Table Columns List -----------------------
Command ===> Scroll. . CSR
WORKID . . . . : RDACRJ.RCB0831E Commands: CANCEL
Table Owner . . : R1BAS504
Table Name . . : T_T05APBR
Type action next to object and press Enter.
E=Edit L=Like I=Insert D=Drop U=Undo CM=Comment ID=Identity_Detail
DV=Default_Value AX=Aux_Obj_List CAX=Create_Aux_Obj Lines 1 to 17 of 17
More: >
Act Column Name ..+....20...+....30. Column Type Length Nl Df Hi UDT
*** ******************************** TOP **************************************
COLC_1 CHAR 50 N N
COLSI_2 SMALLINT N N
COLIN_3 INTEGER N N
COLSI_4 SMALLINT N N
COLDC_5 DECIMAL 6,2 N N
COLDC_6 DECIMAL 9 N N
COLDC_7 DECIMAL 5,2 N N
COLVC_8 VARCHAR 15 N N
COLF1_9 FLOAT 21 N N
COLF2_10 FLOAT 53 N N
COLVC_11 VARCHAR 15 N N
COLDT_12 DATE N N
COLTS_13 TIMESTAMP 6 N N
COLC_14 CHAR 100 N N
COLVC_15 VARCHAR 1000 N N
COLBN_16 BINARY 5 N N
COLVB_17 VARBIN 10 N N
*** ******************************* BOTTOM ************************************- On the Table Columns List panel, tab to the Length field for the column that you are modifying. Type a new value for the length of the column over the existing value. Press Enter.
Press END to return to the Table Detail panel. Press END again to return to the Mixed List Panel.The Mixed List panel displays an '*A' next to the table, indicating that you have made a change to the table.
ALUSMXL ER --------------------------- Mixed List ---------------------------
Command ===> Scroll. . CSR
WORKID . . . . : RDACRJ.RCB0831E Commands: CANCEL
Type action next to object and press Enter.
E=Edit L=Like D=Drop U=Undo
Objects 1 to 19 of 28
More: +
Act Object-Type Objects
************************************ TOP **************************************
DB . . . . . . R1BAS504
TSR. . . . . R1BAS504 T05APBR
*A TBT. . . . R1BAS504 T_T05APBR
IXT. . . R1BAS504 I_T05APBR<>RTITIONED
IXCT . . R1BAS504 I_T05APBR<>TITIONING
IX . . . R1BAS504 I_T05APBR2
VW . . . R1BAS504 V_T05APBR1
VW . . R1BAS504 V_T05APBR2
TSG. . . . . R1BAS504 T06APBG
TB . . . . R1BAS504 T_T06APBG
IXUC . . R1BAS504 I_T06APBG1
IX . . . R1BAS504 I_T06APBG2
IX . . . R1BAS504 I_T06APBG3
TSG. . . . . R1BAS504 T07APBG
TB . . . . R1BAS504 T_T07APBG
CK . . . R1BAS504 T_T07APBG C_T07APBG
IXC. . . R1BAS504 I_T07APBG_1
TSR. . . . . R1BAS504 T08APBR
TBT. . . . R1BAS504 T_T08APBR
IXT. . . R1BAS504 I_T08APBR<>RTITIONED
IXCT . . R1BAS504 I_T08APBR<>TITIONINGPress END to return to the Object Specification panel. Press END again.The Analysis Alter Worklist Interface panel is displayed.
ACMFANL1 ---------------- Analysis Alter Worklist Interface -------------------
Command ===>
WORKID . . . . . : RDACRJ.RCB0831E
Analyze "Alter" WORKID
Select type of analysis.
1 1. Generate a worklist which will convert and reload current data.
2. Generate a worklist which will convert and reload current data and
establish a full recovery baseline.
3. Generate a worklist which will reload data from a previous
full recovery baseline.
Select run type. Then press Enter.
Run Type . . . . 1 1. Foreground
2. Batch
Commands: HELP END
- Analyze the changes that you specified.The Analysis component of the product examines the changes that you specified to determine the effect that the changes have on the structure and the related or dependent objects.
On the Analysis Alter Worklist Interface panel, select the option to Generate a worklist which will convert and reload current data. Then select to run the analysis in Foreground. Press Enter.
The Analysis JCL Processing Interface panel is displayed.
ACMFANL3 ---------------- Analysis JCL Processing Interface -------------------
Command ===>
WORKID . . . . : RDACRJ.RCB0831E
Specify Dataset Names
Worklist . . . . . 'ACM.DB2V12.V121.WLBASE01(RCB0831E)'
Diagnostics . . . . SYSOUT
Sysout Class . . . X (Used only when Diagnostics = SYSOUT)
Select foreground processing options. Then press Enter.
_ Override
S Create analysis input
S Edit analysis input
_ Run analysis
_ Edit Worklist
Commands: BROWSE PREVIOUS HELP ENDOn the Analysis JCL Processing Interface panel, type the name of your Worklist, and type S to select your processing options. Press Enter.The input for the Analysis process is displayed. The input includes the ALUIN input stream, which provides keywords for analyzing the changes. For more information about the input stream, see ALUIN-keywords.
ISREDDE2 SYS20244.T152350.RA000.RDACRJ.WLIN.H05 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
==MSG> -Warning- The UNDO command is not available until you change
==MSG> your edit profile using the command RECOVERY ON.
000001 SSID DELT
000002 WORKID RDACRJ.RCB0831E
000003 SORTDEVT SYSDA
000004 INCLUDE (DATA AMS SQL REBIND )
000005 SMSINCLUDE ()
000006 IBMUNLOAD IBMLOAD NOUSENGTUL
000007 IBMREORG NOUSENGTR
000008 NODBRMLIB ORDERBY
000009 NOVVALPROP
000010 UNLOADEMPTY NOSTOPCOMMIT TABLEACCESS NOAPPLCOVR IBMCHECK
000011 NOREORGALT
000012 REORGONLINE DYNREORG REORGALL REORGREF
000013 IBMREBUILD
000014 SYNCPOINT 10
000015 NOROLEOWN
000016 STANDALONESTATS DB2STATSUPD TABLEALL NOKEYCARD NOHISTORY
000017 IBMCOPY
000018 SPANNEDRECS
000019 NOBINDONIX
000020 MAXSYSUT 20
000021 DYNCOPY
000022 NOPARTCOPY
000023 COPYDDN(COPY01 )
000024 NOUTILCOPY
000025 NOPARALLEL CLONEDATA
000026 NOREGENIDENTITY
****** **************************** Bottom of Data ****************************- Press F8 to scroll down the input. Press END.
- Press Enter to run Analysis.The results of Analysis are a diagnostic output file (ALUPRINT) and a worklist.
To review the results of Analysis (ALUPRINT), you can split your ISPF session or you can use your normal method to review SYSOUT. The last message in the diagnostic output indicates that the worklist completed successfully.
SDSF OUTPUT DISPLAY RDACRJ T0254246 DSID 113 LINE 0 COLUMNS 02- 81
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
SSID DELT
WORKID RDACRJ.RCB0831E
SORTDEVT SYSDA
INCLUDE (DATA AMS SQL REBIND )
SMSINCLUDE ()
IBMUNLOAD IBMLOAD NOUSENGTUL
IBMREORG NOUSENGTR
NODBRMLIB ORDERBY
NOVVALPROP
UNLOADEMPTY NOSTOPCOMMIT TABLEACCESS NOAPPLCOVR IBMCHECK
NOREORGALT
REORGONLINE DYNREORG REORGALL REORGREF
IBMREBUILD
SYNCPOINT 10
NOROLEOWN
STANDALONESTATS DB2STATSUPD TABLEALL NOKEYCARD NOHISTORY
IBMCOPY
SPANNEDRECS
NOBINDONIX
MAXSYSUT 20
DYNCOPY
NOPARTCOPY
COPYDDN(COPY01 )
NOUTILCOPY
NOPARALLEL CLONEDATA
NOREGENIDENTITY
*BMC396243I DB2 VERSION 12 NFM
*BMC56464I DB2 CURRENT FUNCTION LEVEL IS V12R1M504
*BMC56464I DB2 CATALOG LEVEL IS V12R1M503
*BMC56464I APPLCOMPAT IS V12R1M504
*BMC56464I APPLCOMPAT FROM DSNZPARM IS V12R1M504
*** BMC AMI Change Manager for Db2 12.01.01 PTFs applied:
*** NONE
*** EXECUTION (AEX) 12.01.01 PTFs applied:
*** NONE
***********************************************************************
*** WORKLIST GENERATION 2020-08-31-15.24.34.844186
*** BMC AMI Change Manager for Db2 VERSION 12.01.01(10/15/2020)
*** CURRENT SPE LEVEL SPE2010 (BQU2829)
WORKLIST GENERATION EXECUTION FOR WORKID RDACRJ.RCB0831E ON SSID DELT
***********************************************************************
***********************************************************************
*** THE FOLLOWING MESSAGES ARE INFORMATIONAL AND WARNINGS ONLY ***
***********************************************************************
*BMC396243I DB2 VERSION 12 NFM
*BMC396472W CREATE FOR TABLESPACE USING NON UNIVERSAL TABLESPACE SYNTAX
* ON FUNCTION LEVEL V12R1M504 OR GREATER MAY RESULT IN:
* PARTITION BY GROWTH UNIVERSAL TABLESPACE MAXPARTITIONS 256
* PARTITION BY RANGE UNIVERSAL TABLESPACE SEGSIZE <DEFAULT>
*BMC396469W THE FOLLOWING UTILITIES ARE NOT SUPPORTED AT FUNCTION
* LEVEL V12R1M504 OR GREATER ON A COMPRESSED OBJECT USING
* HUFFMAN.
* BMC UNLOAD PLUS / BMC LOADPLUS / BMC REORG PLUS
* THE ANALYSIS PROCESS DOES NOT PREVENT INCLUDING THESE
* UTILITIES IN THE WORKLIST.
*BMC45460W TAPE STACKING DISABLED FOR IBM COPY AND DYNAMIC ALLOCATION
*BMC396431W PROCESSING DFSMS-ENCRYPTED OBJECTS OR OBJECTS THAT WILL BE
* ENCRYPTED AS A RESULT OF PROCESSING MIGHT REQUIRE THE
* KEYLABEL OR DATACLAS PARAMETER IN -AMS WORKLIST COMMANDS.
***********************************************************************
*** END OF WARNING MESSAGES - WARNINGS WERE ISSUED ***
***********************************************************************
WORKLIST WAS WRITTEN TO DATASET 'ACM.DB2V12.V121.WLBASE01(RCB0831E)'
WORKLIST GENERATION COMPLETE WORKID RDACRJ.RCB0831E
******************************** BOTTOM OF DATA ********************************The following figure shows the worklist that was written to the data set that you specified on the Analysis JCL Processing Interface panel.
Press END.The Execution JCL Build Interface panel is displayed.
ACMFEXC0 ------------------ Execution JCL Build Interface ---------------------
Command ===>
WORKID . . . . . : RDACRJ.RCB0831E
Select JCL and run type. Then press Enter.
JCL Type . . 1 1. Build Initial JCL
2. Build Restart JCL from previous execution JCL
3. Build Startover JCL from previous execution JCL
Run Type . . 1 1. Build JCL in Foreground
2. Build JCL in Batch
Commands: NEXT HELP END
Execute the changes that you specified and analyzed.The Execution component of the product uses the worklist as its input job stream and performs the tasks contained in the worklist. The worklist acts as a detailed procedure for implementing the changes that you defined in the specification stage.
On the Execution JCL Build Interface panel, press Enter to accept the defaults.The Execution Pre- and Post-Processing Interface panel is displayed.
ACMFEXC1 ---------- Execution Pre- and Post-Processing Interface --------------
Command ===>
WORKID . . . . . : RDACRJ.RCB0831E
Specify additional steps to be included in this job. Then press Enter.
Pre-Execution Compare
1 1. Do not do a compare before execution
2. Compare two previous baselines
3. Compare a previous baseline to the current catalog
Pre-Execution Baseline
1 1. Do not build a baseline before execution
2. Build a baseline before execution
Post-Execution Compare
1 1. Do not do a compare after execution
2. Compare a previous baseline to the new catalog structures
3. Compare the baseline built during a previous job step to the new
catalog structures
4. Create CDL to fall back to a previous baseline
Post-Execution Baseline
1 1. Do not build a baseline after execution
2. Build a baseline after execution
Commands: HELP PREVIOUS ENDOn the Execution Pre- and Post-Processing Interface Panel, press Enter to accept the defaults.The Execution JCL Processing Interface panel is displayed.
ACMFEXC3 --------------- Execution JCL Processing Interface -------------------
Command ===>
WORKID . . . . . : RDACRJ.RCB0831E
Specify Dataset Names.
Execution JCL . . 'ACM.DB2V12.V121.EXECJCL(RCB0831E)'
Worklist . . . . . 'ACM.DB2V12.V121.WLBASE01(RCB0831E)'
Diagnostics . . . SYSOUT
JCL Build Options.
Dataset Sizing : No Sizing (use Override Defaults to set or change)
Select Processing Options. Then press Enter to continue.
_ Override Defaults
S Edit Worklist
S Build Execution JCL
S Edit Execution JCL
_ Submit Execution JCL
Commands: BROWSE VIEWX PREVIOUS HELP ENDOn the Execution JCL Processing Interface panel, specify the data set name for the Execution JCL, accept the defaults for the JCL build options, and type S to select the processing options. Press Enter.The Execution JCL is displayed. The JCL includes the //AEXIN DD statement (input stream), which includes keywords that are used in executing the JCL. For more information about the input stream, see AEXIN-keywords.
- After you review the JCL, press END to return to the Execution JCL Processing Interface panel.
- From the Execution JCL Processing Interface panel, press Enter to submit the JCL and process your changes.The result of execution is a worklist execution log (AEXPRINT).
To review the results of execution in the worklist execution log (AEXPRINT), you can split your ISPF session or you can use your normal method to review SYSOUT.The last message in the diagnostic output indicates that the work ID status is complete and that the worklist completed successfully. The worklist implemented the structure changes that you specified.
- Press END to return to the Create, Alter, or Drop DB2 Objects panel.
- Press END to return to the Task List Menu panel.
- Press END to return to the BMC AMI Change Manager for Db2 Main Menu.
This example shows that with Change Manager you have the ability to quickly and accurately specify changes to your data structures, perform an in-depth analysis of those changes to determine their effect on your subsystem, and execute SQL and utilities, while collecting statistics on your Db2 objects.
Related topic