Update check_rman_backup.sh

This commit is contained in:
Yacine31
2023-03-20 19:20:23 +01:00
parent b46b3eca31
commit c32e4e9dd4

View File

@@ -13,8 +13,7 @@ unset NLS_LANG
function test_dba { function test_dba {
if test "$(id|grep dba)" if test "$(id|grep dba)"
then then
#return 0 return 0
echo " OK => Test Utilisateur DBA"
else else
echo "" echo ""
echo "=============================================================" echo "============================================================="
@@ -31,15 +30,14 @@ test_dba;
# reporter toutes les instances préntes sur ce serveur # reporter toutes les instances préntes sur ce serveur
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# for r in $(ps -eaf | grep pmon | grep -v grep | cut -d '_' -f3)
for r in $(ps -eaf | grep pmon | egrep -v 'grep|ASM1|APX1' | cut -d '_' -f3) for r in $(ps -eaf | grep pmon | egrep -v 'grep|ASM1|APX1' | cut -d '_' -f3)
do do
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
echo " Base de donnee a traiter: " $r echo " Base de donnee a traiter: " $r
echo "-----------------------------------------------------" echo "-----------------------------------------------------"
export ORACLE_SID=$r export ORACLE_SID=$r
. oraenv -s . oraenv -s > /dev/null
echo $ORACLE_SID $ORACLE_HOME # echo $ORACLE_SID $ORACLE_HOME
sqlplus -S / as sysdba << EOF sqlplus -S / as sysdba << EOF
alter session set nls_date_format='DD/MM/YYYY HH24:MI:SS' ; alter session set nls_date_format='DD/MM/YYYY HH24:MI:SS' ;
set serveroutput on set serveroutput on