touched tmp file and ownership to oracle

This commit is contained in:
Zulqarnain 2024-11-07 04:30:03 -05:00
parent e319eedf14
commit b3ee1052c7
2 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,8 @@ CPU_THRESHOLD=90
# File path for output # File path for output
OUTPUT_FILE="/tmp/findsql.tmp" OUTPUT_FILE="/tmp/findsql.tmp"
touch $OUTPUT_FILE
chown oracle $OUTPUT_FILE
# Capture the PIDs of Oracle processes consuming over the specified CPU threshold # Capture the PIDs of Oracle processes consuming over the specified CPU threshold
pid=($(top -b -n 1 | awk -v threshold="$CPU_THRESHOLD" '$12 ~ /^oracle/ && $9 > threshold {print $1}')) pid=($(top -b -n 1 | awk -v threshold="$CPU_THRESHOLD" '$12 ~ /^oracle/ && $9 > threshold {print $1}'))

View File

@ -4,6 +4,7 @@
OUTPUT_FILE="/tmp/database_parameters.tmp" OUTPUT_FILE="/tmp/database_parameters.tmp"
> "$OUTPUT_FILE" # Clear the output file before starting > "$OUTPUT_FILE" # Clear the output file before starting
touch $OUTPUT_FILE
chown oracle $OUTPUT_FILE chown oracle $OUTPUT_FILE
# Execute the query to retrieve all database parameters # Execute the query to retrieve all database parameters