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