Provisioning the Oracle 12C database
Procedure
Perform the following steps to provision Oracle 12c 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. Note: 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.
Select a Target Group for the VDB.
In the VDB Configuration section, provide Target DB/CDB SID name provided during DBTechstack provisioning in the Oracle Database Name and Oracle SID field. Provide any unique user-defined name in VDB Name and Oracle Database Unique Name 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.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.CODE. "${ORACLE_HOME}/${ORACLE_SID}_${HOSTNAME}.env"; sqlplus -s "/ as sysdba" <<EOF alter system set SEC_CASE_SENSITIVE_LOGON=FALSE scope=both; EOF
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-20.
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 can set a hooks environment variableDLPX_SOURCE_APPS_PASSWORD
for providing the source apps schema password.Pre-Snapshot hook :
<DBTechstack Mount point>/hooksUtil/hooksRunner --operation pre-snapshot
. You can set a hooks environment variableDLPX_SOURCE_APPS_PASSWORD
for providing the source apps schema password. In case of apps password change in target VDB, you can set hook environment variablesDLPX_TARGET_APPS_PASSWORD
for providing the target apps schema password.
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
for providing the target apps schema password in respective hooks. The variables will be declared in the Credential Environment Variables hook section.
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 the PASSWORD
keyword appended at the end so that it will be like DLPX_SOURCE_APPS_PASSWORD_PASSWORD
We assign the value of $DLPX_SOURCE_APPS_PASSWRD
to APPS_PASSWD
.
In hooks, it is written as:
APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD
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.CODEDLPX_DB_EXEC_SCRIPT="<Remote BIN location till dlpx_db_exec script>" DLPX_PRIV_USER=<replace with your db user> eg:oravis
For the EBS database, add a Run Bash Shell Command operation to the Configure Clone hook to ensure that sqlnet.ora or sqlnet_ifile.ora specify a value for SQLNET.ALLOWED_LOGON_VERSION_SERVER for a high privileged user, as shown in the script below.
This requirement is outlined in Cloning Oracle E-Business Suite Release 12.2 with Rapid Clone (Doc ID 1383621.1) found at http://docs.oracle.com
Configure clone second hook for a high privileged user.CODE#!/usr/bin/env bash # # Copyright (c) 2022, 2024 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. # If you are using sqlnet_ifile.ora, change the script below to reflect # sqlnet_ifile.ora Initialize dummy variable `parameter` to avoid shellcheck # to fail CONTEXT_NAME=${ORACLE_SID}_$(uname -n | cut -d '.' -f1) . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; TNS_ADMIN=${ORACLE_HOME}/network/admin/${CONTEXT_NAME} FILE="${TNS_ADMIN}/sqlnet.ora" if [[ ! -f "${FILE}" ]]; then { echo "#Creating sqlnet.ora file for Delphix configure clone hook" echo "###############################################################" echo "NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)" echo "SQLNET.EXPIRE_TIME=10" echo "SQLNET.INBOUND_CONNECT_TIMEOUT=60" echo "SQLNET.ALLOWED_LOGON_VERSION_SERVER=8" } >> "${TNS_ADMIN}/sqlnet.ora" fi echo "sqlnet.ora is created at location ${TNS_ADMIN}" check_value=$(sqlplus -s "/ as sysdba" <<EOF set head off termout off feedback off wrap off show parameter sec_case_sensitive_logon; EOF ) TNS_ADMIN=${ORACLE_HOME}/network/admin check_value=$(echo "${check_value}" | awk '{{print $3}}'| xargs) echo "sec_case_sensitive_logon initialization parameter value in the database is : ${check_value}" if [[ ${check_value} = "FALSE" ]]; then sed 's/^SQLNET.ALLOWED_LOGON_VERSION_SERVER=.*/SQLNET.ALLOWED_LOGON_VERSION_SERVER=8/g' "${TNS_ADMIN}/sqlnet.ora" > /var/tmp/temp.ora && mv /var/tmp/temp.ora "${TNS_ADMIN}/sqlnet.ora" elif [[ ${check_value} = "TRUE" ]]; then sed 's/^SQLNET.ALLOWED_LOGON_VERSION_SERVER=.*/SQLNET.ALLOWED_LOGON_VERSION_SERVER=10/g' "${TNS_ADMIN}/sqlnet.ora" > /var/tmp/temp.ora && mv /var/tmp/temp.ora "${TNS_ADMIN}/sqlnet.ora" else echo "sec_case_sensitive_logon parameter is not set in the database. So the sqlnet.ora has not been updated." fi
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.
Configure clone second hook for a low privileged user.CODE#!/usr/bin/env bash # # Copyright (c) 2022, 2024 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. # If you are using sqlnet_ifile.ora, change the script below to reflect # sqlnet_ifile.ora. # Initialize dummy variable `parameter` to avoid shellcheck to fail DLPX_DB_EXEC_SCRIPT="<Remote BIN location for dlpx_db_exec script>" DLPX_PRIV_USER=oravis CONTEXT_NAME=${ORACLE_SID}_$(uname -n | cut -d '.' -f1) TNS_ADMIN=${ORACLE_HOME}/network/admin/${CONTEXT_NAME} FILE="${TNS_ADMIN}/sqlnet.ora" if [[ ! -f "${FILE}" ]]; then { echo "#Creating sqlnet.ora file for Delphix configure clone hook" echo "###############################################################" echo "NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)" echo "SQLNET.EXPIRE_TIME=10" echo "SQLNET.INBOUND_CONNECT_TIMEOUT=60" echo "SQLNET.ALLOWED_LOGON_VERSION_SERVER=8" } >> "${TNS_ADMIN}/sqlnet.ora" fi echo "sqlnet.ora is created at location ${TNS_ADMIN}" check_value=$("${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; sqlplus \"/ as sysdba\" <<-EOF set head off termout off feedback off wrap off show parameter sec_case_sensitive_logon; EOF ") TNS_ADMIN=${ORACLE_HOME}/network/admin check_value=$(echo "${check_value}" | awk '{{print $3}}'| xargs) echo "sec_case_sensitive_logon initialization parameter value in the database is : ${check_value}" if [[ ${check_value} = "FALSE" ]]; then "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "sed 's/^SQLNET.ALLOWED_LOGON_VERSION_SERVER=.*/SQLNET.ALLOWED_LOGON_VERSION_SERVER=8/g' \"${TNS_ADMIN}/sqlnet.ora\" > /var/tmp/temp.ora && mv /var/tmp/temp.ora \"${TNS_ADMIN}/sqlnet.ora\"" elif [[ ${check_value} = "TRUE" ]]; then "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" "sed 's/^SQLNET.ALLOWED_LOGON_VERSION_SERVER=.*/SQLNET.ALLOWED_LOGON_VERSION_SERVER=10/g' \"${TNS_ADMIN}/sqlnet.ora\" > /var/tmp/temp.ora && mv /var/tmp/temp.ora \"${TNS_ADMIN}/sqlnet.ora\"" else echo "sec_case_sensitive_logon parameter is not set in the database. So the sqlnet.ora has not been updated." fi
Add a Run Bash Shell Command operation to the Configure Clone hook to ensure that
adcfgclone.pl script
is run against the newly provisioned database for a high privileged user, as shown in the script below.
Note: 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
andDLPX_SYS_PASSWORD
for providing the target apps schema and system schema passwords.Configure clone first hook for a high privileged user
CODE#!/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=${ORACLE_SID}_${HOSTNAME} APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; # Check for local_listener parameter is set for SID, otherwise set it # appropriately check_value=$(sqlplus -s "/ as sysdba" <<EOF 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 < "${TNS_ADMIN}/listener.ora" | awk '{print $9}' | sed 's/)//g') if [[ $port != "$curr_port" || $host != "${HOSTNAME}" ]]; then sqlplus -s "/ as sysdba" <<EOF alter system set local_listener='${HOSTNAME}:${curr_port}'; alter system register; EOF fi sqlplus "/ as sysdba" <<EOF @${ORACLE_HOME}/appsutil/install/${CONTEXT_NAME}/adupdlib.sql so EOF perl "${ORACLE_HOME}/appsutil/clone/bin/adcfgclone.pl" dbconfig "${ORACLE_HOME}/appsutil/${CONTEXT_NAME}.xml" <<EOF ${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.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.
Configure clone first hook for a low privileged user.CODE#!/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 for dlpx_db_exec script>" DLPX_PRIV_USER=oravis APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD HOSTNAME=$(uname -n | cut -d '.' -f1) CONTEXT_NAME=${ORACLE_SID}_${HOSTNAME} . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; # Check for local_listener parameter is set for SID, otherwise set it # appropriately check_value=$(sqlplus -s "/ as sysdba" <<EOF 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 < "${TNS_ADMIN}/listener.ora" | awk '{print $9}' | sed 's/)//g') if [[ $port != "$curr_port" || $host != "${HOSTNAME}" ]]; then sqlplus -s "/ as sysdba" <<EOF alter system set local_listener='${HOSTNAME}:${curr_port}'; alter system register; EOF fi "${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.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 "
Configure Clone hook to ensure that the ebs_<PDB_SID>listener services do not disappear during a start/stop VDB operation, as shown in the script in point 19.
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 high privileged user.CODE#!/usr/bin/env bash # # Copyright (c) 2023 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=${ORACLE_SID}_${HOSTNAME} SOURCE_APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD TARGET_APPS_PASSWD=$DLPX_TARGET_APPS_PASSWORD_PASSWORD ORACLE_USER="oravis" timeout=3600 waittime=0 . "${ORACLE_HOME}/${CONTEXT_NAME}.env"; testAppsPassword() { local passwordInQuestion=$1 ERROR=$(sqlplus "apps/${passwordInQuestion}" <<< "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 # Query active SID services 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}/${CONTEXT_NAME}.env"; sqlplus -s "/ as sysdba" <<EOF BEGIN DBMS_SERVICE.START_SERVICE( service_name => '$2'); end; / EOF fi } # Check for SID_ebs_patch or ebs_patch service based on the AD-TXK codelevel # version. In AD-TXK Delta 8 and earlier, the service name for connections # to the patch edition of the database was ebs_patch. In AD-TXK Delta 9, the # service name to connect to the patch edition has been changed to # <instance_name>_ebs_patch patch_level=$(sqlplus -s "apps/${APPS_PASSWD}" <<EOF select PATCH_LEVEL from apps.fnd_product_installations where PATCH_LEVEL like 'R12.AD.%'; EOF ) patch_service="${ORACLE_SID}_ebs_patch" if [ "${patch_level: -1}" -le 8 ]; then patch_service="ebs_patch" fi checkService "$check_value" "${patch_service}" 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 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 ...." "${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 low privileged user.CODE#!/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. # As grep has to check all the matches in making decision on L58 # shellcheck disable=SC2143 DLPX_DB_EXEC_SCRIPT="<Remote BIN location for dlpx_db_exec script>" DLPX_PRIV_USER=oravis HOSTNAME=$(uname -n | cut -d '.' -f1) CONTEXT_NAME=${ORACLE_SID}_${HOSTNAME} SOURCE_APPS_PASSWD=$DLPX_SOURCE_APPS_PASSWORD_PASSWORD TARGET_APPS_PASSWD=$DLPX_TARGET_APPS_PASSWORD_PASSWORD timeout=3600 waittime=0 testAppsPassword() { local passwordInQuestion=$1 ERROR=$("${DLPX_DB_EXEC_SCRIPT}" -u"${DLPX_PRIV_USER}" ". ${ORACLE_HOME}/${CONTEXT_NAME}.env; sqlplus apps/\"${passwordInQuestion}\" <<< \"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 # Query active SID services . "${ORACLE_HOME}/${CONTEXT_NAME}.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}/${CONTEXT_NAME}.env"; sqlplus -s "/ as sysdba" <<EOF BEGIN DBMS_SERVICE.START_SERVICE( service_name => '$2'); end; / EOF fi } # Check for SID_ebs_patch or ebs_patch service based on the AD-TXK codelevel # version. In AD-TXK Delta 8 and earlier, the service name for connections # to the patch edition of the database was ebs_patch. In AD-TXK Delta 9, the # service name to connect to the patch edition has been changed to # <instance_name>_ebs_patch patch_level=$(sqlplus -s "apps/${APPS_PASSWD}" <<EOF select PATCH_LEVEL from apps.fnd_product_installations where PATCH_LEVEL like 'R12.AD.%'; EOF ) patch_service="${ORACLE_SID}_ebs_patch" if [ "${patch_level: -1}" -le 8 ]; then patch_service="ebs_patch" fi checkService "$check_value" "${patch_service}" 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 "