Provisioning the Oracle 19C database
Procedure
Perform the following steps to provision Oracle 19c database VDB.
Refresh the Target DB environment from Manage > Environments so that the Listener brought up during DBTechstack provision gets discovered and the Installation Home to be listed in dropdown during Database provision. If the Target DB environment is not refreshed, you will see `This environment has no compatible Oracle Installation Homes` in the Installation Home dropdown in the Database provision.
Provision the EBS database to the target dbTier environment by following the steps outlined in Provisioning an Oracle VDB. For Oracle EBS database for 19c MT, provision the database by following the steps outlined in Provisioning an Oracle Virtual Pluggable Database (vPDB)
Note: Snapshot conflicts: when Snapshot is running against the DBTechstack, database, or AppsTier, the Delphix Continuous Data Engine also executes pre-clone logic to ensure the latest configuration is staged in the captured snapshots. Unfortunately, if multiple Snapshots are running against the same EBS instance concurrently, this pre-clone logic may fail and produce bad snapshots.
To avoid SnapSync conflicts, spread out your SnapSync policies for an EBS instance by one hour or more.Select the correct Installation Home.
This should be the virtual DBTechstack you just added to the Delphix Continuous Data Engine.Select an Environment User. This user should be the oracle user-outlined in Preparing Target EBS R12.2 Environments for Provisioning.
For the Container Database option, select the checkbox next to Create a New Container Database, and click Next.
Select a Target Group for the VDB.
In the vPDB Configuration section, provide the Target PDB name given during DBTechstack provision in the Oracle Pluggable Database Name field and provide any unique user-defined name in vPDB Name to be displayed in the Delphix Continuous Data Engine.
In vCDB CONFIGURATION section, provide the Target DB/CDB SID name given during DBTechstack provision in the Database Name field and SID and provide any unique user-defined name in the vCDB Name and Database Unique Name field, and click Next.
Click Advanced.
Select the correct Oracle Node Listeners value.
This should be the listener corresponding to the virtual DBTechstack you just added to the Delphix Continuous Data Engine.(Optional) Add the EBS R12.2 dbTier environment file as a Custom Environment Variables entry.
This file can be specified as an Environment File with Path Parameters of $ORACLE_HOME/<CONTEXT_NAME> .Replace <CONTEXT_NAME> with the virtual EBS instance's context name. The Delphix Continuous Data Engine will expand the $ORACLE_HOME variable at runtime.
For more information, see Customizing Oracle VDB environment variables
Note: To complete the DB Provisioning operation, you must provide content to configure clones and pre-snapshot hooks. You must either follow step 12 to use the hooks utility feature OR proceed with the conventional way by following steps 13-18.
To complete the DB Provisioning operation, you must provide content to configure clones and pre-snapshot hooks. The following are the content for both the hooks:
Configure Clone hook will be
<DBTechstack Mount point>/hooksUtil/hooksRunner --operation configure
. You must set a hooks environment variableDLPX_SOURCE_APPS_PASSWORD
for providing the source apps schema password andDLPX_SYS_PASSWORD
for SYSTEM schema password.Pre-Snapshot hook :
<DBTechstack Mount point>/hooksUtil/hooksRunner --operation pre-snapshot
. You must set a hooks environment variableDLPX_SOURCE_APPS_PASSWORD
for providing the source apps schema password. In case the apps password change is required in target VDB, you can set hook environment variablesDLPX_TARGET_APPS_PASSWORD
for providing the target apps schema.Note:
For versions 19.3 or later, follow the below guidelines if you see any of the following error:ORA-01017: invalid username/password logon denied
ORA-28040 During cloning: No Matching Authentication Protocol
Occasionally, it is necessary to restart the database to resolve connectivity to the database. This is atypical but may be necessary in certain cases.
On target container database, run the following command:
alter system set SEC_CASE_SENSITIVE_LOGON=FALSE scope=both;The above ALTER command should run as a first configure clone hook.
CODE. "${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env"; sqlplus -s "/ as sysdba" <<EOF alter system set SEC_CASE_SENSITIVE_LOGON=FALSE scope=both; EOF
Warning: EBS application database user accounts created in the earlier release uses a case-insensitive password version from an earlier release authentication protocol, such as the 10G password version. If your release user account passwords have not been reset and the following conditions persists, then take the action as described below:
On source, the database server has been configured with SEC_CASE_SENSITIVE_LOGON set to FALSE, so that it can only authenticate users who have a 10G case-insensitive password version. Then, on the target container VDB, it becomes necessary to set the SEC_CASE_SENSITIVE_LOGON to FALSE, to make authentication of users successful.
Note: To take advantage of the password protections introduced in Oracle Database 19c, users must change their passwords.
Add a Run Bash Shell Command operation to the Configure Clone hook to ensure that
adcfgclone
utility is run against the newly provisioned database for a high privileged user, as shown in the script below.
Note: You can pass the credentials securely to Hook Operations by setting up the base variables. See Other hook operations for more details.
Note: It is mandatory to set a hooks environment variable DLPX_SOURCE_APPS_PASSWORD
for providing the source apps schema password. In case the apps password change is required in target VDB, you can set hook environment variables DLPX_TARGET_APPS_PASSWORD
and DLPX_SYS_PASSWORD
for providing the target apps schema and system schema passwords in respective hooks. The variables will be declared in the Credential Environment Variables hook sectionYou can pass the credentials securely to Hook Operations by setting up the base variables. See Other hook operations for more details.
The hooks environment variable will be declared as,
DLPX_SOURCE_APPS_PASSWORD
and then its password value will be the same variable used in hooks, along with thePASSWORD
keyword appended at the end so that it will be likeDLPX_SOURCE_APPS_PASSWORD_PASSWORD
We assign the value of $DLPX_SOURCE_APPS_PASSWRD
toAPPS_PASSWD
.
In hooks, it is written as
APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD
Same goes for SYSTEM_PASSWD:
SYSTEM_PASSWD=$DLPX_SYS_PASSWORD_PASSWORD
Note: Customers have to identify the DLPX_DB_EXEC_SCRIPT value from their remote environment, this would always be inside the toolkit directory provided while adding the environment on Delphix Continuous Data Engine.You should replace the value for DLPX_DB_EXEC_SCRIPT
from all the given hooks according to the path that exists in your environment. Please replace the following lines from hook scripts accordingly.You can pass the credentials securely to Hook Operations by setting up the base variables. See Other hook operations for more details.
DLPX_DB_EXEC_SCRIPT="<Remote BIN location till dlpx_db_exec script>"
DLPX_PRIV_USER=<replace with your db user> eg:oravis
Configure clone first hook for a 19c multi-tenant high privileged user.
#!/usr/bin/env bash
#
# Copyright (c) 2022 by Delphix. All rights reserved.
#
# shellcheck source=/dev/null
# NOTE: Ensure the below environment variables will be set up correctly by the
# shell. If not, hardcode or generate the values below.
HOSTNAME=$(uname -n | cut -d '.' -f1)
CONTEXT_NAME=${DELPHIX_PDB_NAME}_${HOSTNAME}
APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD
. "${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env";
# Check for local_listener parameter is set for PDB, otherwise set it
# appropriately
check_value=$(sqlplus -s "/ as sysdba" <<EOF
alter session set container="${DELPHIX_PDB_NAME}";
show parameter local_listener;
EOF
)
local_listener=$(echo "$check_value" | awk '{print $11}')
value=("${local_listener//:/ }")
host="${value[0]}"
port="${value[1]}"
curr_port=$(grep PORT < "${ORACLE_HOME}/network/admin/listener.ora" | awk '{print $9}' | sed 's/)//g')
if [[ $port != "$curr_port" || $host != "${HOSTNAME}" ]]; then
sqlplus -s "/ as sysdba" <<EOF
alter session set container="${DELPHIX_PDB_NAME}";
alter system set local_listener='${HOSTNAME}:${curr_port}';
alter system register;
EOF
fi
#For compatibility with 6.0.16.0 Delphix Continuous Data Engine version
. ${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env; sqlplus -s "/ as sysdba" <<EOF
shutdown immediate;
startup;
ALTER PLUGGABLE DATABASE ALL OPEN read write services=all;
alter pluggable database ${DELPHIX_PDB_NAME} open read write services=all;
alter pluggable database all save state instances=all;
EOF
sqlplus "/ as sysdba" <<EOF
@${ORACLE_HOME}/appsutil/install/${CONTEXT_NAME}/adupdlib.sql so
EOF
. "${ORACLE_HOME}/${CONTEXT_NAME}.env";
perl "${ORACLE_HOME}/appsutil/clone/bin/adcfgclone.pl" dbconfig "${ORACLE_HOME}/appsutil/${CONTEXT_NAME}.xml" <<EOF # noqa
${APPS_PASSWD}
EOF
Configure Clone hook to ensure that
adcfgclone
is run against the newly provisioned database for a low privileged user, as shown in the script below. Configure clone first hook for a 19c multi-tenant low privileged userCODE#!/usr/bin/env bash # # Copyright (c) 2022 by Delphix. All rights reserved. # # shellcheck source=/dev/null # NOTE: Ensure the below environment variables will be set up correctly by the # shell. If not, hardcode or generate the values below. DLPX_DB_EXEC_SCRIPT="<Remote BIN location till dlpx_db_exec script>" DLPX_PRIV_USER=oravis HOSTNAME=$(uname -n | cut -d '.' -f1) APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD CONTEXT_NAME=${DELPHIX_PDB_NAME}_${HOSTNAME} "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env;" # Check for local_listener parameter is set for PDB, otherwise set it appropriately check_value=$("${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; sqlplus -s \"/ as sysdba\" <<-EOF alter session set container=${DELPHIX_PDB_NAME}; show parameter local_listener; EOF ") local_listener=$(echo "$check_value" | awk '{print $11}') value=("${local_listener//:/ }") host="${value[0]}" port="${value[1]}" curr_port=$(grep PORT < "${ORACLE_HOME}/network/admin/listener.ora" | awk '{print $9}' | sed 's/)//g') if [[ $port != "$curr_port" || $host != "${HOSTNAME}" ]]; then "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env; sqlplus -s \"/ as sysdba\" <<EOF alter session set container=${DELPHIX_PDB_NAME}; alter system set local_listener='${HOSTNAME}:${curr_port}'; alter system register; EOF " fi #For compatibility with 6.0.16.0 Delphix Continuous Data Engine version "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env; sqlplus -s "/ as sysdba" <<EOF shutdown immediate; startup; ALTER PLUGGABLE DATABASE ALL OPEN read write services=all; alter pluggable database ${DELPHIX_PDB_NAME} open read write services=all; alter pluggable database all save state instances=all; EOF " "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env; sqlplus \"/ as sysdba\" <<-EOF @${ORACLE_HOME}/appsutil/install/${CONTEXT_NAME}/adupdlib.sql so EOF " "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; perl ${ORACLE_HOME}/appsutil/clone/bin/adcfgclone.pl dbconfig ${ORACLE_HOME}/appsutil/${CONTEXT_NAME}.xml <<-EOF1 ${APPS_PASSWD} EOF1 "
While setting up hooks environment variables, if your environment is on R12.TXK.C.Delta.13 or later, set
DLPX_SYS_PASSWORD
variable’s password asDLPX_SYS_PASSWORD
variable’s password as
This requirement is outlined in the FAQ: Oracle E-Business Suite and System Schema Migration (DocID 2758999.1) Using UTL_FILE_DIR or Database Directories for PL/SQL File I/O in Oracle E-Business Suite Releases 12.1 and 12.2 (DocID 2525754.1) found at http://docs.oracle.com
Configure clone second hook for a 19c multi-tenant high privileged user:CODE#!/usr/bin/env bash # # Copyright (c) 2022 by Delphix. All rights reserved. # # shellcheck source=/dev/null # Set the target UTL_FILE_DIR values in the Oracle 19c database in the below # variable UTL_FILE_DIR_PATH separated by commas # Example UTL_FILE_DIR_PATH=/u01/oracle/VIS/temp/VISPDB,\ # /u01/oracle/VIS/19.3.0/appsutil/outbound/UTL,/u01/tmp # UTL_FILE_DIR_PATH=<provide utl_file_dir locations separated by commas> # If your environment is on R12.TXK.C.Delta.13 or later, enter the password # for the EBS_SYSTEM user. If your environment is on R12.TXK.C.Delta.12 or # earlier, enter the password for the SYSTEM user. SYSTEM_PASSWD=$DLPX_SYS_PASSWORD_PASSWORD DLPX_HOSTNAME=$(uname -n | cut -d '.' -f1) TIMESTAMP=$(date +%d-%m-%Y_%H-%M-%S) CONTEXT_NAME=${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME} APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD DIR_OBJ_PATH="${ORACLE_HOME}/appsutil/outbound/${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME}" checkExists() { if [[ ! -f $1 ]]; then echo "$1 does not exist." exit 1 fi } checkExists "${ORACLE_HOME}/${CONTEXT_NAME}.env" checkExists "${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl" . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; echo "${APPS_PASSWD}" | perl "${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl" -contextfile="${ORACLE_HOME}/appsutil/${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME}.xml" -oraclehome="${ORACLE_HOME}" -outdir="${ORACLE_HOME}/appsutil/log" -mode=getUtlFileDir checkExists "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" cp "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt${TIMESTAMP}" cat /dev/null > "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" if [ -z "$UTL_FILE_DIR_PATH" ]; then mkdir -p "${ORACLE_HOME}/appsutil/outbound/${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME}" echo "${ORACLE_HOME}/appsutil/outbound/${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME}" > "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" mkdir -p "${ORACLE_BASE}/temp/${DELPHIX_PDB_NAME}" echo "${ORACLE_BASE}/temp/${DELPHIX_PDB_NAME}" >> "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" else echo "$UTL_FILE_DIR_PATH" | awk -F, '{ for (i = 1; i < NF+1; ++i ) print $i >> "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" }' fi { echo "${APPS_PASSWD}"; echo "${SYSTEM_PASSWD}"; } | perl "${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl" -contextfile="${ORACLE_HOME}/appsutil/${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME}.xml" -oraclehome="${ORACLE_HOME}" -outdir="${ORACLE_HOME}/appsutil/log" -mode=setUtlFileDir { echo "${APPS_PASSWD}"; echo "${SYSTEM_PASSWD}"; echo "${DIR_OBJ_PATH}"; } | perl "${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl" -contextfile="${ORACLE_HOME}/appsutil/${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME}.xml" -oraclehome="${ORACLE_HOME}" -outdir="${ORACLE_HOME}/appsutil/log" -mode=createDirObject echo "${APPS_PASSWD}" | perl "${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl" -contextfile="${ORACLE_HOME}/appsutil/${DELPHIX_PDB_NAME}_${DLPX_HOSTNAME}.xml" -oraclehome="${ORACLE_HOME}" -outdir="${ORACLE_HOME}/appsutil/log" -mode=syncUtlFileDir -skipautoconfig=yes
Configure Clone hook to ensure that sqlnet.ora or sqlnet_ifile.ora specify a value for SQLNET.ALLOWED_LOGON_VERSION_SERVER for a low privileged user, as shown in the script below.
While setting up hooks environment variables, if your environment is on R12.TXK.C.Delta.13 or later, setDLPX_SYS_PASSWORD
variable’s password asDLPX_SYS_PASSWORD
variable’s password as
This requirement is outlined in the FAQ: Oracle E-Business Suite and System Schema Migration (DocID 2758999.1) Using UTL_FILE_DIR or Database Directories for PL/SQL File I/O in Oracle E-Business Suite Releases 12.1 and 12.2 (DocID 2525754.1) found at http://docs.oracle.com. Configure clone second hook for a 19c multi-tenant low privileged userCODE#!/usr/bin/env bash # # Copyright (c) 2022 by Delphix. All rights reserved. # # shellcheck source=/dev/null # Set the target UTL_FILE_DIR values in the Oracle 19c database # Example UTL_FILE_DIR_PATH=/u01/oracle/VIS/temp/VISPDB,\ # /u01/oracle/VIS/19.3.0/appsutil/outbound/UTL # UTL_FILE_DIR_PATH=<provide utl_file_dir locations separated by commas> # If your environment is on R12.TXK.C.Delta.13 or later, enter the password # for the EBS_SYSTEM user. If your environment is on R12.TXK.C.Delta.12 or # earlier, enter the password for the SYSTEM user. SYSTEM_PASSWD=$DLPX_SYS_PASSWORD_PASSWORD DLPX_DB_EXEC_SCRIPT="<Remote BIN location till dlpx_db_exec script>" DLPX_PRIV_USER=oravis APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD HOSTNAME=$(uname -n | cut -d '.' -f1) CONTEXT_NAME=${DELPHIX_PDB_NAME}_${HOSTNAME} DIR_OBJ_PATH="${ORACLE_HOME}/appsutil/outbound/${CONTEXT_NAME}" TIMESTAMP=$(date +%d-%m-%Y_%H-%M-%S) checkExists() { if [[ ! -f $1 ]]; then echo "$1 does not exist." exit 1 fi } checkExists "${ORACLE_HOME}/${CONTEXT_NAME}.env" checkExists "${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl" . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; perl ${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=${ORACLE_HOME}/appsutil/${CONTEXT_NAME}.xml -oraclehome=${ORACLE_HOME} -outdir=${ORACLE_HOME}/appsutil/log -mode=getUtlFileDir <<-EOF ${APPS_PASSWD} EOF " checkExists "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "cp ${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" "${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt${TIMESTAMP}" "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "echo "" > \"${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt\"" # Initialise for shell check to succeed i=0 if [ -z "$UTL_FILE_DIR_PATH" ]; then "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "mkdir -p ${ORACLE_HOME}/appsutil/outbound/${CONTEXT_NAME}" "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "echo ${ORACLE_HOME}/appsutil/outbound/${CONTEXT_NAME} > ${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "mkdir -p ${ORACLE_BASE}/temp/${DELPHIX_PDB_NAME}" "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "echo ${ORACLE_BASE}/temp/${DELPHIX_PDB_NAME} >> ${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" else "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "echo $UTL_FILE_DIR_PATH | awk -F, '{ for (i = 1; i < NF+1; ++i ) print $i }' > ${ORACLE_HOME}/dbs/${DELPHIX_PDB_NAME}_utlfiledir.txt" fi "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; perl ${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=${ORACLE_HOME}/appsutil/${CONTEXT_NAME}.xml -oraclehome=${ORACLE_HOME} -outdir=${ORACLE_HOME}/appsutil/log -mode=setUtlFileDir <<-EOF1 ${APPS_PASSWD} ${SYSTEM_PASSWD} EOF1 " "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; perl ${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=${ORACLE_HOME}/appsutil/${CONTEXT_NAME}.xml -oraclehome=${ORACLE_HOME} -outdir=${ORACLE_HOME}/appsutil/log -mode=createDirObject <<-EOF2 ${APPS_PASSWD} ${SYSTEM_PASSWD} ${DIR_OBJ_PATH} EOF2 " "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; perl ${ORACLE_HOME}/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=${ORACLE_HOME}/appsutil/${CONTEXT_NAME}.xml -oraclehome=${ORACLE_HOME} -outdir=${ORACLE_HOME}/appsutil/log -mode=syncUtlFileDir -skipautoconfig=yes <<-EOF3 ${APPS_PASSWD} EOF3 "
Set up a Pre-Snapshot hook Run Bash Shell Command operation to run any pre-clone steps necessary and specific to your EBS database for a high privileged user, as shown in the script below.
Normally, these steps will include running Oracle's adpreclone tool.
Pre-snapshot hook for a 19c multi-tenant high privileged user.CODE#!/usr/bin/env bash # # Copyright (c) 2022 by Delphix. All rights reserved. # # shellcheck source=/dev/null # As grep has to check all the matches in making decision on L58 # shellcheck disable=SC2143 # NOTE: Ensure the below environment variables will be set up correctly by # the shell. If not, hardcode or generate the values below. HOSTNAME=$(uname -n | cut -d '.' -f1) CONTEXT_NAME=${DELPHIX_PDB_NAME}_${HOSTNAME} SOURCE_APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD TARGET_APPS_PASSWD=$DLPX_TARGET_APPS_PASSWORD_PASSWORD timeout=3600 waittime=0 ORACLE_USER="oravis" # Query active PDB services . "${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env"; check_value=$(sqlplus -s "/ as sysdba" <<EOF SELECT NAME FROM v\$active_services; exit; EOF ) checkService() { if ! echo "$1" | grep -q "$2"; then . "${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env"; sqlplus -s "/ as sysdba" <<EOF alter session set container="${DELPHIX_PDB_NAME}"; BEGIN DBMS_SERVICE.START_SERVICE( service_name => '$2'); end; / EOF fi } # Check for ebs_PDB service checkService "$check_value" "ebs_${DELPHIX_PDB_NAME}" # Check for PDB_ebs_patch service checkService "$check_value" "${DELPHIX_PDB_NAME}_ebs_patch" . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; testAppsPassword() { local passwordInQuestion=$1 ERROR=$(sqlplus "apps/${passwordInQuestion}@${DELPHIX_PDB_NAME}" <<< "exit;") grep ORA-01017 <<< "${ERROR}" >/dev/null && return 1 return 0 } testAppsPassword "${SOURCE_APPS_PASSWD}" testResult=$? if [[ ${testResult} == 0 ]]; then APPS_PASSWD="${SOURCE_APPS_PASSWD}" else APPS_PASSWD="${TARGET_APPS_PASSWD}" fi while [[ -f "${ORACLE_HOME}/.delphix_adpreclone.lck" || $(pgrep -au "${ORACLE_USER}" | grep "^${ORACLE_HOME}" | grep -v grep | grep "adpreclone") ]] ; do if [[ $waittime -gt $timeout ]]; then echo "Another adpreclone process is still running from last 60 mins.Delphix cannot proceed until it is complete. Exiting Now." exit 1 fi echo " Another adpreclone process is running. waiting for the process to complete before starting the adpreclone of the database...." (( timeout += 10 )) sleep 10 done echo "No other adpreclone process is running on the database, proceeding ...." "${ORACLE_HOME}"/perl/bin/perl "${ORACLE_HOME}/appsutil/scripts/${CONTEXT_NAME}/adpreclone.pl" dbTier <<-EOF ${APPS_PASSWD} EOF
Pre-Snapshot hook Run Bash Shell Command operation to run any pre-clone steps necessary and specific to your EBS database for a low privileged user, as shown in the script below.
Pre-snapshot hook for a 19c multi-tenant low privileged user
CODE#!/usr/bin/env bash # # Copyright (c) 2022 by Delphix. All rights reserved. # # shellcheck source=/dev/null # As grep has to check all the matches in making decision on L58 # shellcheck disable=SC2143 # NOTE: Ensure the below environment variables will be set up correctly by the # shell. If not, hardcode or generate the values below. DLPX_DB_EXEC_SCRIPT="<Remote BIN location till dlpx_db_exec script>" DLPX_PRIV_USER=oravis HOSTNAME=$(uname -n | cut -d '.' -f1) CONTEXT_NAME=${DELPHIX_PDB_NAME}_${HOSTNAME} SOURCE_APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD TARGET_APPS_PASSWD=$DLPX_TARGET_APPS_PASSWORD_PASSWORD timeout=3600 waittime=0 # Query active PDB services . "${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env"; check_value=$(sqlplus -s "/ as sysdba" <<EOF SELECT NAME FROM v\$active_services; exit; EOF ) checkService() { if ! echo "$1" | grep -q "$2"; then . "${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env"; sqlplus -s "/ as sysdba" <<EOF alter session set container="${DELPHIX_PDB_NAME}"; BEGIN DBMS_SERVICE.START_SERVICE( service_name => '$2'); end; / EOF fi } # Check for ebs_PDB service checkService "$check_value" "ebs_${DELPHIX_PDB_NAME}" # Check for PDB_ebs_patch service checkService "$check_value" "${DELPHIX_PDB_NAME}_ebs_patch" . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; testAppsPassword() { local passwordInQuestion=$1 ERROR=$("${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; sqlplus apps/\"${passwordInQuestion}\"@${DELPHIX_PDB_NAME} <<< \"exit;\"") grep ORA-01017 <<< "${ERROR}" >/dev/null && return 1 return 0 } testAppsPassword "${SOURCE_APPS_PASSWD}" testResult=$? if [[ ${testResult} == 0 ]]; then APPS_PASSWD=${SOURCE_APPS_PASSWD} else APPS_PASSWD=${TARGET_APPS_PASSWD} fi while [[ -f "${ORACLE_HOME}/.delphix_adpreclone.lck" || $(pgrep -au "${DLPX_PRIV_USER}" | grep "^${ORACLE_HOME}" | grep -v grep | grep "adpreclone") ]] ; do if [[ $waittime -gt $timeout ]]; then echo "Another adpreclone process is still running from the last 60 mins.Delphix cannot proceed until it is complete. Exiting Now." exit 1 fi echo " Another adpreclone process is running. waiting for the process to complete before starting the adpreclone of the database...." (( timeout += 10 )) sleep 10 done echo "No other adpreclone process is running on the database, proceeding ...." "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; ${ORACLE_HOME}/perl/bin/perl ${ORACLE_HOME}/appsutil/scripts/${CONTEXT_NAME}/adpreclone.pl dbTier <<-EOF ${APPS_PASSWD} EOF "