meta données pour cette page
Différences
Ci-dessous, les différences entre deux révisions de la page.
| oracle:scripts:sqlplus_parameter [19/04/2024 08:43] – créée mdl | oracle:scripts:sqlplus_parameter [19/04/2024 08:44] (Version actuelle) – mdl | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | * Script permettant de propager un parametre RMAN sur tous les SID up | + | * Script permettant de propager un paramètre SQLPLUS |
| <code bash> | <code bash> | ||
| + | #!/bin/bash | ||
| + | ############################### | ||
| + | # | ||
| + | # Script Name : sqlplus_parameter.sh | ||
| + | # Author | ||
| + | # Role : UNIX script to push SQLPLUS parameter | ||
| + | # Usage : none | ||
| + | # | ||
| + | # ------------------------------------------------------------------------------- | ||
| + | # REVISIONS | ||
| + | # ------------------------------------------------------------------------------- | ||
| + | # 1.0 => Initial version (15/ | ||
| + | # | ||
| + | ################################################################################ | ||
| + | |||
| + | |||
| + | # Checking if current user is Oracle | ||
| + | if [ " | ||
| + | echo "ERROR - this script must be run under ORACLE" | ||
| + | exit | ||
| + | fi | ||
| + | |||
| + | # Oracle sids | ||
| + | oracle_sids=( $(ps -ef | grep oracle | grep ora_pmon | ||
| + | |||
| + | # compter membre array | ||
| + | oracle_sids_nmr=${# | ||
| + | |||
| + | # DG Status and FRA on SID list | ||
| + | for i in " | ||
| + | do | ||
| + | : | ||
| + | echo "#########################################" | ||
| + | echo "######### | ||
| + | |||
| + | ORACLE_SID=$i | ||
| + | export ORACLE_HOME=`grep -w ${ORACLE_SID} /etc/oratab | cut -d ":" | ||
| + | |||
| + | |||
| + | echo "==== SQLPLUS ====" | ||
| + | sqlplus / as sysdba <<EOF | ||
| + | ALTER system SET DB_RECOVERY_FILE_DEST_SIZE=300G scope=both; | ||
| + | SET linesize 500 | ||
| + | col NAME FOR a50 | ||
| + | SELECT name, ROUND(SPACE_LIMIT/ | ||
| + | ROUND(SPACE_USED/ | ||
| + | ROUND(SPACE_RECLAIMABLE/ | ||
| + | (SELECT ROUND(ESTIMATED_FLASHBACK_SIZE/ | ||
| + | FROM V\$FLASHBACK_DATABASE_LOG) " | ||
| + | FROM V\$RECOVERY_FILE_DEST; | ||
| + | exit; | ||
| + | EOF | ||
| + | done | ||
| </ | </ | ||