Install Oracle DB Server (19c)

Exported on 23-Aug-2021 16:15:38

Parameters

Name Type Script Reference Default Value Comment
App Server Linux / Unix Server appServer
DB 19c ORACLE HOME Text db19cOracleHome /database/u00/product/db19c
DB Server Linux / Unix Server dbServer
Linux: Oracle User Linux OS Credential linuxOracleUser
Linux: Root User Linux OS Credential linuxRootUser
Ora DB NLS Territory Text oraDbNlsTerritory NEW ZEALAND The value for nls_territory in new oracle databases
Ora Extra Temp Datafile Size MB Text oraExtraTempDatafileSizeMb 500 The size to create the extra TEMP table space datafiles at. The value should be just an integer, indicating the size in mb.
Ora Extra Undo Datafile Size MB Text oraExtraUndoDatafileSizeMb 500 The size to create the extra UNDO table space datafiles at. The value should be just an integer, indicating the size in mb.
Ora PGA Aggregate Target MB Text oraPgaAggregateTargetMb 2560 Recommended PGA size = 15% of total oracle RAM if total for Oracle is 80%
Ora SGA Max Target MB Text oraSgaMaxTargetMb 12288 Recommended SGA size = 65% of total oracle RAM if total for Oracle is 80%
Ora SGA Target MB Text oraSgaTargetMb 6144
Oracle: system at NMS SQL Credential oracleSystemAtNms
Replication Servers Server Group replicationServers Server group containing the app and report servers in this replication group. This list is in the order of priority
Target Server Generic Server targetServer
Target Server: Lin Linux / Unix Server targetServerLin The target server is a generic placeholder, usually used for the server a script will run on. For example, the server being built if the procedure is building a server.
sys as sysdba SQL Credential sysAsSysdba

1 - Oracle Software Install Preparation

Preparation steps for Oracle software install

1.1 - O Create Oracle Install Groups

Create oinstall and dba groups if they dont already exist.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Create the oinstall group if it doesn't exist
grep -q oinstall /etc/group || groupadd oinstall

# Create the DBA group if it doesn't exist
grep -q dba /etc/group || groupadd dba

1.2 - O Create Oracle User

Oracle install procedure. Create the oracle linux user and groups.

This step has the following parameters

Name Script Reference Default Value
Linux: Oracle User {linuxOracleUser.user} None
Linux: Oracle User {linuxOracleUser.password}

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
if grep -q {linuxOracleUser.user} /etc/passwd
then
    echo "Oracle User Exists"
else
    echo "Creating Oracle User"
    useradd -m -s /bin/bash -c "Oracle Software User" -g oinstall -G dba,users {linuxOracleUser.user}
    chage -M -1 {linuxOracleUser.user}
    chage -d -1 {linuxOracleUser.user}
    #passwd -l {linuxOracleUser.user}
fi

# Symlink the oracle user to /users, if this is an app server
[ -e /users ] && ln -snf /home/oracle /users/oracle || true

# Set the oracle password
passwd {linuxOracleUser.user}

This step will require you to answer the following prompts.

Prompt Answer
password: {linuxOracleUser.password}

1.3 - Bootstrap Oracle for Attune

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname

1.4 - O Setup oraInst.loc

Required By : This step should be run before any oracle install.

This file is required for oracles installed software inventory.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "Waiting for other runInstaller to finish"
while pgrep -lf 'runInstaller'
do
    sleep 10s
done

[ -d /etc/oraInventory/logs ] || mkdir -p /etc/oraInventory/logs
[ -d /etc/oraInventory/oui ] || mkdir -p /etc/oraInventory/oui
[ -d /etc/oraInventory/ContentsXML ] || mkdir -p /etc/oraInventory/ContentsXML
[ -d /etc/oraInventory/backup ] || mkdir -p /etc/oraInventory/backup

ORA_INST=/etc/oraInst.loc

if [ -f $ORA_INST ]; then
    echo "oraInst.loc is already setup"
else
    echo "Installing new oraInst.loc"
cat <<EOF > $ORA_INST
inventory_loc=/etc/oraInventory
inst_group=oinstall
EOF

fi

touch /etc/oratab

INST_PROP=/etc/oraInventory/oraInstaller.properties
[ -f $INST_PROP ] || touch $INST_PROP


chown -R oracle:oinstall $ORA_INST /etc/oraInventory /etc/oratab
chmod -R ug+rw $ORA_INST /etc/oraInventory /etc/oratab

find  /etc/oraInventory -type d -exec chmod ug+x {} \;

2 - RHEL7 Oracle Package Updates

Install Oracle Prerequisites packages.

2.1 - R7 Install Oracle Prerequisites Packages

Install the redhat package requirements for all oracle client and oracle database

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
UTILS="sysstat.x86_64 zip unzip smartmontools"
SHELLS=" ksh"
COMPILE=" binutils.x86_64 gcc.x86_64 gcc-c++.x86_64 make.x86_64 "

LIBGCC=" libgcc.x86_64 libgcc.i686"
LIBCPP=" libstdc++.x86_64 libstdc++-devel.x86_64 libstdc++.i686 libstdc++-devel.i686"

GLIB=" glibc.x86_64 glibc-devel.x86_64 glibc.i686 glibc-devel.i686"

COMPAT=" compat-libcap1.x86_64 compat-libstdc++-33"

LIBAIO="libaio-devel.i686 libaio.i686 libaio.x86_64 libaio-devel.x86_64"
LIBXTST="libXtst.x86_64 libXtst.i686 "
LIBXI="libXi.x86_64 libXi.i686"

yum install -y \
    $UTILS \
    $SHELLS \
    $COMPILE \
    $LIBGCC \
    $LIBCPP \
    $GLIB \
    $COMPAT \
    $LIBAIO \
    $LIBXTST \
    $LIBXI

3 - Oracle 19c Database Deployment

Oracle 19c Database Deployment.

3.1 - ODB19 Create Diretories

Create database directories if they do not exist and change the owner and group on them.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Create the database directories if they do not exist

for dir in u01 u02 u03 u04; do
    fulldir=/database/$dir/oradata
    if [ -d $fulldir ]; then
        echo "$fulldir exists"
    else
        mkdir -p $fulldir
        echo "Creating $fulldir"
    fi
    #ls -ld $fulldir
done

echo "Granting oracle permissions"
chown -R oracle:oinstall /database/

3.2 - ODB19 Deploy Install Files

Copy the oracle database install files to the server

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive Oracle 19c Database 19.3.0.0.0.tar to remote path {db19cOracleHome}
  1. Locate Files archive "Oracle 19c Database 19.3.0.0.0.tar", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to {db19cOracleHome}, relative to the home directory
  4. Check that the files are in the correct location

3.3 - ODB19 Extract Install Files

Unzip each installer archive and then delete the archive.

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
cd {db19cOracleHome}

for f in *.zip; do
    echo "Unzipping $f"
    unzip -q $f
    rm $f
done

3.4 - ODB19 Configure Oracle .bashrc

Configure Oracle .bashrc file.

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
F=~/.bashrc

ORACLE_HOME={db19cOracleHome}

if grep ORACLE_HOME $F ; then 
    echo "$F already configured"
else
    echo "Configuring $F"
cat <<"EOF" > $F
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
umask 022
ORACLE_HOME={db19cOracleHome}
ORACLE_HOME_LISTENER=$ORACLE_HOME
ORACLE_BASE=`dirname $ORACLE_HOME`
ORACLE_SID=NMS
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/javavm/jdk/jdk7/lib:$ORACLE_HOME/lib:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export ORACLE_HOME
export ORACLE_HOME_LISTENER
export ORACLE_BASE
export ORACLE_SID
export PATH
export LD_LIBRARY_PATH
export CLASSPATH
EOF

fi

3.5 - ODB19 Configure sysctl.conf

Update /etc/sysctl.conf with standard values.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Python Code make sure you run it with python from a terminal session
print("Adding required lines to /etc/sysctl.conf")

# kernel.shmmax = 8gb 

newVals = '''
kernel.sysrq = 1
fs.suid_dumpable = 1
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 26000 65500
kernel.sem = 1000 32000 400 500
kernel.shmall = 38654705664
kernel.shmmax = 38654705664
kernel.shmmni = 4096
kernel.msgmni = 256
kernel.msgmax = 65535
kernel.msgmnb = 65535
vm.overcommit_memory = 1
net.core.rmem_default = 262144
net.core.rmem_max = 42943040
net.core.wmem_default = 262144
net.core.wmem_max = 42943040
net.ipv4.tcp_keepalive_time = 1500
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.ip_conntrack_max = 131072
net.ipv4.tcp_syncookies = 1
'''

def splitVals(strVals):
    vals = {}
    for l in strVals.splitlines():
        if l.strip() and not l.strip()[0] == '#':
            k,v = l.split('=')
            vals[k.strip()] = v.strip()
    return vals

newVals = splitVals(newVals)

existingVals = {}
f = open('/etc/sysctl.conf', 'r')
existingVals = splitVals(f.read())
f.close()


def writeVal(f,k,v):
    add = '%s = %s\n' % (k, v)
    print 'Added %s' % add
    f.write(add)

def writeVals(f):
    for k,v in newVals.items():
        curVal = existingVals.get(k)
        if curVal == None:
            writeVal(f,k,v)
        elif curVal != v:
            try:
                if int(curVal) < int(v):
                    writeVal(f,k,v)
            except ValueError:
                writeVal(f,k,v)
            
f = open('/etc/sysctl.conf', 'a')
f.write('\n# Attune changes made for oracle install\n\n')
writeVals(f)
f.close()

import subprocess
subprocess.call(["sysctl", "-p"])

3.6 - ODB19 Configure limits.conf

Configure system limits for oracle userid.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
F=/etc/security/limits.conf

if grep oracle $F ; then
    echo "Oracle limits already exist in $F"
else
    echo "Adding oracle limits to $F"
    cat <<EOF >>$F
# Added Oracle install
oracle soft nofile 70000
oracle hard nofile 70000
oracle soft nproc 20000
oracle hard nproc 20000
oracle soft stack 32768
oracle hard stack 32768
EOF
fi

3.7 - ODB19 Check Prerequisites

This step checks for other issues that may prevent the installer from running.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
FAILED=0

function logGood {
    echo "$1 Passed"
}

function logErr {
    echo "$1 FAILED" >&2
    FAILED=1
}


NAME="Checking that the host has more than 1gb of ram : "
MAX_MEM="`grep '^MemTotal:' /proc/meminfo | awk -F ' ' '{print $2}'`"
[ $MAX_MEM -gt $((1*1024*1024)) ] && logGood "$NAME" || logErr "$NAME"


# Exit if there were any failures
[ $FAILED -eq 0 ]

3.8 - O Setup oraInst.loc

Required By : This step should be run before any oracle install.

This file is required for oracles installed software inventory.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "Waiting for other runInstaller to finish"
while pgrep -lf 'runInstaller'
do
    sleep 10s
done

[ -d /etc/oraInventory/logs ] || mkdir -p /etc/oraInventory/logs
[ -d /etc/oraInventory/oui ] || mkdir -p /etc/oraInventory/oui
[ -d /etc/oraInventory/ContentsXML ] || mkdir -p /etc/oraInventory/ContentsXML
[ -d /etc/oraInventory/backup ] || mkdir -p /etc/oraInventory/backup

ORA_INST=/etc/oraInst.loc

if [ -f $ORA_INST ]; then
    echo "oraInst.loc is already setup"
else
    echo "Installing new oraInst.loc"
cat <<EOF > $ORA_INST
inventory_loc=/etc/oraInventory
inst_group=oinstall
EOF

fi

touch /etc/oratab

INST_PROP=/etc/oraInventory/oraInstaller.properties
[ -f $INST_PROP ] || touch $INST_PROP


chown -R oracle:oinstall $ORA_INST /etc/oraInventory /etc/oratab
chmod -R ug+rw $ORA_INST /etc/oraInventory /etc/oratab

find  /etc/oraInventory -type d -exec chmod ug+x {} \;

3.9 - ODB19 Install Software

Install the oracle 19c database software.

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c
Target Server {targetServer.name} None
App Server {appServer.hostname} None
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "Waiting for other runInstaller to finish"
while pgrep -lf 'runInstaller'
do
    sleep 10s
done

ORACLE_HOME={db19cOracleHome}
ORACLE_BASE=`dirname $ORACLE_HOME`

echo "Clear out old install logs"
LOGDIR=/etc/oraInventory/logs
rm $LOGDIR/*.log $LOGDIR/*.err $LOGDIR/*.out 2> /dev/null || true

cd {db19cOracleHome}
RESP_FILE=`pwd`/install/response/db_install.rsp

echo "Configure the response file"
sed -i 's/ORACLE_HOSTNAME=.*/ORACLE_HOSTNAME={appServer.hostname}/' $RESP_FILE
sed -i 's/UNIX_GROUP_NAME=.*/UNIX_GROUP_NAME=users/' $RESP_FILE
sed -i 's/oracle.install.option=.*/oracle.install.option=INSTALL_DB_SWONLY/' $RESP_FILE
sed -i 's,ORACLE_HOME=.*,ORACLE_HOME={db19cOracleHome},' $RESP_FILE
sed -i "s,ORACLE_BASE=.*,ORACLE_BASE=$ORACLE_BASE," $RESP_FILE
sed -i 's/ORACLE_HOST_NAME=.*/ORACLE_HOST_NAME={targetServer.name}/' $RESP_FILE
sed -i 's,InstallEdition=.*,InstallEdition=SE2,' $RESP_FILE
sed -i 's/_GROUP=.*/_GROUP=dba/' $RESP_FILE
sed -i 's/SECURITY_UPDATES_VIA_MYORACLESUPPORT=.*/SECURITY_UPDATES_VIA_MYORACLESUPPORT=false/' $RESP_FILE
sed -i 's/DECLINE_SECURITY_UPDATES=.*/DECLINE_SECURITY_UPDATES=true/' $RESP_FILE
sed -i 's/MYORACLESUPPORT_USERNAME=.*/MYORACLESUPPORT_USERNAME=johndoe@mycompany.com/' $RESP_FILE
sed -i 's/MYORACLESUPPORT_PASSWORD=.*/MYORACLESUPPORT_PASSWORD=none/' $RESP_FILE

echo "Begin oracle install"

# # This file doesn't exist yet, but it causes the linking to fail when the
# # software is installed. We can create it ahead of time and it will be
# # valid when the files are installed.
# echo "Creating lib/libjavavm12.a link"
# mkdir -p {db19cOracleHome}/lib
# ln -snf {db19cOracleHome}/javavm/jdk/jdk6/lib/libjavavm12.a {db19cOracleHome}/lib

# echo "Creating javavm/admin/classes.bin link"
# mkdir -p {db19cOracleHome}/javavm/admin
# ln -snf {db19cOracleHome}/javavm/jdk/jdk6/admin/classes.bin {db19cOracleHome}/javavm/admin

echo "Executing installer"
ARGS="-silent -waitforcompletion -force -noconfig"
ARGS="$ARGS ORACLE_HOME_NAME=db12c"
echo $ARGS
EXIT_CODE=0
chmod +x ./runInstaller
if ! ./runInstaller $ARGS -responseFile $RESP_FILE ; then
    EXIT_CODE=$?

    grep  -e prerequisite -e OverallStatus $LOGDIR/*.log | sed 's,$LOGDIR/installActions,,g' >&2
    
    echo "The installed exited with non zero code $EXIT_CODE"
    echo "Search for 'prerequisite' in the following log file to find out more" 
    echo "${LOGDIR}/installActions*.log" 
    
    function throwCode {
        if [ $EXIT_CODE != 0 ]; then
            exit $EXIT_CODE
        fi
    }
    throwCode
fi

echo "Installer is done, The size of the new oracle home is"
du -sh $ORACLE_HOME


#cat $LOGDIR/installActions*.log 2> /dev/null || true
# Capture log file output
#cat $LOGDIR/*.log $LOGDIR/*.err $LOGDIR/*.out 2> /dev/null || true

3.10 - ODB19 Run root.sh

root.sh does a number of steps to setup the oracle environment.

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
{db19cOracleHome}/root.sh

This step will require you to answer the following prompts.

Prompt Answer
]:

3.11 - O Setup oraInst.loc

Required By : This step should be run before any oracle install.

This file is required for oracles installed software inventory.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "Waiting for other runInstaller to finish"
while pgrep -lf 'runInstaller'
do
    sleep 10s
done

[ -d /etc/oraInventory/logs ] || mkdir -p /etc/oraInventory/logs
[ -d /etc/oraInventory/oui ] || mkdir -p /etc/oraInventory/oui
[ -d /etc/oraInventory/ContentsXML ] || mkdir -p /etc/oraInventory/ContentsXML
[ -d /etc/oraInventory/backup ] || mkdir -p /etc/oraInventory/backup

ORA_INST=/etc/oraInst.loc

if [ -f $ORA_INST ]; then
    echo "oraInst.loc is already setup"
else
    echo "Installing new oraInst.loc"
cat <<EOF > $ORA_INST
inventory_loc=/etc/oraInventory
inst_group=oinstall
EOF

fi

touch /etc/oratab

INST_PROP=/etc/oraInventory/oraInstaller.properties
[ -f $INST_PROP ] || touch $INST_PROP


chown -R oracle:oinstall $ORA_INST /etc/oraInventory /etc/oratab
chmod -R ug+rw $ORA_INST /etc/oraInventory /etc/oratab

find  /etc/oraInventory -type d -exec chmod ug+x {} \;

3.12 - ODB19 Setup Init Script

Creates script to stop and start oracle database.

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
cat <<"EOF" > /etc/init.d/dbora
#!/bin/bash
echo "Start/stop an oracle database."
ORACLE_HOME={db19cOracleHome}
export ORACLE_BIN=$ORACLE_HOME/bin
export ORACLE_HOME_LISTNER=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_USER=oracle
export PATH=$PATH:$ORACLE_BIN
if [ ! -f $ORACLE_BIN/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
echo "see how we are called:"
case $1 in
start)
  su - $ORACLE_USER -c $ORACLE_BIN'/lsnrctl start'
  su - $ORACLE_USER -c $ORACLE_BIN'/dbstart'
  echo "OK"
  ;;
stop)
  su - $ORACLE_USER -c $ORACLE_BIN'/lsnrctl stop'
  su - $ORACLE_USER -c $ORACLE_BIN'/dbshut'
  echo "OK"
  ;;
*)
  echo "Usage: $0 {start|stop}"
  ;;
esac
# chkconfig: 5 98 98
# description: Oracle init script.
EOF

chmod u=rx /etc/init.d/dbora

chkconfig dbora on

3.13 - ODB19 Deploy tnsnames.ora

Copies tnsnames.ora file onto new server.

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive Oracle DB Server tnanames.ora.tar to remote path {db19cOracleHome}
  1. Locate Files archive "Oracle DB Server tnanames.ora.tar", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to {db19cOracleHome}, relative to the home directory
  4. Check that the files are in the correct location

3.14 - ODB19 Start Listener

Start the oracle listener

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
lsnrctl start

4 - Oracle 19c Create Database Instance

Oracle 19c Create Database Instance.

4.1 - ODBC19 Deploy DBCA Template

Deploy the DBCA database configuration template for NMS

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive Oracle 19c DBCA Create Instance.tar to remote path {db19cOracleHome}
  1. Locate Files archive "Oracle 19c DBCA Create Instance.tar", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to {db19cOracleHome}, relative to the home directory
  4. Check that the files are in the correct location

4.2 - O Setup oraInst.loc

Required By : This step should be run before any oracle install.

This file is required for oracles installed software inventory.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "Waiting for other runInstaller to finish"
while pgrep -lf 'runInstaller'
do
    sleep 10s
done

[ -d /etc/oraInventory/logs ] || mkdir -p /etc/oraInventory/logs
[ -d /etc/oraInventory/oui ] || mkdir -p /etc/oraInventory/oui
[ -d /etc/oraInventory/ContentsXML ] || mkdir -p /etc/oraInventory/ContentsXML
[ -d /etc/oraInventory/backup ] || mkdir -p /etc/oraInventory/backup

ORA_INST=/etc/oraInst.loc

if [ -f $ORA_INST ]; then
    echo "oraInst.loc is already setup"
else
    echo "Installing new oraInst.loc"
cat <<EOF > $ORA_INST
inventory_loc=/etc/oraInventory
inst_group=oinstall
EOF

fi

touch /etc/oratab

INST_PROP=/etc/oraInventory/oraInstaller.properties
[ -f $INST_PROP ] || touch $INST_PROP


chown -R oracle:oinstall $ORA_INST /etc/oraInventory /etc/oratab
chmod -R ug+rw $ORA_INST /etc/oraInventory /etc/oratab

find  /etc/oraInventory -type d -exec chmod ug+x {} \;

4.3 - ODBC19 Run DBCA

Create the oracle database instance from our template.

run dbca -help to get help, its a great command line tool

This step has the following parameters

Name Script Reference Default Value
Oracle: system at NMS {oracleSystemAtNms.password} None
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "Executing DBCA to create a new database"

ARGS=" -silent -createDatabase -templateName Attune_NMS.dbt "
ARGS="$ARGS -gdbName NMS -responseFile NO_VALUE "
ARGS="$ARGS -sysPassword {oracleSystemAtNms.password} -systemPassword {oracleSystemAtNms.password} "
ARGS="$ARGS -databaseType MULTIPURPOSE "
ARGS="$ARGS -memoryMgmtType AUTO_SGA "


dbca $ARGS

4.4 - O Setup oraInst.loc

Required By : This step should be run before any oracle install.

This file is required for oracles installed software inventory.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "Waiting for other runInstaller to finish"
while pgrep -lf 'runInstaller'
do
    sleep 10s
done

[ -d /etc/oraInventory/logs ] || mkdir -p /etc/oraInventory/logs
[ -d /etc/oraInventory/oui ] || mkdir -p /etc/oraInventory/oui
[ -d /etc/oraInventory/ContentsXML ] || mkdir -p /etc/oraInventory/ContentsXML
[ -d /etc/oraInventory/backup ] || mkdir -p /etc/oraInventory/backup

ORA_INST=/etc/oraInst.loc

if [ -f $ORA_INST ]; then
    echo "oraInst.loc is already setup"
else
    echo "Installing new oraInst.loc"
cat <<EOF > $ORA_INST
inventory_loc=/etc/oraInventory
inst_group=oinstall
EOF

fi

touch /etc/oratab

INST_PROP=/etc/oraInventory/oraInstaller.properties
[ -f $INST_PROP ] || touch $INST_PROP


chown -R oracle:oinstall $ORA_INST /etc/oraInventory /etc/oratab
chmod -R ug+rw $ORA_INST /etc/oraInventory /etc/oratab

find  /etc/oraInventory -type d -exec chmod ug+x {} \;

4.5 - ODBC19 Set DB To Autostart

Set DB to autostart in /etc/oratab.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
sed -i 's/:N$/:Y/g' /etc/oratab

4.6 - ODBC19 Apply Post Create Changes

Set the default limit for FAILED_LOGIN_ATTEMPTS and PASSWORD_LIFE_TIME to UNLIMITED.

The connection details have changed from the last step.

Login as user on node Login to sqlplus as user

Connect via SSH
ssh user@hostname
This is a Oracle SQL Script make sure you run it with sqlplus from a terminal session
-- Stop services trying to login with the wrong password from locking enmac out
alter profile default limit FAILED_LOGIN_ATTEMPTS UNLIMITED;

-- Stop the enmac password form locking out after a period of time.
alter profile default limit PASSWORD_LIFE_TIME UNLIMITED;

4.7 - ODBC19 Add More Temp Datafiles

Add more Temp Datafiles to the Database.

This step has the following parameters

Name Script Reference Default Value
Ora Extra Temp Datafile Size MB {oraExtraTempDatafileSizeMb} 500
Oracle: system at NMS {oracleSystemAtNms.sid} None

Login as user on node Login to sqlplus as user

Connect via SSH
ssh user@hostname
This is a Oracle SQL Script make sure you run it with sqlplus from a terminal session
alter tablespace temp 
add tempfile '/database/temp/{oracleSystemAtNms.sid}/temp02.dbf' 
size {oraExtraTempDatafileSizeMb}m;

alter tablespace temp 
add tempfile '/database/temp/{oracleSystemAtNms.sid}/temp03.dbf' 
size {oraExtraTempDatafileSizeMb}m;

4.8 - ODBC19 Add More Undo Datafiles

Add more Undo Datafiles to the Database.

This step has the following parameters

Name Script Reference Default Value
Ora Extra Undo Datafile Size MB {oraExtraUndoDatafileSizeMb} 500
Oracle: system at NMS {oracleSystemAtNms.sid} None

Login as user on node Login to sqlplus as user

Connect via SSH
ssh user@hostname
This is a Oracle SQL Script make sure you run it with sqlplus from a terminal session
alter tablespace undotbs1
add datafile '/database/undo/{oracleSystemAtNms.sid}/undotbs02.dbf'
size {oraExtraUndoDatafileSizeMb}m;

alter tablespace undotbs1
add datafile '/database/undo/{oracleSystemAtNms.sid}/undotbs03.dbf'
size {oraExtraUndoDatafileSizeMb}m;

4.9 - ODBC19 Create Database NMS Dirs

Create the Database NMS Dirs

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
for x in u01 u02 u03 u04
do
    d="/database/${x}/oradata/NMS"
    [ -d ${d} ] || mkdir -v ${d}
done

4.10 - ODBC19 Deploy tnsnames.ora

Copy the new tnsnames.ora file to the new server.

This step has the following parameters

Name Script Reference Default Value
DB 19c ORACLE HOME {db19cOracleHome} /database/u00/product/db19c
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive Oracle DB Server tnanames.ora.tar to remote path {db19cOracleHome}
  1. Locate Files archive "Oracle DB Server tnanames.ora.tar", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to {db19cOracleHome}, relative to the home directory
  4. Check that the files are in the correct location

5.1 - ODRLW Deploy RLWrap

copy RLWrap installation software to server.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive Oracle RLWrap Source v0.43.tar.gz to remote path /tmp/inst_rlwrap
  1. Locate Files archive "Oracle RLWrap Source v0.43.tar.gz", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to /tmp/inst_rlwrap
  4. Check that the files are in the correct location

5.2 - ODRLW Install NCurses

Install ncurses-devel which are files needed to develop programs which use the ncurses terminal library.
Install readline-devel which are files needed to develop programs which use the readline library.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
yum install -y ncurses-devel readline-devel

5.3 - ODRLW Install RLWrap

Make and install rlwrap.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
cd /tmp/inst_rlwrap

gunzip rlwrap*.gz
tar -xvf rlwrap*.tar
cd rlwrap*
./configure
make
make check
make install

cd
rm -rf /tmp/inst_rlwrap

ln -snvf /usr/local/bin/rlwrap /usr/bin/rlwrap