How I learned to stop worrying and enjoy Oracle installations

 

I have to hand it to the folks at Oracle, they have made installing 12cR1 just that little more complex, which makes us feel really good when it works!

My only gripe is when you don't have a GUI and and X-Term handy, installation for the uninitiated (read: ME) is a tad more complex.  So break out vi or emacs, and let's get started.  I am doing this in a virtual machine, which may, or may not be officially supported.  But it's so much easier while we're learning.

1.  You'll need a response file
There's two ways to get one of these.  Unpack the installer, and copy it from database/response or run a GUI install somewhere else and save it off.  The only things you really need to change are the installation points.  Everything else cal remain as-is

2.  If you're doing Linux, it might as well be Oracle Linux
Yeah, I am well aware that Oracle Linux is fundamentally RedHat in a different red hat; but you do get the warm fuzzy feeling it's all going to hang together.

Installing Oracle Linux 6 is no different to RedHat or most other distributions, insert media, a handful of mouse clicks and you're done.  For the sake of those following my ramblings, I have three 20G disks.

sda0 = 4GB Swap
sda1 = Remainder on / as ext4

sdb1 = /u01 as ext4

sdc1 = /oradata as ext2

"Whoa" I hear you say... ext2?  I am a subscriber to the "less is more" theory.  Oracle is really good at handling their data files, and don't need us getting in the way with journalling and the like.  Ext2 is simpler, low overhead and that for me, is all there is to it.  Feel free to disagree...

Install as a standard server, and add the base development tools, as well as whatever other packages you feel you need in your case.

3.  Update before you start
Easy.  Just do "yum update" and follow the bouncing ball.

4.  Install the prerequisites
The easiest way of not messing things up is just to install the prereq package with:

"yum install oracle-rdbms-server-12cR1-preinstall"

This will create an "oracle" user, "oinstall" and "dba" groups as well as add any missing packages and tune kernel parameters.

At this point, it's a good idea to do an "su - oracle"


5.  Extract the installer
12c comes as two huge zip files, "linuxamd64_12c_database_1of2.zip" and
"linuxamd64_12c_database_1of2.zip" unzip these to /tmp/oracle.  Having done that, copy your response file to /tmp/oracle

6.  Set up your directories
mkdir -p /u01/app/oracle
mkdir -p /oradata/data
chown -R oracle:oinstall /u01
chown -R oracle:dba /oradata

Don't get too hung up on permissions, the installation will adjust them for us as we go

7.  Create a script
Break out your favourite editor, and create oinst.sh in the /tmp/oracle directory


#!/bin/sh
/tmp/oracle/database/runInstaller -silent -ignoreSysPrereqs
-ignorePrereq -responseFile /tmp/oracle/response/12c-EE.rsp \
oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall \
SELECTED_LANGUAGES=en ORACLE_BASE=/u01/app/oracle  \
ORACLE_HOME=/u01/app/oracle/product/12.1.0.1  \
oracle.install.db.InstallEdition=EE  \
oracle.install.db.DBA_GROUP=dba  \
oracle.install.db.OPER_GROUP=dba \
oracle.install.db.BACKUPDBA_GROUP=dba \
oracle.install.db.DGDBA_GROUP=dba  \
oracle.install.db.KMDBA_GROUP=dba  \
DECLINE_SECURITY_UPDATES=true

Now run it, as "oracle"

It will take a while, but you should see:
As a root user, execute the following script(s):
            1. /home/oracle/oraInventory/orainstRoot.sh
            2. /u01/app/oracle/product/12.1.0.1/root.sh

Successfully Setup Software

Now, go run those two scripts, as root

Congratulations!  You just installed Oracle RDBMS

8.  Create an actual database

#!/bin/sh
#
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0.1
export PATH=$ORACLE_HOME/bin:$PATH
#
dbca -silent -responseFile NO_VALUE -createDatabase \
   -templateName General_Purpose.dbc -createAsContainerDatabase false \
   -gdbName testdb1 -sid testdb1 -SysPassword Abig5ecret \
   -SystemPassword Abig5ecret -emConfiguration DBEXPRESS \
   -dbsnmpPassword Abig5ecret -storageType FS \
   -datafileDestination /oradata/data \
   -redoLogFileSize 200 -sampleSchema true \
   -characterSet AL32UTF8 -totalMemory 74
The system will grind away and eventually get to 100%,  Around 40%, you should see

"Creating and starting Oracle instance"

9.  Set up networking

netca -silent -responseFile /tmp/oracle/netca.rsp

10.  You're done!

Comments

Popular posts from this blog

The QYT KT-7900D

Life with Deep Racer - Part 2

DIY Self-Driving - Part 9 - New Imaging