IBM i More Helpful Tips

 

Helpful tips text with vintage businessman using laptop


HMC Update / Upgrade Tasks
Note: These were written on a Power 9 HMC @ V9R2M952.
Important note to "Backup Management Console Data" before and after running these processes.

How to Update or Upgrade Server Firmware (DSPFMWSTS) to a Specific Level Using the HMC.
Example: Moving from 01VL950.105.045 (FW950.50) to 01VL950.111.045 (FW950.60)

Note: These instructions show an older HMC.                                                                                           If you're using an HMC 7063-CR1 or later, click on the managed system needed.                                Click the "Actions" arrow.                                                                                                                     Click "Updates".                                                                                                                                       Click "Change Licensed Internal Code".                                                                                                 Select either "For the current release" or "To a new release".                                                              Follow the instructions starting with step 3 on the link below.                                                              How to Update or Upgrade Server Firmware (DSPFMWSTS) to a Specific Level Using the HMC     


----------------------------------------------------------------------------------------------------------------------------------------

How to Update an HMC iFix Using the HMC.
Example: Moving from MH01938 to MH01944.

Logon to the HMC 
  In the navigation bar area: 

Click HMC Management > Console Management 
  In the Console Management panel, Click Updates.   
 The "Install HMC Corrective Service Wizard" panel is displayed. 
  On the Current HMC Driver Information panel, click Next. 
  On the Select Service Repository panel, Click Remote Server, Click Next. 

  On the Installation and Configuration Options panel: 
Remote Server: service.boulder.ibm.com 

User ID: anonymous  
    Password: [your email address]  
  Remote directory: /software/server/hmc/fixes, Click Next. 
  Wait while a list of available updates is retrieved. 

  On the Select Service Package panel, scroll down to needed file, 

Click to select, Click Next.  

Tip: You can use your browser's find feature (Ctrl+f on the HMC) to search for

 the package. 

On the Confirm Service Installation panel, click Finish. 

The HMC Install Corrective Service Progress panel indicates 

"Corrective Service installation was successful". 

Click OK. 

Restart the HMC after the installation of the update completes. 

The restart ensures all changes are available immediately. 

    To restart immediately, click Yes. 

 ------------------------------------------------------------------------------------------------------------------------------------

How to Update an HMC Service Pack Using the HMC.
Example: Moving from V9R2M952 to V9R2M953.

 Logon to the HMC 

  In the navigation bar area: 

Click HMC Management > Console Management 
  In the Console Management panel, Click Updates.   
 The "Install HMC Corrective Service Wizard" panel is displayed. 
  On the Current HMC Driver Information panel, click Next. 
  On the Select Service Repository panel, Click Remote Server, Click Next. 
  On the Installation and Configuration Options panel: 

Remote Server: service.boulder.ibm.com 

User ID: anonymous  

    Password: [your email address]  

  Remote directory: /software/server/hmc/updates, Click Next. 

  Wait while a list of available updates is retrieved. 

  On the Select Service Package panel, scroll down to needed file, 

Click to select, Click Next.  

Tip: You can use your browser's find feature (Ctrl+f on the HMC) to search for

 the package. 

On the Confirm Service Installation panel, click Finish. 

The HMC Install Corrective Service Progress panel indicates 

"Corrective Service installation was successful". 

Click OK. 

Restart the HMC after the installation of the update completes. 

The restart ensures all changes are available immediately. 

    To restart immediately, click Yes. 

------------------------------------------------------------------------------------------------------------------------------------

Here's a neat SQL that will tell you who answered a QSYSOPR message.                                          Much easier than searching the message queue or QHST LOG.                                                      Change the date range as needed or run a single date: 

Suggested to run in ACS "Run SQL Scripts".                                                                                           Will also run in STRSQL.                                                                                                                   Note: In STRSQL, run either the single date or the range of dates.                                             Comment lines are NOT ignored in STRSQL.

--- Who answered the message? ---
--- Columns prefixed with the "A" come from the error result, and those "B" from the reply result. ---

SELECT A.MESSAGE_TIMESTAMP AS "Date/Time of Error Msg",
       A.MESSAGE_ID AS "Msg ID",
       A.FROM_JOB AS "Job Generated Error Msg",
       A.MESSAGE_TEXT AS "Msg Text",
       B.MESSAGE_TIMESTAMP AS "Reply Date/Time",
       SUBSTR(B.MESSAGE_TEXT, 110AS "Reply",
       A.FROM_USER AS "Reply by"
    FROM TABLE (QSYS2.MESSAGE_QUEUE_INFO(QUEUE_LIBRARY => 'QSYS',
                QUEUE_NAME => 'QSYSOPR'
                SEVERITY_FILTER => 99)) A,
         LATERAL (SELECT MESSAGE_TIMESTAMP,
                    MESSAGE_TEXT, FROM_USER
                 FROM TABLE (QSYS2.MESSAGE_QUEUE_INFO(QUEUE_LIBRARY => 'QSYS'
                             QUEUE_NAME => 'QSYSOPR',
                             SEVERITY_FILTER => 99))

---  Single Date             
---     WHERE CHAR(A.MESSAGE_TIMESTAMP) LIKE '%2024-01-15%'
---         AND ASSOCIATED_MESSAGE_KEY = A.MESSAGE_KEY) B
                   
---  Range of Dates               
                WHERE CHAR(A.MESSAGE_TIMESTAMP) >= '2024-01-07' AND 
                              CHAR(A.MESSAGE_TIMESTAMP) <= '2024-01-16'
                  AND ASSOCIATED_MESSAGE_KEY = A.MESSAGE_KEY) B 
          
     ORDER BY "Date/Time of Error Msg" ASC

------------------------------------------------------------------------------------------------------------------------------------     

Miscellaneous:

CL Example Using the STRPCCMD Command

SSL/TLS FTP Client Configuration for Fix Central Secured FTP Downloads (FTPS) 

(FTPS) IBM i Configuring system secure sockets layer (SSL)/transport layer security (TLS) protocols and cipher suites       

IBM i TLS FTP Client Configuration

How to Enable Transport Layer Security (TLS) for the IBM Web Administration Server (HTTPAdmin) 

How To Disable TLS for the ADMIN HTTP Server and ADMIN1 and ADMIN3 Application Servers  

IBM i Getting a list of all TCP/IP Addresses Used in Remote Output Queues or LAN Printer Devices    

IBM i How to disable TCP/IP ports for host servers 

IBM i Retrieve TCP/IP Information RTVTCPINF - Create a library like this RTVTCPLIB for example 

IBM i ObjectConnect Now Runs Over a TCP/IP Server STRTCPSVR(*OBJC) 

IBM i Copying Licensed Keys Between LPARs in the Same IBM i System 

IBM i Best Practices for Applying LIC PTFs (MFxxxxx) to Replace a Defective PTF

IBM i Licensed Program Releases and Sizes (Chg VxRx as needed)  

IBM i How to Change the Ports ADMIN Server Uses 

IBM i How to end a large amount of jobs with similar names quickly

IBM i Methods to encrypt saves  

IBM i Object statistics table function. Great SQL info extraction for your systems

IBM i Program QWCCRTEC: prints report on time spent in IPL phases/steps 

IBM i Tracking IP addresses for invalid sign-on attempts 

IBM i Using API QVOIFIMG to add IFS image catalog entries to WRKIMGCLG

IBM i Who is Using Port 23 or 992?  

IBM i GO SAVE: Option 21 (Saving the Entire System) and more. 

IBM i Determining When an Object was Last Saved (Chg VxRx as needed) 

IBM i Verifying GO RESTORE Option 21 was Successful 

IBM i "SAV" commands with ZLIB Data Compression  

IBM i History of Connections

IBM i Creating a Report for Users that Connect via ODBC/JDBC using Audit Value *JOBDTA 

IBM i Creating a One Page PDF File from a Spooled File

Changing the TCP/IP Address of the IBM i System 

IBM i QSPL Physical File Damage 

How to Format IBM i TRCCNN and CMNTRC Communication Traces to .pcap Files (Wireshark Format)

Locate Objects Marked Damaged - Navigate to section below.

------------------------------------------------------------------------------------------------------------------------------------

 2 ways to tell the last IPL date of an IBM i partition (V7R2+):

Solution 1
    - WRKACTJOB JOB(*SYS) <enter>. Page down to the SCPF job.
   - Put a '5' on it <enter> Option 1 <enter>

A screen similar to this will be displayed:

 Job:   SCPF           User:   QSYS           Number:   000000
 Status of job . . . . . . . . . . . . . . . :   ACTIVE       
Current user profile  . . . . . . . . . . . :   QSYS         
Job user identity . . . . . . . . . . . . . :   QSYS         
  Set by  . . . . . . . . . . . . . . . . . :     *DEFAULT   
Entered system:                                              
  Date  . . . . . . . . . . . . . . . . . . :   10/23/22     
  Time  . . . . . . . . . . . . . . . . . . :   15:11:41     
Started:                                                     
  Date  . . . . . . . . . . . . . . . . . . :   10/23/22     
  Time  . . . . . . . . . . . . . . . . . . :   15:11:41     

Solution 2

Try this SQL statement: Run using ACS Run SQL Scripts.
Will also run on 5250 green screen STRSQL.

 SELECT message_timestamp FROM TABLE  
  (QSYS2.JOBLOG_INFO('000000/QSYS/SCPF')) A
    Order by ordinal_position
      ASC limit 1
        Offset 0

 Result:

MESSAGE_TIMESTAMP
2022-10-23 15:11:41.923690

------------------------------------------------------------------------------------------------------------------------------------

Code to convert all WRKQRY's / QMQRY's to SQL.

Note: Create an SQL source physical file to hold each WRKQRY / QMQRY that
will be converted to an SQL source file member. I used SQLLIB for this.

          CRTLIB SQLLIB - The library for holding the CLLE / SQL source members.
          CRTSRCPF SQLLIB/QSQLSRC RCDLEN (112)
          CRTSRCPF SQLLIB/QCLSRC RCDLEN (112)       

 Add source code below to QCLSRC file in the library of your choosing                                                     or SQLIB/QCLSRC 

CRTDUPOBJ of file QADSPOBJ to file QGPL/QRYLIST so the record format of the DSPOBJD command works.                                             

           Compile the source code.
          
Program name: QRYREF.

           SBMJOB to Call SQLLIB/QRYREF and let run to completion.
           Every WRKQRY / QMQRY will be converted to an QSQLSRC member in                                              library SQLLIB.

Note: I copy and paste the various SQL source members to ACS Run SQL Scripts. 
         Recall, library/file becomes schema.table so testlib/testfile will have to be                                               updated to testlib.testfile. 


  /***************************************************/  
 /* QRYREF                                                     */                                                /****************************************************/  

 PGM                                                               
 DCLF FILE(QADSPOBJ)                                               
 DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*QRYDFN *QMQRY) +                
                   OUTPUT(*OUTFILE) OUTFILE(QGPL/QRYLIST)                                                                           OVRDBF FILE(QADSPOBJ) TOFILE(QGPL/QRYLIST)                          
   LOOP1:                                                              
   RCVF                                                                
   MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(LOOP2))                      
   RTVQMQRY QMQRY(&ODLBNM/&ODOBNM) +                                   
   SRCFILE(SQLLIB/QSQLSRC) ALWQRYDFN(*YES)                               
   GOTO CMDLBL(LOOP1)                                                  
   LOOP2:                                                              
   DLTOVR FILE(*ALL)                                                   
   ENDPGM    

  /******************************************************/     

------------------------------------------------------------------------------------------------------------------------------------                                                                          
 
Or another way to locate IBM i Damaged Objects is by using ACS Run SQL Scripts this way - simply copy and paste this into ACS Run SQL Scripts. Decide which 
"Select" statement to use.
 
--- Steps to output all system objects to an outfile.
--- Make sure to create duplicate object of QADSPOBJ to whatever the 
--- outfile is. Failure to do so will result in the process not running.
--- Using DMGLIB/DMGOBJ as an example:
--- CRTDUPOBJ OBJ(QADSPOBJ) FROMLIB(QSYS) OBJTYPE(*FILE) 
--- TOLIB(DMGLIB) OBJ(DMGOBJ)                                                                                                        --- CHGPF FILE(DMGLIB/DMGOBJ) SIZE(2500000 10000) (Or larger if needed)                                                                  
--- Part 1: Populate File  
CL:OVRDBF FILE(QADSPOBJ) TOFILE(DMGLIB/DMGOBJ);
CL:DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE)                                                         OUTFILE(DMGLIB/DMGOBJ) OUTMBR(*FIRST *REPLACE)
 
--- Part 2: Locate Damaged Objects
--- Can trade out the * for specific fields ---
Use either SELECT statement.
SELECT *
 FROM DMGLIB.DMGOBJ
  WHERE ODOBDM <> '0'
 
OR 
 
SELECT ODLBNM, ODOBNM, ODOBTP, ODOBAT  
 FROM DMGLIB.DMGOBJ 
  WHERE ODOBDM <> '0'
 
------------------------------------------------------------------------------------------------------------------------------------

Here's 2 methods to delete old spooled files when the DLTSPLF command isn't enough. 
 
This is IBM's link to their "Delete Old Spool Files" procedure.
 
The procedure defintion itself can be located on Nav for i by opening "System" then
"SQL Services". Filter by "SYSTOOLS". Page down until you see this.
This will give you the procedure properties and a run example.
 
 
This can be run from "Run ACS SQL Scripts". It's up to you to set up the parameters.
 
--- Delete old spooled files ---
--- Preview = 'YES' is to review spooled files ---
--- Preview = 'NO' is to delete spooled files ---

--- NOTE: The SQL MUST be in CAPITAL letters ---
--- Single quotes encase the library name, outq name and preview value.

CALL SYSTOOLS.DELETE_OLD_SPOOLED_FILES(DELETE_OLDER_THAN => CURRENT DATE - 30 DAYS,
P_OUTPUT_QUEUE_LIBRARY_NAME => 'TESTLIB',
P_OUTPUT_QUEUE_NAME => 'TESTFILE',
PREVIEW => 'NO'); 
 
**********************************************************
 
This CLLE program can be run standalone and/or be added to the job
scheduler or your startup program. It's up to you to set the parameters.
Note the double qotes " " enclosing the library name, outq name and 
preview value.

*************************************************************                                                                 PGM                                                                                                                                                                  RUNSQL ('CALL SYSTOOLS.DELETE_OLD_SPOOLED_FILES(DELETE_OLDER_THAN => CURRENT DATE - 30 DAYS, +                                                                                                          P_OUTPUT_QUEUE_LIBRARY_NAME => ''TESTLIB'', +                                          P_OUTPUT_QUEUE_NAME => ''TESTFILE'', +                                                                                      PREVIEW => ''NO'')')                                                                                                                       ENDPGM                                                                            **************************************************************







No comments:

Post a Comment