Installing/Uninstalling Oracle DB

Installing Oracle 18c

Prepare Installation

Install Prerequisite Technologies and Libraries 

[nasim@mymacos ~]$ ssh root@192.168.x.x
[root@mycentos ~]$ yum -y install oracle-database-preinstall-18c lvm2 unzip gcc

Verify oracle User Creation

[root@mycentos ~]$ groups oracle
oracle : oinstall dba oper backupdba dgdba kmdba racdba

You should be able to see above groups assigned

Reset oracle User Password

[root@mycentos ~]$ passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Oracle Location Permission

[root@mycentos ~]$ chown -R oracle:oinstall /u01
[root@mycentos ~]$ chmod -R ug+xrw /u01
[root@mycentos ~]$ su - oracle
[oracle@mycentos ~]$ mkdir /u01/app/oracle/distr/
[oracle@mycentos ~]$ exit
[root@mycentos ~]$ exit

Assign oracle user and install group to /u01 installation 

Download

I could not find a way to download the Oracle DB installation bundle using CLI. I had to download it with by browser and copy it into CentOS VM using scp command.

[nasim@mymacos ~]$ scp ~/packages/LINUX.X64_180000_db_home.zip oracle@default.centos:/u01/app/oracle/distr/

Extract and Setup Installer

[nasim@mymacos ~]$ ssh oracle@192.168.x.x
[oracle@mycentos ~]$ unzip -q  /u01/app/oracle/distr/LINUX.X64_180000_db_home.zip -d /u01/app/oracle/product/18.0.0/dbhome_1/

Install

Create soft_only.rsp by following commands:

[oracle@mycentos ~]$ cd /u01/app/oracle/product/18.0.0/dbhome_1/
[oracle@mycentos dbhome_1]$ sed -e '/\s*#.*$/d' -e '/^\s*$/d' install/response/db_install.rsp > install/response/soft_only.rsp
[oracle@mycentos dbhome_1]$ vi install/response/soft_only.rsp

Edit soft_only.rsp using vi or other cli editor as follow:

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v18.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/18.0.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba

Run following command:

[oracle@mycentos dbhome_1]$ ./runInstaller -silent -responseFile install/response/soft_only.rsp
Launching Oracle Database Setup Wizard...
 
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites 

...
 
Successfully Setup Software with warning(s).
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActionsYYYY-MM-dd...
[oracle@mycentos dbhome_1]$

Create Database

[oracle@mycentos dbhome_1]$ dbca -createDatabase -silent -createAsContainerDatabase true -pdbName pdb1 -templateName General_Purpose.dbc -gdbName orcl -sysPassword 123456 -systemPassword 123456 -pdbAdminPassword 123456 -dbsnmpPassword 123456 -datafileDestination /u01/app/oracle/oradata -storageType FS -sampleSchema true
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE:
...
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.[oracle@mycentos dbhome_1]$

Setup oracle user Environment Vairable

[oracle@nasimcentos dbhome_1]$ vi ~/.bash_profile

Export ORACLE_HOME/bin folder in .bash_profile file so that when you login with oracle user, all oracle CLI commands will be accessible everywhere:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin


ORACLE_HOME=/u01/app/oracle/product/18.0.0/dbhome_1

export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$PATH

export PATH

ORACLE_SID=kerp;
export ORACLE_SID

 

Create the First DBA Admin User

[oracle@mycentos dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Sat Sep 29 13:48:50 2018
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL>

Refer to User Management to see how to create an Oracle DBA Admin user

Uninstalling Oracle 18c

Use deinstall to uninstall oracle 18c

[oracle@mycentos dbhome_1]$ ./dbhome_1/deinstall
[oracle@mycentos dbhome_1]$ ./deinstall/deinstall
Checking for required files and bootstrapping ...
Location of logs /tmp/deinstall2018-09-29_12-25-48PM/logs/

############ ORACLE DECONFIG TOOL START ############


######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /u01/app/oracle/product/18.0.0/dbhome_1
Oracle Home type selected for deinstall is: Oracle Single Instance Database
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory

## [END] Install check configuration ##


Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2018-09-29_12-25-48PM/logs/netdc_check2018-09-29_12-26-02PM.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /tmp/deinstall2018-09-29_12-25-48PM/logs/databasedc_check2018-09-29_12-26-02PM.log

Use comma as separator when specifying list of values as input

Specify the list of database names that are configured in this Oracle home [orcl]:

 

 

Leave a Reply