-
Notifications
You must be signed in to change notification settings - Fork 7
/
installDBBinaries.sh
executable file
·75 lines (65 loc) · 2.21 KB
/
installDBBinaries.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# LICENSE CDDL 1.0 + GPL 2.0
#
# Copyright (c) 1982-2016 Oracle and/or its affiliates. All rights reserved.
#
# Since: December, 2016
# Author: gerald.venzl@oracle.com
# Description: Sets up the unix environment for DB installation.
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
EDITION=$1
# Check whether edition has been passed on
if [ "$EDITION" == "" ]; then
echo "ERROR: No edition has been passed on!"
echo "Please specify the correct edition!"
exit 1;
fi;
# Check whether correct edition has been passed on
if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then
echo "ERROR: Wrong edition has been passed on!"
echo "Edition $EDITION is no a valid edition!"
exit 1;
fi;
# Check whether ORACLE_BASE is set
if [ "$ORACLE_BASE" == "" ]; then
echo "ERROR: ORACLE_BASE has not been set!"
echo "You have to have the ORACLE_BASE environment variable set to a valid value!"
exit 1;
fi;
# Check whether ORACLE_HOME is set
if [ "$ORACLE_HOME" == "" ]; then
echo "ERROR: ORACLE_HOME has not been set!"
echo "You have to have the ORACLE_HOME environment variable set to a valid value!"
exit 1;
fi;
# Replace place holders
# ---------------------
sed -i -e "s|###ORACLE_EDITION###|$EDITION|g" $INSTALL_DIR/$INSTALL_RSP && \
sed -i -e "s|###ORACLE_BASE###|$ORACLE_BASE|g" $INSTALL_DIR/$INSTALL_RSP && \
sed -i -e "s|###ORACLE_HOME###|$ORACLE_HOME|g" $INSTALL_DIR/$INSTALL_RSP
# Install Oracle binaries
cd $INSTALL_DIR && \
unzip $INSTALL_FILE_1 && \
rm $INSTALL_FILE_1 && \
$INSTALL_DIR/database/runInstaller -silent -force -waitforcompletion -responsefile $INSTALL_DIR/$INSTALL_RSP -ignoresysprereqs -ignoreprereq && \
cd $HOME
# Remove not needed components
rm -rf $ORACLE_HOME/apex && \
rm -rf $ORACLE_HOME/jdbc && \
# ZDLRA installer files
rm -rf $ORACLE_HOME/lib/ra*.zip && \
rm -rf $ORACLE_HOME/ords && \
rm -rf $ORACLE_HOME/sqldeveloper && \
rm -rf $ORACLE_HOME/ucp && \
# OUI backup
rm -rf $ORACLE_HOME/inventory/backup/* && \
# Network tools help
rm -rf $ORACLE_HOME/network/tools/help/mgr/help_* && \
# Temp location
rm -rf /tmp/* && \
# Database files directory
rm -rf $INSTALL_DIR/database
# Link password reset file to home directory
ln -s $ORACLE_BASE/$PWD_FILE $HOME/