Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • Processes parameter and its dependencies on OS kernel parameters Linux/Unix
  • cp_filesystem.sql Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • Sending SQLPLUS output in HTML format Oracle
  • perf_today.sql Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • normal maintenance for exp-imp and renaming table Oracle
  • Mutating Table Error while using database trigger Oracle
  • Oracle 10g Installation/Applying Patches Tips Oracle
  • Distributed Transaction Troubleshooting. Oracle
  • Database link password in user_db_links Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • Paste command syntax Linux/Unix
  • Finding last recovered file on DR and remove all chanracters before any “/” Linux/Unix

Category: Oracle

Oracle GoldenGate lag monitoring shell script

Posted on 12-Jun-202318-Jun-2023 By Admin No Comments on Oracle GoldenGate lag monitoring shell script

Following script will be useful for tracking Oracle GoldenGate replicat process and related lag. This script will generate output on standard screen.  You can redirect it using file redirection to logfile or other locations.  while true do <goldengate home directory>/ggsci <<EOF > test.out info all exit EOF lag=`cat test.out | grep TESTREPLICAT | awk ‘{print…

Read More “Oracle GoldenGate lag monitoring shell script” »

Linux/Unix, Oracle, shell

Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle

Posted on 11-Jun-202311-Jun-2023 By Admin No Comments on Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle
Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle

If you want exclusive lock on any table, you need to make sure that no other session is  accessing it. This happens when you want to run DDL or any ALTER statements, that internally needs exclusive lock. Following script will to find the blocker session and provide killing statement for clearing locks.  col owner format…

Read More “Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle” »

Oracle, SQL scripts

ENQ: KO – FAST OBJECT CHECKPOINT tips

Posted on 25-May-202325-May-2023 By Admin No Comments on ENQ: KO – FAST OBJECT CHECKPOINT tips

On reporting queries, there are too many “enq: KO – fast object checkpoint” wait event. All reporting queries are doing full table scans concurrently. Oracle uses direct path reads instead of db file scattered reads. And direct path reads require a checkpoint “_serial_direct_read”=NEVER Parameter Session Value Instance Value ————————————————– —————————— —————————— _serial_direct_read auto auto

Oracle

GSQ.sql

Posted on 19-May-202325-May-2023 By Admin No Comments on GSQ.sql

This SQL will be used to identify SQL details of given Session. You need to pass SID and INSTANCE_ID as INPUT. This query will provide session details, SQL_ID, SQL_EXEC_START time and other transaction level details. set echo off feedback off verify offcol Transaction_id format a20col username format a8col days format 99.99col hours1 format 999999col TX_HRS…

Read More “GSQ.sql” »

Oracle, SQL scripts

DBA_HIST_SQLSTAT contents

Posted on 10-May-202310-May-2023 By Admin No Comments on DBA_HIST_SQLSTAT contents

Query DBA_HIST_WR_CONTROL to see the interval, retention and the TOPNSQL setting.  For TOPNSQL a setting of DEFAULT translates to: 30 where statistics_level is typical 100 where statistics_level is all Simply because this one SQL appears to consume 7% of the load it may not be in the top SQLs in these categories: Elapsed Time CPU…

Read More “DBA_HIST_SQLSTAT contents” »

Oracle

Find_planinfo.sql

Posted on 08-Apr-202322-Apr-2025 By Admin No Comments on Find_planinfo.sql

/********************************************Author: Paresh MehtaScript Name : find_planinfo.sql********************************************/set lines 200set pages 500set echo offcol execs for 999,999,999col avg_etime for 999,999.999col avg_lio for 999,999,999.9col begin_interval_time for a30col node for 99999col plan_hash_value format 99999999999999col sql_profile format a30col intrvl format a29col component format a20alter session set nls_date_format=’DD-MON-RRRR:HH24:MI:SS’;–break on plan_hash_value,sql_profile on startup_time skip 1accept v_sql_id prompt ‘Enter SQL_ID ->’select s.instance_number, to_char(begin_interval_time,’DD-MON:HH24:MI’)…

Read More “Find_planinfo.sql” »

Oracle, SQL scripts

Wait.sql

Posted on 04-Apr-202322-Apr-2025 By Admin No Comments on Wait.sql

/********************************************Author: Paresh MehtaScript Name : waitt.sqlwaits order by sql start time********************************************/set feedback 1set pages 2000set lines 190column event format a45column machin format a12column modul format a10column prg format a10column osuser1 format a10column username format a10column sesinfo format a15column blockedby format a15alter session set nls_date_format=’DDMONRR:HH24:MI:SS’;select /*+ first_rows(100) */ a.sid || ‘,’ || a.serial# || ‘,@’ ||…

Read More “Wait.sql” »

Oracle, SQL scripts

get_aix_vmstat.ksh

Posted on 18-Nov-2010 By Admin No Comments on get_aix_vmstat.ksh

#!/bin/ksh -x # First, we must set the environment . . . . ORACLE_SID=fdprod export ORACLE_SID ORACLE_HOME=/orastdbybin/fdprod/product/10.2 export ORACLE_HOME PATH=$ORACLE_HOME/bin:$PATH export PATH SERVER_NAME=`hostname` typeset -u SERVER_NAME export SERVER_NAME # sample every two minutes (120 seconds) . . . . SAMPLE_TIME=30 while true do vmstat ${SAMPLE_TIME} 2 > /tmp/msg$$ cat /tmp/msg$$|sed 1,7d | awk ‘{ printf(“%s…

Read More “get_aix_vmstat.ksh” »

Oracle, SQL scripts

Processes Parameter decision

Posted on 17-Nov-2010 By Admin No Comments on Processes Parameter decision

According to the query output from V$RESOURCE_LIMIT, the PROCESSES parameter limit is not yet reached. RESOURCE_NAME processes CURRENT_UTILIZATION 102 MAX_UTILIZATION 559 INITIAL_ALLOCATION 2000 LIMIT_VALUE 2000 The maximum value it ever reached was 559, while the limit is set to 2000.

Oracle, SQL scripts

How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven)

Posted on 11-Nov-2010 By Admin No Comments on How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven)

Ref ID: How To Resolve Stranded DBA_2PC_PENDING Entries [ID 401302.1] Issue: We had network outage and there were some distributed transactions with dblinks hangs. Causing issue when trying to update some rows of the base table. Problem Discription: ==================== As a result of a failed commit of a distributed transaction, some entries canbe left in…

Read More “How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven)” »

Oracle, SQL scripts

Posts pagination

Previous 1 2 3 … 39 Next

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • secure crt settings Linux/Unix
  • move_arch_files.ksh /* Good One */ Linux/Unix
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • Another export with Query Oracle
  • cache buffer chain latch Oracle
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • How to know current SID Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme