Create backup_archive_fnct_FRA.sh
This commit is contained in:
35
backup_archive_fnct_FRA.sh
Normal file
35
backup_archive_fnct_FRA.sh
Normal 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}
|
||||||
Reference in New Issue
Block a user