diff --git a/oracle_clone.sh b/oracle_clone.sh index 9d23be1..55ffb5a 100755 --- a/oracle_clone.sh +++ b/oracle_clone.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Perform a Clone of an Oracle DB -# v1.0 - James Pattinson - October 2025 +# v1.2 - James Pattinson - October 2025 # # usage: oracle_clone.sh [options] # @@ -12,6 +12,7 @@ # -p Custom pfile for the clone # -a Advanced Cloning Options (can be used multiple times) # -b Comma-separated list of PDBs to clone (include only these PDBs. PDB$SEED is always included) +# -c Number of RMAN channels to use # -d Dry run mode - show API payload without executing # # Time is passed to 'date' on THIS machine, will use local timezone @@ -28,6 +29,7 @@ usage() { echo "Usage: $0 [options] " 1>&2 echo " -p Custom pfile for the clone" 1>&2 echo " -a Advanced Cloning Options (can be used multiple times)" 1>&2 echo " -b Comma-separated list of PDBs to clone (include only these PDBs)" 1>&2 + echo " -c Number of RMAN channels to use" 1>&2 echo " -d Dry run mode" 1>&2 exit 1; } @@ -35,7 +37,8 @@ declare -a config_pairs declare -a pdb_list dryrun=false -while getopts "h:dt:n:p:a:b:" o; do +num_channels="" +while getopts "h:dt:n:p:a:b:c:" o; do case "${o}" in h) RBK_HOST=${OPTARG} @@ -55,6 +58,9 @@ while getopts "h:dt:n:p:a:b:" o; do b) IFS=',' read -ra pdb_list <<< "${OPTARG}" ;; + c) + num_channels=${OPTARG} + ;; d) dryrun=true ;; @@ -129,6 +135,10 @@ if [ -n "$custompfile" ]; then PAYLOAD="$PAYLOAD,\"customPfilePath\":\"$custompfile\"" fi +if [ -n "$num_channels" ]; then + PAYLOAD="$PAYLOAD,\"numChannels\":$num_channels" +fi + # Add pdbsToClone array if -b specified if [ ${#pdb_list[@]} -gt 0 ]; then pdbs_json="\"PDB\$SEED\""