Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to stop OCSSD Daemon Oracle
  • replace alphabets using sed Linux/Unix
  • perf_today.sql Oracle
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • send email from unix mailx with attachment. Linux/Unix
  • Small sample shell program Linux/Unix
  • Jai Shree Ram Oracle
  • login.sql Oracle
  • Checking SQL Server Version SQL Server
  • CPU Core related projections AWS
  • Export With Query Another Example. Oracle
  • get_vmstat.ksh for Solaris Oracle
  • For Perl DBI installation and testing program PHP/MYSQL/Wordpress
  • How to find Unix server conguraiton including Server Model number and underlying disk sub-system ( On Solaris) Linux/Unix
  • Paste command syntax Linux/Unix

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.sh
Next Post: top 10 AI news today

Related Posts

  • How to analyze statspack or AWR report. Oracle
  • how to find OS block size Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • tracksqltime.sql Oracle
  • find_cons.sql Oracle
  • DBMS_UTILITY.ANALYZE_SCHEMA Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • Tutornet.US — Source of excellent learning14-Oct-2026
  • OCI Infrastructure Patching14-Oct-2026
  • Free API credits for AI models14-Oct-2026
  • AMC1020-Sep-2026
  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • check_copy_progress.sh Linux/Unix
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • Goldengate Tutorial Oracle
  • online_ts_bkup.sql Oracle
  • Ports used by Oracle Software Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • Distributed Transaction Troubleshooting. Oracle
  • replacing ^M character when passing files from Windows to Unix Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme