Skip to content

Commit

Permalink
Fix PDB listing for 12.1 databases
Browse files Browse the repository at this point in the history
* Differentiation is dependend on compatible not version
  • Loading branch information
JanSchnacki committed Dec 10, 2023
1 parent 827524c commit 16130d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ocenv
Original file line number Diff line number Diff line change
Expand Up @@ -1876,14 +1876,20 @@ vilsnr(){
fi
}
fill_pdb_details_list () {
if [[ "${GV_DB_COMPATIBLE:0:6}" == "12.1.0" ]]
then
local LV_QUERY="SELECT name ||'|'|| open_mode ||'|'|| restricted ||'|'|| TO_CHAR(open_time, 'YYYY-MM-DD HH24:MI:SS') ||'|'|| 'N/A' FROM v\$pdbs WHERE name <> 'PDB\$SEED' ORDER BY name"
else
local LV_QUERY="SELECT name ||'|'|| open_mode ||'|'|| restricted ||'|'|| TO_CHAR(open_time, 'YYYY-MM-DD HH24:MI:SS') ||'|'|| DECODE(local_undo, 1, 'YES', 'NO') FROM v\$pdbs WHERE name <> 'PDB\$SEED' ORDER BY name"
fi
unset GV_PDB_LIST_DETAILS

if [[ "${GV_IS_CDB}" == "YES" ]]
then
while read -r LV_PDB_ELEM
do
GV_PDB_LIST_DETAILS[${#GV_PDB_LIST_DETAILS[@]}]="${LV_PDB_ELEM}"
done <<< "$(exec_sql_data "SELECT name ||'|'|| open_mode ||'|'|| restricted ||'|'|| TO_CHAR(open_time, 'YYYY-MM-DD HH24:MI:SS') ||'|'|| DECODE(local_undo, 1, 'YES', 'NO') FROM v\$pdbs WHERE name <> 'PDB\$SEED' ORDER BY name")"
done <<< "$(exec_sql_data "${LV_QUERY}")"
fi
}
list_pdbs() {
Expand Down

0 comments on commit 16130d2

Please sign in to comment.