This commit is contained in:
Yacine31
2023-01-30 20:00:09 +01:00
parent e0d5315672
commit aaefba5808
2 changed files with 21 additions and 8 deletions

View File

@@ -6,12 +6,7 @@ set feedback off
-- set markup html on
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP OFF -
HEAD "<title>Rapport</title> -
<link href=https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css rel=stylesheet integrity=sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD crossorigin=anonymous> -
</head><body> -
<div class=container>"
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP OFF
-- ---------------------------------------------------
prompt <h2>Current DATE</h2>

View File

@@ -5,7 +5,25 @@ for r in $(ps -eaf | grep pmon | egrep -v 'grep|ASM1|APX1' | cut -d '_' -f3)
do
export ORAENV_ASK=NO
export ORACLE_SID=$r
export HTML_FILE=Rapport_$HNAME_${ORACLE_SID}_${DATETIME}.html
. oraenv -s > /dev/null
sqlplus -s "/ as sysdba" @rapport_html.sql > Rapport_${ORACLE_SID}_${DATETIME}.html
echo Rapport dans le fichier html : Rapport_$HNAME_${ORACLE_SID}_${DATETIME}.html
echo "
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<meta name=viewport content=width=device-width, initial-scale=1>
<title>Rapport</title>
<link href=https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css rel=stylesheet integrity=sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD crossorigin=anonymous>
</head>
<body>
<div class=container>
" > ${HTML_FILE}
sqlplus -s "/ as sysdba" @rapport_html.sql >> ${HTML_FILE}
sed -i 's/<table.*>$/<table class="table table-striped">/g' ${HTML_FILE}
echo Rapport dans le fichier html : ${HTML_FILE}
done