Posts

Showing posts from August, 2023

Useful Scripts to finding Query timings from AWR report and Memory

Below query collecting data from AWR report. set lines 155 col execs for 999,999,999 col avg_etime for 999,999.999 col avg_lio for 999,999,999.9 col begin_interval_time for a30 col node for 99999 break on plan_hash_value on startup_time skip 1 select ss.snap_id, ss.instance_number node, begin_interval_time, sql_id, plan_hash_value, nvl(executions_delta,0) execs, (elapsed_time_delta/decode(nvl(executions_delta,0),0,1,executions_delta))/1000000 avg_etime, (buffer_gets_delta/decode(nvl(buffer_gets_delta,0),0,1,executions_delta)) avg_lio from DBA_HIST_SQLSTAT S, DBA_HIST_SNAPSHOT SS where ss.snap_id = S.snap_id and ss.instance_number = S.instance_number and sql_id='<SQL_ID>' and executions_delta > 0 order by 1, 2, 3 /  Below query use to (.sql) file set echo off set verify off set feedback off set heading on set timing off undef sql_id prompt "SQL_ID PLAN FROM CURSOR MEMORY" SELECT inst_id,sql_id, plan

Frequently Using Linux Commands

How to check Port availability   lsof -i tcp:<Port_Num> Netstat -putan |grep <Port_Number> netstat -an |grep <Port_Number>   lsof -i tcp:8031  netstat -putan |grep 8031   Renaming more than one characters in VI editor   Below command is replacing the word "DEV" to TEST in source file   perl -pi -e 's/DEV/TEST/g' <File_Name>   Ex: perl -pi -e 's/DEV/TEST/g' initTEST.ora     Check the Connection issues   nslookup  <Hostname> tnsping <Hosyname>   Searching the Multiple parameters in single file   $ORACLE_HOME/OPatche/opatch lsinventory |egrep -w '23456|125679|76578'| grep "applied on"   Tar Command Tar command is using to zip and unzip the files  Zip files: tar -cvf 11.2.0.4.tar.gz 11.2.0.4/ Unzip tar -xvzf  11.2.0.4.tar.gz   Nohup command nohup command in Linux systems that keep processes running even after exiting the shell or terminal. nohup tar - cvf 11.2.0.4.t