Posts

Showing posts from April, 2025

DBA Day-2 ve

 Operating system  CPU mpstat top  load average  pidstat dstat -vr strace---> debug if system CPU usage % is high but if you dont know then use strace -tp `grep testdb1 2>&1 | head 100 debug if User CPU usage % is high but if you dont know then use 6. jobs (hit enter) 6.1 perf record -F 99 -a -g --sleep 10 (Profiling ) 6.2 perf report -n --stdio 6.3 ./perf-tools/execsnoop Memory vmstat I/O iostat -xmd 1 iotop Network sar -n DEV 1 mtr netstat -antpl | grep 1521 nmcli device status ethtool iperf3 -c 10.1.90.51 https://www.youtube.com/watch?v=eWUeJBAiX80 fs.aio-max-nr--> Async I/O max fs.file-max --> Max file open kernal.shmmin --> how many program segment can access(permission) the shared memory kernal.shmall --> maximum amount of shared memory can accessed by all the process other than OS(set to sum of all SGAs on the server divided by page size – ‘getconf PAGESIZE’) kernal.shmmax --> maximum amount of shared memory can accessed by ind...

DBA - Day1

Perfect! I’ll give you hands-on-style answers with commands, output samples, and explanation, just like a real-world DBA would use. Let’s begin with the enhanced version of your earlier question: --- Question 1: How do you troubleshoot high CPU usage in Oracle 19c? Step-by-Step Approach (Hands-on) --- Step 1: OS-Level Check using top or vmstat Command: top -n 1 Sample Output: %Cpu(s): 90.5 us, 1.5 sy, 0.0 ni, 8.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st us (user): high value here (e.g., 90%) indicates application/SQL consuming CPU. If id (idle) is very low and us is high = DB or app is the cause. Alternative Command (better for deeper view): vmstat 2 5 Sample Output: procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----  r b swpd free buff cache si so bi bo in cs us sy id wa st  3 0 0 20000 15000 500000 0 0 0 1 200 300 85 5 10 0 0 r = run queue. If r > no. of CPUs, system is under pressure. us/sy:...

Report mail alert

#!/bin/bash # Define database credentials DB_USER="your_user" DB_PASS="your_password" DB_SID="your_db" # Email Configuration EMAIL_TO="recipient@example.com" EMAIL_SUBJECT="OEM Target Report - $(date +%Y-%m-%d)" REPORT_FILE="oem_target_report_$(date +%Y%m%d).txt" # Function to execute SQL query and format output run_query() {     SECTION_TITLE="$1"     QUERY="$2"     echo "=============================================" >> "$REPORT_FILE"     echo "SECTION: $SECTION_TITLE" >> "$REPORT_FILE"     echo "=============================================" >> "$REPORT_FILE"     sqlplus -s "$DB_USER/$DB_PASS@$DB_SID" <<EOF >> "$REPORT_FILE" SET PAGESIZE 500 SET LINESIZE 200 SET HEADING ON SET FEEDBACK OFF SET TRIMSPOOL ON COLUMN "TARGET NAME" FORMAT A30 COLUMN "TARGET TYPE" FORMAT A20 COLUMN ...