Posts

Showing posts from June, 2025

Post check 1

#!/bin/bash export ORACLE_SID=<your_cdb_sid> export ORAENV_ASK=NO . oraenv > /dev/null LOG_DIR=/tmp/post_migration_check mkdir -p "$LOG_DIR" LOGFILE="$LOG_DIR/post_migration_check_$(date +%Y%m%d_%H%M%S).log" exec_sql() { sqlplus -s "/ as sysdba" <<EOF set pages 100 set lines 200 set feedback off set heading on set echo off col name for a20 col open_mode for a20 col restricted for a15 col object_type for a20 col object_name for a40 col owner for a20 col comp_name for a35 col status for a15 col wallet_status for a20 col tablespace_name for a30 col encrypted for a10 col activating_pdbname for a25 $1 exit EOF } check_flag() {   if grep -iq "$2" <<< "$1"; then     echo "$3 : PASSED" | tee -a $LOGFILE   else     echo "$3 : NOT PASSED" | tee -a $LOGFILE   fi } echo "=== Post Migration Certification Checks ===" | tee -a $LOGFILE # Step 1: PDB Open Status echo -e "\n--- Step 1: CDB/PDB O...

Post check

#!/bin/bash # Set Oracle environment export ORACLE_SID=<your_cdb_sid> export ORAENV_ASK=NO . oraenv > /dev/null # Log file setup LOG_DIR=/tmp/post_migration_check mkdir -p $LOG_DIR LOGFILE="$LOG_DIR/post_migration_check_$(date +%Y%m%d_%H%M%S).log" # SQL execution wrapper exec_sql() { sqlplus -s "/ as sysdba" <<EOF set pagesize 500 set linesize 200 set feedback off set echo off $1 exit EOF } echo "=== Post Migration Certification Checks ===" | tee -a $LOGFILE # 1. CDB & PDB open modes echo -e "\n--- 1. CDB & PDB Open Modes ---" | tee -a $LOGFILE exec_sql "SELECT name, open_mode, restricted FROM v\$pdbs;" | tee -a $LOGFILE # 2. PDB violations echo -e "\n--- 2. PDB Plug-in Violations ---" | tee -a $LOGFILE exec_sql "SELECT * FROM pdb_plug_in_violations WHERE status='PENDING';" | tee -a $LOGFILE # 3. Listener parameters echo -e "\n--- 3. Listener Parameter ---" | tee -a $LOGFILE e...