, , 5 requêtes pour contrôler vos PTFS

On ne dira jamais assez comment à quel point SQL nous simplifie la vie.
C’est d’autant plus vrai pour la gestion des correctifs

Voici 5 requêtes à garder pour vos contrôles de PTFs

1) Contrôle de la TR et de la version avec QSYS2.GROUP_PTF_INF


SELECT CURRENT SERVER CONCAT ‘ est en version ‘ CONCAT PTF_GROUP_TARGET_RELEASE
CONCAT ‘ et le niveau de TR est : ‘ CONCAT PTF_GROUP_LEVEL AS NIVEAU_DE_TECHNOLOGY_REFRESH
FROM QSYS2.GROUP_PTF_INFO WHERE PTF_GROUP_DESCRIPTION = ‘TECHNOLOGY REFRESH’
AND PTF_GROUP_STATUS = ‘INSTALLED’ ORDER BY PTF_GROUP_TARGET_RELEASE DESC
FETCH FIRST 1 ROWS ONLY

2) Contrôle des cumulatives sur le microcode et l’OS avec QSYS2.PTF_INFO

with result_ptf
as(
SELECT PTF_PRODUCT_ID , Max(PTF_IDENTIFIER) as last_ptf
FROM QSYS2.PTF_INFO
WHERE (PTF_PRODUCT_ID = ‘5770999’ and substr(PTF_IDENTIFIER , 1 , 2) = ‘TL’ ) or
(PTF_PRODUCT_ID = ‘5770SS1’ and substr(PTF_IDENTIFIER , 1 , 2) = ‘TC’ ) GROUP BY PTF_PRODUCT_ID
)
select PTF_PRODUCT_ID, date(’20’ concat substr(LAST_ptf, 3, 2) concat ‘-01-01’) +
(dec(substr(Last_PTF , 4, 3)) – 1 ) days as last_date_ptf
from result_ptf
where date(’20’ concat substr(LAST_ptf, 3, 2) concat ‘-01-01’) +
(dec(substr(Last_PTF , 4, 3)) – 1 ) days < (current_date – 6 months)

3) Contrôle si groupes à télécharger, nécessite une connexion avec SYSTOOLS.GROUP_PTF_CURRENCY


select
cast(substr(PTF_GROUP_TITLE, 1, 50) as char(50)) as Nom_groupe,
PTF_GROUP_LEVEL_AVAILABLE as niveau
from systools.group_ptf_currency
where ptf_group_level_installed <> ptf_group_level_available

4) Contrôle si groupes à appliquer, nécessite un IPL avec QSYS2.GROUP_PTF_INFO

SELECT * FROM GROUP_PTF_INFO WHERE PTF_GROUP_STATUS not in
(‘INSTALLED’, ‘RELATED GROUP’, ‘NOT APPLICABLE’))

5) Contrôle du firmware, nécessite une connexion avec SYSTOOLS.FIRMWARE_CURRENCY

SELECT * FROM SYSTOOLS.FIRMWARE_CURRENCY
WHERE FW_CURRENTFIXPACK <> FW_RECOMMENDED_UPGRADE and +
FW_RECOMMENDED_UPGRADE is not null ) with data

Remarque

Il en existe sans doute d’autres, la limite c’est votre imagination …