Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • handling filenname with space Linux/Unix
  • alter database backup controlfile to trace Oracle
  • switchlogfile.sh Linux/Unix
  • Monitor and Trace Unix processes using truss Linux/Unix
  • ORA-3136 Oracle
  • Small sample shell program Linux/Unix
  • track_autoupgrade_copy_progress.sql Oracle
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • chk_space_SID.ksh Linux/Unix
  • DBMS_PROFILER for tuning PLSQL programs. Oracle
  • oracle tips… from http://www.bijoos.com/oracle/douknow.htm Oracle
  • To Find Orphan OS processes. Linux/Unix
  • Processes Parameter decision Oracle
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle

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

Post navigation

Previous Post: runon_allcdbs_find_pdbs.sql

Related Posts

  • find_open_cur.sql Find open cursorts per session Oracle
  • Vivek Tuning for Row Locks. Oracle
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Database link password in user_db_links Oracle
  • Wait time tuning research Oracle
  • sid_wise_sql.sql Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

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
  • Rename Tablespace Oracle
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle
  • longtx.sql Oracle
  • Getting started with notebook Python/PySpark
  • load SPM baseline from cursor cache Oracle
  • ORACLE_SID in sqlplus Oracle
  • scripts to take listener.log backup Linux/Unix
  • move_arch_files.ksh Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme