From 2c038ead0cb2f90bb53693cefdb63a7366376bd4 Mon Sep 17 00:00:00 2001 From: Klaus Tannenberg Date: Fri, 20 Sep 2024 23:36:12 +0100 Subject: [PATCH] Allow to create new PDB from an existing pdb file instead of pdbseed --- createDatabase | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/createDatabase b/createDatabase index 89fcb4d..c66da48 100755 --- a/createDatabase +++ b/createDatabase @@ -27,20 +27,46 @@ set -Eeuo pipefail NEW_PDB="${1:-}" if [ -n "${NEW_PDB}" ]; then + if [ -f "${ORACLE_BASE}/${NEW_PDB}.pdb" ]; then + echo "Plugging existing pluggable database ${NEW_PDB} from ${ORACLE_BASE}/${NEW_PDB}.pdb" - RANDOM_PDBADIN_PASSWORD=$(date +%s | sha256sum | base64 | head -c 8) + sqlplus -s / as sysdba <