Disclaimer

Sunday, 28 November 2021

Multiple AWR generation script

 $ cat awr1.sh
AWR_BEGIN=99510
AWR_END=99528
DIR="/home/oracle/awr/2014/may/may1"
BASE=RCC
INSTANCE=1
RCC_ID=2445385121
while (( $INSTANCE <= 2 ))
do
  COUNTB=$AWR_BEGIN
  COUNTE=$AWR_END
  FULL_DURATION=1
  EXT="_full"
  while (( $COUNTE <= $AWR_END ))
  do
sqlplus "perfstat/cbdt\$dba@RCC" << FIN
@/opt/oracle/db/rdbms/admin/awrrpt.sql
html
$RCC_ID
$INSTANCE
$COUNTB
$COUNTE
${DIR}/${BASE}${INSTANCE}_awr_${COUNTB}_${COUNTE}${EXT}.html
FIN
    if [[ $FULL_DURATION = 1 ]]
    then
      let FULL_DURATION=0
      let COUNTB=$AWR_BEGIN
      let COUNTE=${COUNTB}+1
      EXT=""
    else
      let COUNTB=${COUNTB}+1
      let COUNTE=${COUNTE}+1
    fi
  done
  let INSTANCE=${INSTANCE}+1
done

No comments:

Post a Comment

How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...