AutoUpgrade before_actionローカル・パラメータの例

アップグレード計画の一部としてOracle Databaseの機能をインストールするには、before_actionローカル・パラメータを使用してスクリプトを実行できます。

次のスクリプトの例では、before_actionローカル・パラメータを使用して、アップグレード計画の一部としてAutoUpgradeを含むOracle Application Expressをインストールする方法を示しています。これらの例を自身のシステムで使用するには、ORACLE_HOMEORACLE_SIDおよびOracle Application Express (APX_HOME)の各インストール・ディレクトリを指すようにスクリプトを変更します。

例3-7 アップグレードの一部としてのOracle Application Expressのインストール

LinuxおよびUnixシステム:

#!/bin/sh
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
#
#
# DESCRIPTION
# Sample Shell Script to install Oracle APEX using AutoUpgrade Utility
#
#
# NOTES
# This script contains no resume capabilities. It also makes references to
# Oracle Linux Library path.
#
#
# MODIFIED (MM/DD/YY)
#
# Set APEX and Oracle Homes and sid
#
export APX_HOME="/scratch/kit/apx19"
export ORACLE_HOME="/scratch/base/1124"
export ORACLE_SID="db1124"
#
# Set Path and library
#
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
#
# Change directory to APEX home
#
cd $APX_HOME
#
# Remove and old log and list files
#
rm -f *.log
rm -f *.lst
#
# Write messages to progress.log file
#
echo "Installing APEX...." >> progress.log
echo "Starting Installing APEX...." >> progress.log
#
# Run the APEX Installation
#
$ORACLE_HOME/bin/sqlplus "/ as sysdba" @apexins SYSAUX SYSAUX TEMP /i/ > sqlplus.log
#
# Check for errors
#
echo "Completed Installing APEX...." >> progress.log
echo "Started checking status of the APEX Install" >> progress.log
retstat=`grep -i '^ORA-' *.log | wc -l | awk '{print $1}'`
echo "$retstat errors found" >> progress.log
echo "Finished checking status of the APEX Install" >> progress.log
#
# Write final progress and exit with success or failure status
#
if [ $retstat == 0 ]
then
   echo "Successful Install of APEX...." >> progress.log
   exit 0
fi
echo "Errors Found Installing APEX...." >> progress.log
echo "Check Installation logs at $APX_HOME" >> progress.log
exit 1

Microsoft Windowsシステム:


# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
#
#
# DESCRIPTION
# Sample Windows PowerShell Script to install Oracle APEX using AutoUpgrade Utility
#
#
# NOTES
# This script contains no resume capabilities.
#
#
# MODIFIED (MM/DD/YY)
# 09/24/19 - Created
#
# Set APEX and Oracle Homes and sid
#
$env:APX_HOME="c:\kit\apx19"
$env:ORACLE_HOME="c:\oracle\1124"
$env:ORACLE_SID="db1124"
#
# Set Path
#
$powershell_path=$env:ORACLE_HOME + "\bin" + $env:PSModulePath
#
# Change directory to APEX home
#
cd $env:APX_HOME
#
# Remove and old log and list files
#
Remove-item * -Filter *.log
Remove-item * -Filter *.lst
#
# Write messages to progress.log file
#
Write-Output "Installing APEX...." | Out-File -FilePath .\progress.log -Append
Write-Output "Starting Installing APEX...." | Out-File -FilePath .\progress.log -Append
#
# Run the APEX Installation
#
sqlplus "/ as sysdba" "@apexins" SYSAUX SYSAUX TEMP /i/ | Out-File -FilePath sqlplus.log
#
# Check for errors
#
Write-Output "Completed Installing APEX...." | Out-File -FilePath .\progress.log -Append
Write-Output "Started checking status of the APEX Install" | Out-File -FilePath .\progress.log -Append
$retstat=(sls "^ORA-" *.log | Measure-Object -line).Lines
Write-Output "$retstat errors found" | Out-File -FilePath .\progress.log -Append
Write-Output "Finished checking status of the APEX Install" | Out-File -FilePath .\progress.log -Append
#
# Write final progress and exit with success or failure status
#
if ($retstat -eq 0) {
   Write-Output "Successful Install of APEX...." | Out-File -FilePath .\progress.log -Append
   exit 0
}
Write-Output "Errors Found Installing APEX...." | Out-File -FilePath .\progress.log -Append
Write-Output "Check Installation logs at $env:APX_HOME" | Out-File -FilePath .\progress.log -Append
exit 1