Outils pour utilisateurs

Outils du site


bloc_note

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
bloc_note [2025/01/15 08:13] adminbloc_note [2025/03/24 15:27] (Version actuelle) admin
Ligne 2: Ligne 2:
  
 <code> <code>
-$LOG = "/traces/pre_lanceur.log" +        <g id="SANDOUVILLEtransform="matrix(2.91786,0,0,2.64787,-910.867,-504.816)"> 
- + <ellipse cx="475.825cy="305.328rx="0.902ry="0.994style="fill:rgb(216,29,29);"/> 
-function mk_extract_sql { + <g transform="matrix(0.0639002,0,0,0.0708526,474.795,304.48)"> 
-    param ( + <g> 
-        [string]$ORACLE_SID, + <path id="Rectangle-24serif:id="Rectangle-2d="M24,11L26,11L26,13.686L13.686,26L2,13.686L13.686,2L26,2L26,8L24,8L23,5L14.929,5L6.188,13.741L13.742,21.701L23,12.444L24,11Zstyle="fill:rgb(26,26,26);"/> 
-        [string]$FILEOUT + <path id="D4serif:id="D" d="M13.342,17.085C12.996,17.085 12.623,17.074 12.225,17.052C11.827,17.031 11.461,17 11.128,16.96L11.128,9.795C11.504,9.708 11.925,9.64 12.39,9.59C12.855,9.54 13.307,9.515 13.748,9.515C15.191,9.515 16.272,9.823 16.993,10.44C17.713,11.057 18.073,12.01 18.073,13.3C18.073,14.187 17.9,14.908 17.555,15.465C17.21,16.022 16.691,16.431 15.998,16.693C15.304,16.954 14.419,17.085 13.342,17.085ZM13.938,15.34C14.378,15.34 14.737,15.273 15.015,15.14C15.293,15.007 15.502,14.791 15.64,14.493C15.778,14.194 15.848,13.793 15.848,13.29C15.848,12.793 15.775,12.396 15.63,12.098C15.485,11.799 15.272,11.583 14.99,11.45C14.708,11.317 14.353,11.25 13.923,11.25C13.832,11.25 13.728,11.256 13.608,11.268C13.487,11.279 13.386,11.293 13.303,11.31L13.303,15.325C13.456,15.335 13.667,15.34 13.938,15.34Zstyle="fill:rgb(50,50,50);"/> 
-    ) + </g> 
-     + </g> 
-    $sqlContent @" + </g>
-SET LINESIZE 1000 +
-SET TRIMSPOOL ON +
-SET TRIMOUT ON +
-SET TERMOUT OFF +
-SET PAGESIZE 0 +
-SET WRAP OFF +
-SET ECHO OFF +
-COL PRODUIT FORMAT A15 +
-COL APPLICATION FORMAT A15 +
-spool $FILEOUT +
-alter SESSION set NLS_DATE_FORMAT = 'dd-MON-yyyy'; +
-select PRODUIT, APPLICATION, VERSION_SERVEUR, NVL(VERSION_IHM_BACKUP,'null')VERSION_IHM_COURANTENVL(VERSION_IHM_BETA,'null')DATE_MAJ from LANCEUR.T_VERSIONS_IHM; +
-exit; +
-"@ +
- +
-    Set-Content -Path "/tmp/tmp_sql.sql-Value $sqlContent +
- +
-    Add-Content -Path $LOG -Value "---     selection des version en BD (/tmp/tmp_sql.sql)" +
-    Get-Content -Path "/tmp/tmp_sql.sql| Add-Content -Path $LOG +
- +
-    # Adaptation nécessaire pour l'exécution de sqlplus via PowerShell +
-    Start-Process -FilePath "sqlplus-ArgumentList "-s / as sysdba @/tmp/tmp_sql.sql" -NoNewWindow -Wait +
- +
-    (Get-Content $FILEOUT-replace '\s\s+', '|' | Set-Content $FILEOUT +
-    Remove-Item "/tmp/tmp_sql.sql" +
-+
- +
-function get_version_serveur_active { +
-    param ( +
-        [string]$ORACLE_SID +
-    ) +
-     +
-    $sqlContent @" +
-SET LINESIZE 1000 +
-SET TRIMSPOOL ON +
-SET TRIMOUT ON +
-SET TERMOUT OFF +
-SET PAGESIZE 0 +
-SET WRAP OFF +
-SET ECHO OFF +
-COL VERSION_SERVEUR  +
-spool /tmp/VERSION_SERVEUR_INSTALLEE.txt +
-select VERSION_SERVEUR from $USERBD.T_VERSIONS_IHM_COMPATIBLES; +
-exit; +
-"@ +
- +
-    Set-Content -Path "/tmp/tmp_sql.sql" -Value $sqlContent +
- +
-    Add-Content -Path $LOG -Value "---     selection des version en BD (/tmp/tmp_sql.sql)" +
-    Get-Content -Path "/tmp/tmp_sql.sql" | Add-Content -Path $LOG +
- +
-    Start-Process -FilePath "sqlplus" -ArgumentList "-s / as sysdba @/tmp/tmp_sql.sql" -NoNewWindow -Wait +
- +
-    (Get-Content "/tmp/VERSION_SERVEUR_INSTALLEE.txt") -replace '\s\s+''|' | Set-Content "/tmp/VERSION_SERVEUR_INSTALLEE.txt" +
-    Get-Content "/tmp/VERSION_SERVEUR_INSTALLEE.txt" +
-    Remove-Item "/tmp/VERSION_SERVEUR_INSTALLEE.txt" +
-    Remove-Item "/tmp/tmp_sql.sql" +
-+
- +
-function get_t_version_ihm { +
-    param ( +
-        [string]$ORACLE_SID, +
-        [string]$APPLICATION +
-    +
- +
-    $OUTFILE = "/tmp/tmp_t_ihm_version.tmp" +
-    mk_extract_sql -ORACLE_SID $ORACLE_SID -FILEOUT $OUTFILE +
- +
-    Get-Content $OUTFILE | ForEach-Object { +
-        $fields = $_ -split '\|' +
-        $PRODUIT = $fields[0] +
-        $APPLICATION = $fields[1] +
-        $VERSION_SERVEUR = $fields[2] +
-        $VERSION_IHM_BACKUP = $fields[3] +
-        $VERSION_IHM_COURANTE = $fields[4] +
-        $VERSION_IHM_BETA = $fields[5] +
-        $DATE_MAJ = $fields[6] +
- +
-        if ($ORACLE_SID -and $PRODUIT -and $APPLICATION -and $VERSION_SERVEUR -and $VERSION_IHM_BACKUP -and $VERSION_IHM_COURANTE -and $VERSION_IHM_BETA) { +
-            $global:POST += "&t_version_ihm[]=$ORACLE_SID:$PRODUIT:$APPLICATION:$VERSION_SERVEUR:$VERSION_IHM_BACKUP:$VERSION_IHM_COURANTE:$VERSION_IHM_BETA:$DATE_MAJ" +
-            Add-Content -Path "/tmp/ALL_VERSION_IHM.txt" -Value $VERSION_IHM_BACKUP +
-            Add-Content -Path "/tmp/ALL_VERSION_IHM.txt" -Value $VERSION_IHM_COURANTE +
-            Add-Content -Path "/tmp/ALL_VERSION_IHM.txt" -Value $VERSION_IHM_BETA +
-        } +
-    } +
- +
-    Add-Content -Path $LOG -Value " --- Fichier $OUTFILE ---" +
-    Get-Content -Path $OUTFILE | Add-Content -Path $LOG +
-    Add-Content -Path $LOG -Value "---   --- FIN ---`n" +
- +
-    Remove-Item $OUTFILE +
-+
- +
-function valide_t_version_ihm { +
-    param ( +
-        [string]$ORACLE_SID +
-    ) +
- +
-    Write-Host "$GREY - Validation du schema lanceur ($ORACLE_SID) $NORM" +
- +
-    $sqlContent = @" +
-SET WRAP OFF; +
-set underline off; +
-set heading off; +
-spool /tmp/out1.sql; +
-select count(DIRECTORY_NAME) from all_directories where DIRECTORY_NAME='LANCEUR_DEPOT_VERSIONS'; +
-spool off; +
-spool /tmp/out2.sql; +
-select count(*) from all_tables where OWNER='LANCEUR'; +
-spool off; +
-spool /tmp/out3.sql; +
-ALTER VIEW LANCEUR.V_VERSIONS_IHM_COMPATIBLES COMPILE; +
-spool off; +
-exit; +
-"@ +
- +
-    Set-Content -Path "/tmp/sql1.sql" -Value $sqlContent +
- +
-    Start-Process -FilePath "sqlplus" -ArgumentList "-s / as sysdba @/tmp/sql1.sql" -NoNewWindow -Wait +
- +
-    $ETAT_DIRECTORY = (Get-Content "/tmp/out1.sql" | Where-Object { $_ -notmatch "^\$" }) -replace '\s\s+''' +
-    $ETAT_TABLE = (Get-Content "/tmp/out2.sql" | Where-Object { $_ -notmatch "^\$" }) -replace '\s\s+''' +
-    $ETAT_VIEW = (Get-Content "/tmp/out3.sql" | Select-String "altered.").Count +
- +
-    Remove-Item "/tmp/out1.sql""/tmp/out2.sql""/tmp/out3.sql" +
- +
-    if ($ETAT_DIRECTORY -eq 1 -and $ETAT_TABLE -eq 2 -and $ETAT_VIEW -eq 1) { +
-        $VALIDATION +
-        Add-Content -Path $LOG -Value "Validation ok pour le schema lanceur" +
-    } else { +
-        $VALIDATION = 1 +
-        Add-Content -Path $LOG -Value "Validation KO pour le schema lanceur" +
-        Add-Content -Path $LOG -Value "ETAT_DIRECTORY:$ETAT_DIRECTORY (1)ETAT_TABLE:$ETAT_TABLE (2)ETAT_VIEW:$ETAT_VIEW (1)" +
-    } +
-} +
  
 </code> </code>
bloc_note.1736925238.txt.gz · Dernière modification : 2025/01/15 08:13 de admin