Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • create trigger syntax Oracle
  • UTL_FILE test program Oracle
  • catall.sh Linux/Unix
  • Recovering lost SYS password Oracle
  • configUOCIOTTO.ora Oracle
  • useful dg links Oracle
  • crontab syntax Linux/Unix
  • Find_stale_dr.sql finding stale physical DR.. Oracle
  • lck.sql Oracle
  • How to remove blank lines using vi editor command Linux/Unix
  • USER_TABLES.Freelists Oracle
  • cache buffer chain latch Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • Session_info.ksh Linux/Unix
  • Windows based Command line mailing program like mailx (Sednmail for windows) PHP/MYSQL/Wordpress

Author: Admin

runon_allpdbs_show_conname.sh

Posted on 23-Apr-2026 By Admin No Comments on runon_allpdbs_show_conname.sh
#!/usr/bin/bash

ORACLE_HOME=/u02/app/oracle/product/19.0.0.0/dbhome_1

for v_inst in `ps -ef| grep pmon | awk '{print $8}' | grep -iv asm | grep -iv apx | awk -F"_" '{print $3}'`
do

echo "Instance name = $v_inst"
export ORACLE_SID=$v_inst

# Fetch the list of PDBs (excluding the Seed PDB)
# We use -S (silent) to keep the output clean for the loop
PDB_LIST=$(sqlplus -S / as sysdba <<EOF
SET HEAD OFF FEEDBACK OFF PAGES 0
SELECT name FROM v\$pdbs WHERE name != 'PDB\$SEED';
EXIT;
EOF
)

echo "----------------------------------------------------"
echo "Iterating through PDBs for SID: $ORACLE_SID"
echo "----------------------------------------------------"

for PDB in $PDB_LIST
do
    echo "Checking PDB: $PDB"

    sqlplus -S / as sysdba <<EOF
    set lines 120 pages 200
    ALTER SESSION SET CONTAINER = $PDB;
    SHOW CON_NAME;
    EXIT;
EOF
    echo "----------------------------------------------------"
done


done
Oracle, SQL scripts

runon_allcdbs_find_pdbs.sql

Posted on 23-Apr-2026 By Admin No Comments on runon_allcdbs_find_pdbs.sql
#!/usr/bin/bash
ORACLE_BASE=/u02/app/oracle
ORACLE_HOME=/u02/app/oracle/product/19.0.0.0/dbhome_1
LOGNAME=runon_all_localdb_$$.log

for v_inst in `ps -ef| grep pmon | awk '{print $8}' | grep -iv asm | grep -iv apx | awk -F"_" '{print $3}'`
do
 echo "Instance name = $v_inst"
 export ORACLE_SID=$v_inst
 $ORACLE_HOME/bin/sqlplus "/ as sysdba" << EOF >> ${LOGNAME}
 show user
 set echo off
 set numwidth 9
 set linesize 132
 set pagesize 300
 set feedback off
 set verify off
 set time off
 set timing off
 --select * from v\$instance;
 @/u02/scripts/paresh/find_pdbs.sql
 --select PROPERTY_VALUE from database_properties where PROPERTY_NAME='DEFAULT_TEMP_TABLESPACE';
EOF
done

cat ${LOGNAME}

rm ${LOGNAME}
Oracle, SQL scripts

track_autoupgrade_copy_progress.sql

Posted on 01-Apr-202601-Apr-2026 By Admin No Comments on track_autoupgrade_copy_progress.sql

This script will be useful for tracking progress of GBS copied to Target system. Need to execute it on Target system.

Oracle, SQL scripts

refre.sql for multitenant

Posted on 01-Apr-2026 By Admin No Comments on refre.sql for multitenant

This will provide prompt with session details.

Oracle, SQL scripts

prepfiles.sh for step by step generating pending statistics files

Posted on 10-Mar-202610-Mar-2026 By Admin No Comments on prepfiles.sh for step by step generating pending statistics files

This script, prepfiles.sh, is a powerful utility for Oracle Database Administrators designed to automate the generation of a comprehensive SQL toolkit for managing and testing database statistics. By reading a list of tables from mtx_tablelist.lst, the script creates a sequenced set of SQL files that handle the entire lifecycle of Pending Statistics. This allows DBAs to gather and validate new…

Read More “prepfiles.sh for step by step generating pending statistics files” »

Oracle, shell

tracksqltime.sql

Posted on 05-Mar-2026 By Admin No Comments on tracksqltime.sql

This PL/SQL block identifies recently active SQL queries from a specific application server and provides details on their performance and execution plans.  Here is a breakdown of what the script does:

Oracle, SQL scripts

Complete Git Tutorial for Beginners

Posted on 25-Dec-202525-Dec-2025 By Admin No Comments on Complete Git Tutorial for Beginners

🎯 Table of Contents 🤔 What is Git? Git is a version control system – think of it as a time machine for your code! Real-World Analogy Imagine you’re writing a book: Why Use Git? ✅ Track Changes: See what changed and when✅ Collaborate: Multiple people can work on the same project✅ Backup: Your code is saved on GitHub (cloud)✅ Undo Mistakes:…

Read More “Complete Git Tutorial for Beginners” »

GIT

Postgres DB user and OS user.

Posted on 25-Dec-202525-Dec-2025 By Admin No Comments on Postgres DB user and OS user.

In PostgreSQL on Linux, it is crucial to understand that the OS user and the database user (often both named postgres) are two completely separate entities with separate credentials. Here is the breakdown of how they interact: 1. Are the passwords the same? No. * OS User (postgres): This is a Linux system account created…

Read More “Postgres DB user and OS user.” »

POSTGRESQL

Trace a SQL session from another session using ORADEBUG

Posted on 30-Sep-202530-Sep-2025 By Admin No Comments on Trace a SQL session from another session using ORADEBUG

Find the SPID from Oracle’s SID using below SQL. REM **** This is used to get SPID from SID.col username format a30col machine format a20col program format a40accept _sid prompt ‘Enter Oracle Session ID ->’select a.sid, b.pid, b.spid, a.username, a.program,a.machinefrom v$session a,V$process bwhere a.paddr = b.addrand   a.sid = &_sid/ Use ORADEBUG command as below. oradebug…

Read More “Trace a SQL session from another session using ORADEBUG” »

Oracle, SQL scripts

SQL Server Vs Oracle Architecture difference

Posted on 25-Jul-202525-Jul-2025 By Admin No Comments on SQL Server Vs Oracle Architecture difference

Here’s an expanded and in-depth comparison of SQL Server vs Oracle architecture — organized into major categories with detailed breakdowns. ✅ SQL Server vs Oracle Architecture – In-Depth Comparison Category SQL Server Oracle Database Core Architecture Type Thread-based, single-process architecture. Process-based, multi-process architecture (each background task is a separate OS process). Platform Windows (originally), now…

Read More “SQL Server Vs Oracle Architecture difference” »

SQL Server

Posts pagination

1 2 … 58 Next

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (402)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (350)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sql23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Removing Blank lines from file using grep Linux/Unix
  • checking connectivity between two servers Linux/Unix
  • Implementing Listener Security Oracle
  • Proc Compilation Oracle
  • PHP code to add WordPress posts in bulk programmatically PHP/MYSQL/Wordpress
  • initUOCIOTTO.ora Oracle
  • How does one SELECT a value from a table into a Unix variable? From SQL to Shell Linux/Unix
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme