Hi,
I found the below script in your blog and I'm not able to get how to use it. Could you please explain step by step how to configure this script to gather schema statistics and generate a log file.
Here is a Linux shell script to gather HR schema stats and generates a log file under /tmp location #!/bin/bash . /home/oracle/.bash_profile export ORACLE_HOME=/u01/app/oracle/product/19.3/db_home export ORACLE_BASE=/u01/app/oracle export ORACLE_SID=orcl export DATE=$(date +%y-%m-%d_%H%M%S) #### Gather HR schema stats #### sqlplus / as sysdba << EOF > /tmp/HR_stats_gather_$DATE.log EXEC DBMS_STATS.gather_schema_stats('HR'); EOF echo "Stats gathered succeeded"
Hi Balaji, In order to use this script you have to create a file for example:
vi gather_stat.sh
Paste the above script and make the appropriate changes as per your database Like ORACLE_HOME, ORACLE_BASE, ORACLE SID.
then save and exit the file.
change the Execution rights of the file.
chmod u+x gather_stat.sh
Now run the script.