bloc_note
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
bloc_note [2025/01/15 08:13] – admin | bloc_note [2025/03/24 15:27] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 2: | Ligne 2: | ||
< | < | ||
- | $LOG = "/ | + | < |
- | + | < | |
- | function mk_extract_sql { | + | < |
- | param ( | + | < |
- | [string]$ORACLE_SID, | + | < |
- | [string]$FILEOUT | + | < |
- | ) | + | </ |
- | + | </ | |
- | $sqlContent | + | </ |
- | 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 = ' | + | |
- | select PRODUIT, APPLICATION, | + | |
- | exit; | + | |
- | "@ | + | |
- | + | ||
- | Set-Content -Path "/ | + | |
- | + | ||
- | Add-Content -Path $LOG -Value | + | |
- | Get-Content -Path "/ | + | |
- | + | ||
- | # Adaptation nécessaire pour l' | + | |
- | Start-Process -FilePath | + | |
- | + | ||
- | | + | |
- | Remove-Item | + | |
- | } | + | |
- | + | ||
- | function get_version_serveur_active { | + | |
- | param ( | + | |
- | [string]$ORACLE_SID | + | |
- | ) | + | |
- | + | ||
- | $sqlContent | + | |
- | SET LINESIZE 1000 | + | |
- | SET TRIMSPOOL ON | + | |
- | SET TRIMOUT ON | + | |
- | SET TERMOUT OFF | + | |
- | SET PAGESIZE | + | |
- | SET WRAP OFF | + | |
- | SET ECHO OFF | + | |
- | COL VERSION_SERVEUR | + | |
- | spool / | + | |
- | select VERSION_SERVEUR from $USERBD.T_VERSIONS_IHM_COMPATIBLES; | + | |
- | exit; | + | |
- | "@ | + | |
- | + | ||
- | Set-Content -Path "/ | + | |
- | + | ||
- | Add-Content -Path $LOG -Value " | + | |
- | | + | |
- | + | ||
- | Start-Process -FilePath " | + | |
- | + | ||
- | (Get-Content | + | |
- | Get-Content "/ | + | |
- | Remove-Item "/ | + | |
- | Remove-Item | + | |
- | } | + | |
- | + | ||
- | function get_t_version_ihm { | + | |
- | param ( | + | |
- | [string]$ORACLE_SID, | + | |
- | [string]$APPLICATION | + | |
- | | + | |
- | + | ||
- | $OUTFILE | + | |
- | 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 += "& | + | |
- | Add-Content -Path "/ | + | |
- | Add-Content -Path "/ | + | |
- | Add-Content -Path "/ | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | Add-Content -Path $LOG -Value " --- Fichier $OUTFILE ---" | + | |
- | Get-Content -Path $OUTFILE | Add-Content -Path $LOG | + | |
- | Add-Content -Path $LOG -Value " | + | |
- | + | ||
- | 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=' | + | |
- | spool off; | + | |
- | spool /tmp/out2.sql; | + | |
- | select count(*) from all_tables where OWNER=' | + | |
- | spool off; | + | |
- | spool /tmp/out3.sql; | + | |
- | ALTER VIEW LANCEUR.V_VERSIONS_IHM_COMPATIBLES COMPILE; | + | |
- | spool off; | + | |
- | exit; | + | |
- | "@ | + | |
- | + | ||
- | Set-Content -Path "/ | + | |
- | + | ||
- | Start-Process -FilePath " | + | |
- | + | ||
- | $ETAT_DIRECTORY = (Get-Content "/ | + | |
- | $ETAT_TABLE = (Get-Content "/ | + | |
- | $ETAT_VIEW = (Get-Content "/ | + | |
- | + | ||
- | Remove-Item "/ | + | |
- | + | ||
- | if ($ETAT_DIRECTORY -eq 1 -and $ETAT_TABLE -eq 2 -and $ETAT_VIEW -eq 1) { | + | |
- | $VALIDATION | + | |
- | Add-Content -Path $LOG -Value | + | |
- | } else { | + | |
- | $VALIDATION = 1 | + | |
- | Add-Content -Path $LOG -Value " | + | |
- | Add-Content -Path $LOG -Value " | + | |
- | } | + | |
- | } | + | |
</ | </ |
bloc_note.1736925238.txt.gz · Dernière modification : 2025/01/15 08:13 de admin