Create backup_archive_fnct_FRA.sh

This commit is contained in:
Yacine31
2023-12-22 19:24:26 +01:00
parent 1d2dcfc142
commit ac797fb5f0

View File

@@ -0,0 +1,35 @@
#
# retourne le porucentage d'occupation de la FRA
#
#------------------------------------------------------------------------------
# fonction d'aide
#------------------------------------------------------------------------------
f_help() {
echo
echo syntax : $0 ORACLE_SID
echo
exit $1
} #f_help
#------------------------------------------------------------------------------
ORACLE_SID=$1
[ "${ORACLE_SID}" ] || f_help 2;
# positionner les variables d'environnement ORACLE
export ORACLE_SID
ORAENV_ASK=NO
PATH=/usr/local/bin:$PATH
. oraenv -s >/dev/null
fra_usage=$(sqlplus -s '/ as sysdba' << EOF
set pages 0 feedback off;
select round(sum(percent_space_used),0) from v\$flash_recovery_area_usage;
EOF
)
return ${fra_usage}