Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Monday, April 23, 2012

Health Check - RAC/DB

Running the following OS commands you can get the Health Check for your cluster and Database, all the output is redirected to one file to analyze.You can run it in a .bat file or separately on the command prompt.

Windows Verions

@echo off
Title Oracle RAC/DB Health Check by Inam Bukhari
set day=%date:~0,3%
set mm=%date:~4,2%
set dd=%date:~7,2%
set yy=%date:~-4%
set ORA_DIAG_CLINT=
set ORA_DIAG_OUPUT=t.txt
set ORA_CRS_HOME_BIN=D:\app\11.2.0.3\grid\bin
set ORA_CRS_HOME=D:\app\11.2.0.3\grid
set ORA_DB_HOME=D:\app\Inam\product\11.2.0.3\dbhome_1
set ORACLE_ASM_SID=+ASM1
set CRS_HOST1=or-11
set CRS_HOST2=or-12
set ORA_DB_NAME=TESTRAC
set ORA_DB_INST1=TESTRAC1
set ORA_DB_INST2=TESTRAC2
set ORA_DB_ALERT_FILE=D:\app\Inam\diag\rdbms\rac\rac1\trace\alert_rac1.log

del t.txt
echo Helath Check Started: %date% - %time% >> %ORA_DIAG_OUPUT%
echo
echo
EVENTCREATE /T INFORMATION /ID 1000 /L APPLICATION /D " Starting Oracle RAC/DB Health Check by Inam Bukhari"
CLS
:OS
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - Operating System                                  # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%
color a
echo ######################### System Info ####################################### >> %ORA_DIAG_OUPUT%
SYSTEMINFO >> %ORA_DIAG_OUPUT%
echo ######################### Checing ability to perform the software copy ###### >> %ORA_DIAG_OUPUT%
net use \\%CRS_HOST1%\C$ >> %ORA_DIAG_OUPUT%
net use \\%CRS_HOST2%\C$ >> %ORA_DIAG_OUPUT%
echo ######################### Displaying Services Info ########################## >> %ORA_DIAG_OUPUT%
SC query  >> %ORA_DIAG_OUPUT%
echo ######################### Checing Diskpart ################################## >> %ORA_DIAG_OUPUT%
ECHO list disk >> temp
ECHO list vol >> temp
diskpart /s temp  >> %ORA_DIAG_OUPUT%
del temp
echo

goto :NETWORK
:NETWORK
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - Network                                           # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%

echo ######################### Checking ARP ####################################### >> %ORA_DIAG_OUPUT%
ARP -a  >> %ORA_DIAG_OUPUT%
echo ######################### Displaying IPCONFIG  ############################### >> %ORA_DIAG_OUPUT%
ipconfig /all  >> %ORA_DIAG_OUPUT%
echo ######################### Network Latency Check  ############################# >> %ORA_DIAG_OUPUT%
pathping %CRS_HOST1%  >> %ORA_DIAG_OUPUT%
pathping %CRS_HOST2%  >> %ORA_DIAG_OUPUT%
echo ######################### General Global Parameters  ######################### >> %ORA_DIAG_OUPUT%
echo ********* IPV4 >> %ORA_DIAG_OUPUT%
netsh interface ipv4 show global >> %ORA_DIAG_OUPUT%
echo ********* IPV6 >> %ORA_DIAG_OUPUT%
netsh interface ipv6 show global >> %ORA_DIAG_OUPUT%
echo

goto :CLUSTERWARE
:CLUSTERWARE
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - Clusterware                                       # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%

echo
echo
color b
set PATH=%ORA_CRS_HOME_BIN%;
echo ################################ Checing CRS ################################ >> %ORA_DIAG_OUPUT%
crsctl check crs >> %ORA_DIAG_OUPUT%
crsctl check cluster -all >> %ORA_DIAG_OUPUT%
echo ################################ Quick Check CRS Stats ###################### >> %ORA_DIAG_OUPUT%
crs_stat -t >> %ORA_DIAG_OUPUT%
crsctl stat res -t >> %ORA_DIAG_OUPUT%
echo ################################  Checking RAC DB Status #################### >> %ORA_DIAG_OUPUT%
srvctl status database -d %ORA_DB_NAME% -v >> %ORA_DIAG_OUPUT%
echo ################################  Checking Instance Status ################## >> %ORA_DIAG_OUPUT%
srvctl status instance  -d %ORA_DB_NAME% -i %ORA_DB_INST1% -v >> %ORA_DIAG_OUPUT%
srvctl status instance  -d %ORA_DB_NAME% -i %ORA_DB_INST2% -v >> %ORA_DIAG_OUPUT%
echo ################################ Status of all Nodes ######################## >> %ORA_DIAG_OUPUT%
srvctl status nodeapps -n %CRS_HOST1% >> %ORA_DIAG_OUPUT%
srvctl status nodeapps -n %CRS_HOST2% >> %ORA_DIAG_OUPUT%
echo ################################ Checking OCR ############################### >> %ORA_DIAG_OUPUT%
echo *********OCRCHECK >> %ORA_DIAG_OUPUT%
ocrcheck >> %ORA_DIAG_OUPUT%
echo *********OCR Backup >> %ORA_DIAG_OUPUT%
ocrconfig -showbackup  >> %ORA_DIAG_OUPUT%
echo ################################ Checking VOTE Disk ######################### >> %ORA_DIAG_OUPUT%
crsctl query css votedisk >> %ORA_DIAG_OUPUT%
echo ################################ Checking current settings for VIP diag###### >> %ORA_DIAG_OUPUT%
srvctl config nodeapps  -a -g -s >> %ORA_DIAG_OUPUT%
echo ################################ Checking Cluster Time Synchronization ###### >> %ORA_DIAG_OUPUT%
crsctl check ctss >> %ORA_DIAG_OUPUT%
echo ################ Checking High Availability Services automatic startup ###### >> %ORA_DIAG_OUPUT%
crsctl config crs >> %ORA_DIAG_OUPUT%
cho ################################ Checking ASM  ############################### >> %ORA_DIAG_OUPUT%
echo *********ASM Disks >> %ORA_DIAG_OUPUT%
asmtool -list >> %ORA_DIAG_OUPUT%
echo *********ASM Instances >> %ORA_DIAG_OUPUT%
srvctl status asm -n %CRS_HOST1% >> %ORA_DIAG_OUPUT%
srvctl status asm -n %CRS_HOST2% >> %ORA_DIAG_OUPUT%
echo *********ASM Diskgroups >> %ORA_DIAG_OUPUT%
set ORACLE_SID=%ORACLE_ASM_SID%
set ORACLE_HOME=%ORA_DB_HOME%
%ORA_DB_HOME%\bin\asmcmd ls >> %ORA_DIAG_OUPUT%
%ORA_DB_HOME%\bin\asmcmd lsdg >> %ORA_DIAG_OUPUT%
set ORACLE_SID=NULL

echo
echo
echo ################################ Checking CLUVFY ############################ >> %ORA_DIAG_OUPUT%
color c
echo *********** compliance with mandatory requirements and best practices >> %ORA_DIAG_OUPUT%
cluvfy comp healthcheck >> %ORA_DIAG_OUPUT%
echo
echo
echo *********** CRSINST >> %ORA_DIAG_OUPUT%
cluvfy stage -pre crsinst -n %CRS_HOST1%,%CRS_HOST1% -verbose >> %ORA_DIAG_OUPUT%
echo *********** DBINST >> %ORA_DIAG_OUPUT%
cluvfy stage -pre dbinst -n %CRS_HOST1%,%CRS_HOST1% -verbose >> %ORA_DIAG_OUPUT%
echo *********** DBCFG >> %ORA_DIAG_OUPUT%
cluvfy stage -pre dbcfg -n all -d %ORA_CRS_HOME% -verbose >> %ORA_DIAG_OUPUT%
ehco

goto :DATABASE
:DATABASE
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - Database                                          # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%

echo
echo
color d
set ORACLE_SID=%ORA_DB_INST1%
set ORACLE_SID=RAC1
echo ################################ Running Scripts on DB ###################### >> %ORA_DIAG_OUPUT%
echo *********** SGA >> %ORA_DIAG_OUPUT%
set ORA_DIAG_OUPUT=t.txt
del temp.sql
del temp
echo set lines 180
echo set pages 50
echo spool temp >> temp.sql
echo show sga; >> temp.sql
echo select  '*********** List of all datafiles' " " from dual; >> temp.sql
echo select substr(file_name,1,50) file_name, bytes/1024/1024  from dba_data_files; >> temp.sql
echo select '*********** Status of all the groups' " " from dual; >> temp.sql
echo select group#, type, substr(member,1,50) member, is_recovery_dest_file  from v$logfile order by group#; >> temp.sql
echo select '*********** diskgroup view' " " from dual; >> temp.sql
echo select group_number, substr(name,1,20),allocation_unit_size alloc_unit_size,state,type,total_mb,usable_file_mb from v$asm_diskgroup; >> temp.sql

echo spool off >> temp.sql
echo exit; >> temp.sql
sqlplus -S / as sysdba @temp
type temp.lst  >> %ORA_DIAG_OUPUT%
echo
:ERROR
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - Errors                                            # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%

color e
echo ################################ Checking for 07445 ######################### >> %ORA_DIAG_OUPUT%
find "ora-07445" %ORA_DB_ALERT_FILE% /I /N >> %ORA_DIAG_OUPUT%
echo ################################ Checking for 00600 ######################### >> %ORA_DIAG_OUPUT%
find "ora-00600" %ORA_DB_ALERT_FILE% /I /N >> %ORA_DIAG_OUPUT%
echo
:RMAN
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - RMAN                                              # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%

echo
echo
color f
set ORACLE_SID=%ORA_DB_INST1%

echo ################################ RMAN Configurations ######################## >> %ORA_DIAG_OUPUT%
del temp.sql
del temp
echo show all; >> temp.rcv
echo list backup; >> temp.rcv
%ORA_DB_HOME%\bin\rman target / CMDFILE=temp.rcv >>  %ORA_DIAG_OUPUT%
del temp.rcv
echo

:ADDM
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - ADDM                                              # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%

echo
echo
color
echo ################################ Running ADDM ########################### >> %ORA_DIAG_OUPUT%
echo *********** Please provide the begin/end snap ids and filename must be temp
del temp.sql
del temp
echo @%ORA_DB_HOME%\RDBMS\ADMIN\addmrpt; >> temp.sql
echo exit; >> temp.sql
sqlplus -S / as sysdba @temp
type temp.lst  >> %ORA_DIAG_OUPUT%
echo ################################ End of ADDM ########################### >> %ORA_DIAG_OUPUT%
echo
:AWR
echo ############################################################################# >> %ORA_DIAG_OUPUT%
echo #              Analysis - AWR                                               # >> %ORA_DIAG_OUPUT%
echo ############################################################################# >> %ORA_DIAG_OUPUT%

echo
echo
echo ################################ Running AWR ################################ >> %ORA_DIAG_OUPUT%
del temp.sql
del temp
echo @%ORA_DB_HOME%\RDBMS\ADMIN\awrrpt; >> temp.sql
echo exit; >> temp.sql
sqlplus -S / as sysdba @temp
echo ################################ End of AWR ################################# >> %ORA_DIAG_OUPUT%
type temp.lst  >> %ORA_DIAG_OUPUT%
echo
goto :EOF
:EOF
EVENTCREATE /T INFORMATION /ID 1000 /L APPLICATION /D " Finished Oracle RAC/DB Health Check by Inam Bukhari"
echo
echo
echo Helath Check Finished: %date% - %time% >> %ORA_DIAG_OUPUT%

Linux Version

# Author: By Inam Ullah Bukhari

# chmod u+x hcji.sh

################PROVIDE THE VALUES FOR BELOW ######################################
echo "#############################################################################"
echo "#               Oracle DB/RAC/Cluster Health Check Utility                  #"
echo "#############################################################################"

read -p "Enter Client Name: " pCN
pCN=${pCN:-Not Provided}
export HC_CLIENT_NAME=$pCN

read -p "Enter GRID Home (/u01/app/11.2.0.4/grid): " pGH
pGH=${pGH:-/u01/app/11.2.0.4/grid}
export HC_GRID_HOME=$pGH

read -p "Enter Database Home (/u01/app/oracle/product/11.2.0.4/dbhome_1):" pDBH
pDBH=${pDBH:-/u01/app/oracle/product/11.2.0.4/dbhome_1}
export HC_DB_HOME=$pDBH


#export HC_DB_ALERT_FILE=/u01/app/oracle/diag/rdbms/orcl/ORCL/trace/alertORCL.log
#export HC_GRID_OWNER=oracle
read -p "Enter Grid Owner (oracle): " pGO
pGO=${pGO:-oracle}
export HC_GRID_OWNER=$pGO

#export HC_DB_OWNER=oracle
read -p "Enter Database Owner (oracle): " pDBO
pDBO=${pDBO:-oracle}
export HC_DB_OWNER=$pGO

##export HC_HOST1=pn3-esk-rp-od01
read -p "Enter Host Name 1: " pHN1
export HC_HOST1=$pHN1

##export HC_HOST2=pn3-esk-rp-od02
read -p "Enter Host Name 2: " pHN2
export HC_HOST2=$pHN2


###export HC_BESTPRACTICE_CLUSTER=Y
read -p "Do you want to run cluster best practices check (Y) Y/N: " pCBP
pCBP=${pCBP:-Y}
export HC_BESTPRACTICE_CLUSTER=$pCBP

##export HC_BESTPRACTICE_DB=Y
read -p "Do you want to run Database best practices check (Y) Y/N: " pDBP
pDBP=${pDBP:-Y}
export HC_BESTPRACTICE_DB=$pDBP


export HC_ISEXADATA=Y
export HC_EXACELL1=

export HC_ISRAC=Y

export HC_ASM_SID=+ASM1
export HC_DB_NAME=ESKDB
export HC_DB_INST1=ESKDB1
export HC_DB_INST2=ESKDB2


echo
echo "Please review the values provided, Enter Y if OK, Press any key to Exit"
echo "******************************************************************************"
echo "Client Name:                 " $HC_CLIENT_NAME
echo "Grid Home:                   " $HC_GRID_HOME
echo "Database Home:               " $HC_DB_HOME
echo "Grid Owner:                  " $HC_GRID_OWNER
echo "Database Owner:              " $HC_DB_OWNER
echo "Host1                        " $HC_HOST1
echo "Host2                        " $HC_HOST2
echo "Run Cluster Best Practices:  " $pCBP
echo "Run Database Best Practices: " $pDBP



echo "******************************************************************************"
read -p ":" pYN

if [ "$pYN" == "Y" ]; then
echo "Now Running the Utility...."
else
exit 1;
fi



###################################################################################
export HC_DAY=$(date +%Y%m%d)
export HC_ORA_DIAG_OUTPUT=hc-$HC_CLIENT_NAME-$HC_DAY.txt
export HC_ORA_DIAG_OUTPUT_DIR=/tmp/hc$HC_DAY
mkdir -p $HC_ORA_DIAG_OUTPUT_DIR
export HC_OUTPUT_LOC=$HC_ORA_DIAG_OUTPUT_DIR/$HC_ORA_DIAG_OUTPUT
export HC_ORA_GRID_BIN=$HC_GRID_HOME/bin

chown $HC_GRID_OWNER:dba $HC_ORA_DIAG_OUTPUT_DIR
rm -fr $HC_OUTPUT_LOC
###################################################################################
echo
echo -e "\033[32;5mHealth Check started at $(date)\033[0m"

if [ "$USER" != "root" ]; then
echo -e "\033[31;1mYou connected as $USER but this utility requires root user \033[0m"
exit 1;
fi


if [ "$HC_ISEXADATA" == "Y" ]; then
echo
fi

echo -e "\033[31;1mConnected using , $USER!\033[0m"
echo
echo -e "\033[33;5mStrating Operating System Analysis.... \033[0m"
echo "#############################################################################" >> $HC_OUTPUT_LOC
echo "#               Operating System Analysis                                   #" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC

echo "######################### System Info #######################################" >> $HC_OUTPUT_LOC
echo "#### Host Name" >> $HC_OUTPUT_LOC
hostname  >> $HC_OUTPUT_LOC

echo "#### Architecture" >> $HC_OUTPUT_LOC
uname -m >> $HC_OUTPUT_LOC

echo "#### Release" >> $HC_OUTPUT_LOC
cat /etc/redhat-release >> $HC_OUTPUT_LOC

echo "#### NO of CPUs" >> $HC_OUTPUT_LOC
cat /proc/cpuinfo | grep processor | wc -l >> $HC_OUTPUT_LOC

echo "#### Memory Info" >> $HC_OUTPUT_LOC
#cat /proc/meminfo >> $HC_OUTPUT_LOC
cat /proc/meminfo | egrep '^MemTotal:|^MemFree:|^Cached:' >> $HC_OUTPUT_LOC
echo "#### Machine Info" >> $HC_OUTPUT_LOC
dmidecode | grep -A3 '^System Information' >> $HC_OUTPUT_LOC


echo "######################### Checking ability to perform the software copy ######" >> $HC_OUTPUT_LOC
#echo "#### Accessing $HC_HOST1" >> $HC_OUTPUT_LOC
#ssh $HC_HOST1 ls -l /tmp >> $HC_OUTPUT_LOC
echo "#### Accessing $HC_HOST2" >> $HC_OUTPUT_LOC
ssh $HC_HOST2 ls -l /tmp >> $HC_OUTPUT_LOC
echo "######################### Displaying Services Info ##########################" >> $HC_OUTPUT_LOC
#ls /etc/init.d  >> $HC_OUTPUT_LOC
service --status-all >> $HC_OUTPUT_LOC



echo -e "\033[34;5mStrating ASM Analysis....\033[0m"

echo "" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC
echo "#               ASM Analysis                                                #" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC

###ASMTOOL OS perspective
$HC_ORA_GRID_BIN/kfod  op=groups >>  $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/kfod ds=true di=all >>  $HC_OUTPUT_LOC

echo "####ASM Disks" >> $HC_OUTPUT_LOC   DID NOT RUN
#/etc/init.d/oracleasm listdisks >> $HC_OUTPUT_LOC
echo "#### ASM Instances" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/srvctl status asm -n $HC_HOST1 >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/srvctl status asm -n $HC_HOST2 >> $HC_OUTPUT_LOC
echo "#### ASM Diskgroups Status" >> $HC_OUTPUT_LOC

#####chown $HC_GRID_OWNER:dba $HC_OUTPUT_LOC
#echo "ownership set"

#su $HC_GRID_OWNER


#echo "1- entered as $USER"

export ORACLE_SID=$HC_ASM_SID
export ORACLE_HOME=$HC_GRID_HOME

##runuser --session -l $HC_GRID_OWNER -m -c 'echo "oracle_sid=$ORACLE_SID";echo "oracle_home=$ORACLE_HOME";echo "Diskgroups";$ORACLE_HOME/bin/asmcmd lsdg' >> $HC_OUTPUT_LOC
runuser --session -l $HC_GRID_OWNER -m -c '$ORACLE_HOME/bin/asmcmd lsdg' >> $HC_OUTPUT_LOC


##sudo -u oracle
#$ORACLE_HOME/bin/asmcmd ls >> $HC_OUTPUT_LOC
#$ORACLE_HOME/bin/asmcmd lsdg >> $HC_OUTPUT_LOC
unset ORACLE_SID


echo -e "\033[35;5mStrating Clusterware Analysis....\033[0m"

echo "" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC
echo "#              Clusterware  Analysis                                        #" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC

echo "################################ Checking CRS ################################" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/crsctl check crs >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/crsctl check cluster -all >> $HC_OUTPUT_LOC
echo "################################ Quick Check CRS Stats ######################" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/crs_stat -t >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/crsctl stat res -t >> $HC_OUTPUT_LOC
echo "################################  Checking RAC DB Status ####################" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/srvctl status database -d $HC_DB_NAME -v >> $HC_OUTPUT_LOC
#echo "################################  Checking Instance Status ##################" >> $HC_OUTPUT_LOC
#$HC_ORA_GRID_BIN/srvctl status instance  -d $HC_DB_NAME -i $ORA_DB_INST1  >> $HC_OUTPUT_LOC
#$HC_ORA_GRID_BIN/srvctl status instance  -d $HC_DB_NAME -i $ORA_DB_INST2  >> $HC_OUTPUT_LOC
echo "################################ Status of all Nodes ########################" >> $HC_OUTPUT_LOC
echo "#### Host Name $HC_HOST1" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/srvctl status nodeapps -n $HC_HOST1 >> $HC_OUTPUT_LOC
echo "#### Host Name $HC_HOST2" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/srvctl status nodeapps -n $HC_HOST2 >> $HC_OUTPUT_LOC
echo "################################ Checking OCR ###############################" >> $HC_OUTPUT_LOC
echo *********OCRCHECK >>  $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/ocrcheck >>  $HC_OUTPUT_LOC
echo *********OCR Backup >>  $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/ocrconfig -showbackup  >>  $HC_OUTPUT_LOC
echo "################################ Checking VOTE Disk #########################" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/crsctl query css votedisk >>  $HC_OUTPUT_LOC
echo "################################ Checking current settings for VIP diag######" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/srvctl config nodeapps  -a -g -s >>  $HC_OUTPUT_LOC
echo "################################ Checking Cluster Time Synchronization ######" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/crsctl check ctss >>  $HC_OUTPUT_LOC
echo "################ Checking High Availability Services automatic startup ######" >> $HC_OUTPUT_LOC
$HC_ORA_GRID_BIN/crsctl config crs >>  $HC_OUTPUT_LOC



#su $HC_GRID_OWNER

if [ "$HC_BESTPRACTICE_CLUSTER" == "Y" ]; then
echo -e "\033[36;5mStrating Clusterware Best Practices Analysis....\033[0m"
echo "" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC
echo "#              Clusterware Best Practices                                   #" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC
echo "################################ Checking CLUVFY ############################" >> $HC_OUTPUT_LOC
echo *********** compliance with mandatory requirements and best practices >> $HC_OUTPUT_LOC
#$HC_ORA_GRID_BIN/cluvfy comp healthcheck  -collect cluster >> $HC_OUTPUT_LOC

runuser --session -l $HC_GRID_OWNER -m -c '$HC_ORA_GRID_BIN/cluvfy comp healthcheck  -collect cluster' >> $HC_OUTPUT_LOC

fi

if [ "$HC_BESTPRACTICE_DB" == "Y" ]; then
echo -e "\033[37;5mStrating Database Best Practices Analysis....\033[0m"
echo "" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC
echo "#              Database Best Practices                                      #" >> $HC_OUTPUT_LOC
echo "# YOU WILL PROVIDE HE INPUT FOR THE DATABASES IN YOUR ENVIRONMENT. THE USER #" >> $HC_OUTPUT_LOC
echo "# CVUSYS MUST HAVE BEEN CONFIGURED BEFORE, OTHERWISE JUST HIT THE ENTER KEY #" >> $HC_OUTPUT_LOC
echo "# UNTILL YOU GET THE COMMAND PROMPT. OUTPUT HAS BEEN GENERATED IN A         #" >> $HC_OUTPUT_LOC
echo "# SEPARATE FILE IN THE SAME FOLDER.                                         #" >> $HC_OUTPUT_LOC
echo "#############################################################################" >> $HC_OUTPUT_LOC
##$HC_ORA_GRID_BIN/cluvfy comp healthcheck  -collect database >> $HC_OUTPUT_LOC
runuser --session -l $HC_GRID_OWNER -m -c '$HC_ORA_GRID_BIN/cluvfy comp healthcheck  -collect database -save -savedir $HC_ORA_DIAG_OUTPUT_DIR'

###/u01/app/11.2.0.4/grid/bin/cluvfy comp healthcheck  -collect database

fi
echo
echo -e "\033[32;5mHealth Check Finished at $(date), results located at $HC_ORA_DIAG_OUTPUT_DIR\033[0m"


No comments: