Installing Oracle 21c Database on Linux [Single Instance]
Tags: tutorial, database, 21c, oracle
Published: 2021-08-15 14:27:51

After some time of been available on the cloud, 21c Database is now ready to install on premises (Linux version for now)

[@GeraldVenzl - Aug 13](https://twitter.com/GeraldVenzl/status/1426272990073790468?ref_src=twsrc%5Etfw)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iavd7sqwjzewmoz01ucj.png)

You can read more about it from the usual suspects like Mike's blog:
[Oracle Database 21c is available for download on Linux](https://mikedietrichde.com/2021/08/13/oracle-database-21c-is-available-for-download-on-linux/)

</br>
</br>
The first thing we need to do is to download the Database Software

[Oracle Database 21c Download for Linux x86-64](https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html "Oracle Database 21c Download for Linux x86-64")

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gsee3vw71ysjf8yl5pp.png)


We are assuming here the server is ready for 21c Database installation (I'm using one of the Labs servers were I have 19c installed) but if you are creating the server from the scratch, remember to use the preinstall RPM to make sure the system is ready:
[Running RPM Packages to Install Oracle Database](https://docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/running-rpm-packages-to-install-oracle-database.html#GUID-BB7C11E3-D385-4A2F-9EAF-75F4F0AACF02)

Once is downloaded into your server, create the 21c Oracle Home folder and extract the zip file in it
```bash
[oracle@rac1-node1 ~]$ mkdir -p /u01/app/oracle/product/21.0.0/dbhome_1
[oracle@rac1-node1 ~]$ cd /u01/app/oracle/product/21.0.0/dbhome_1
[oracle@rac1-node1 db_home1]$ unzip /tmp/LINUX.X64_213000_db_home.zip 
Archive:  /tmp/LINUX.X64_213000_db_home.zip
   creating: addnode/
  inflating: addnode/addnode.sh      
  inflating: addnode/addnode_oraparam.ini.sbs  
  inflating: addnode/addnode_oraparam.ini  
  inflating: addnode/addnode.pl  
[....]
[oracle@rac1-node1 db_home1]$ 
```

Now that we have the software located on our server, lets install the software using runInstaller with the INSTALL_DB_SWONLY option. 
Remember to execute the root.sh script as root after finishing it:
```bash
[oracle@rac1-node1 dbhome_1]$ ./runInstaller -silent -responseFile /u01/app/oracle/product/21.0.0/dbhome_1/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
ORACLE_BASE=/u01/app/oracle \
INVENTORY_LOCATION=/u01/app/oraInventory  \
SELECTED_LANGUAGES=en \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.OSDBA_GROUP=oinstall \
oracle.install.db.OSBACKUPDBA_GROUP=oinstall \
oracle.install.db.OSDGDBA_GROUP=oinstall \
oracle.install.db.OSKMDBA_GROUP=oinstall \
oracle.install.db.OSRACDBA_GROUP=oinstall \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true

Launching Oracle Database Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2021-08-15_01-56-35PM/installActions2021-08-15_01-56-35PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2021-08-15_01-56-35PM/installActions2021-08-15_01-56-35PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/21.0.0/dbhome_1/install/response/db_2021-08-15_01-56-35PM.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/InstallActions2021-08-15_01-56-35PM/installActions2021-08-15_01-56-35PM.log


As a root user, execute the following script(s):
    1. /u01/app/oracle/product/21.0.0/dbhome_1/root.sh

Execute /u01/app/oracle/product/21.0.0/dbhome_1/root.sh on the following nodes: 
[rac1-node1]


Successfully Setup Software with warning(s).
[oracle@rac1-node1 dbhome_1]$ 
[oracle@rac1-node1 dbhome_1]$ su -
Password: 
[root@rac1-node1 ~]# /u01/app/oracle/product/21.0.0/dbhome_1/root.sh 
Check /u01/app/oracle/product/21.0.0/dbhome_1/install/root_rac1-node1.raclab.local_2021-08-15_14-03-18-085643579.log for the output of root script
[root@rac1-node1 ~]# 
```

Let's now create a single instance Database on Filesystem
```bash
[oracle@rac1-node1 ~]$ . oraenv
ORACLE_SID = [oracle] ? cdb21
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/21.0.0/dbhome_1
The Oracle base has been set to /u01/app/oracle
[oracle@rac1-node1 ~]$ 

[oracle@rac1-node1 ~]$ dbca -silent -createDatabase                     \
-templateName General_Purpose.dbc                \
-gdbname cdb21                                   \
-sid cdb21                                       \
-responseFile NO_VALUE                           \
-characterSet AL32UTF8                           \
-sysPassword Welcome1                            \
-systemPassword Welcome1                         \
-createAsContainerDatabase true                  \
-numberOfPDBs 1                                  \
-pdbName pdb21                                   \
-pdbAdminPassword Welcome1                       \
-databaseType MULTIPURPOSE                       \
-memoryMgmtType auto_sga                         \
-totalMemory 4096                                \
-storageType FS                                  \
-datafileDestination /u01/oradata/               \
-emConfiguration NONE                            \
-ignorePreReqs 
Prepare for db operation
8% complete
[....]
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/cdb21.
Database Information:
Global Database Name:cdb21
System Identifier(SID):cdb21
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb21/cdb211.log" for further details.

```

And ***voilà!*** our new 21c Database is ready for testing
```bash
[oracle@rac1-node1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on Sun Aug 15 14:39:16 2021
Version 21.3.0.0.0

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


Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL> SELECT NAME as DB_NAME, HOST_NAME, DATABASE_ROLE, OPEN_MODE, status from GV$INSTANCE, V$DATABASE;

DB_NAME   HOST_NAME               DATABASE_ROLE    OPEN_MODE        STATUS
--------- ----------------------------------- ---------------- -------------------- ------------
CDB21     rac1-node1.raclab.local         PRIMARY          READ WRITE       OPEN



SQL> SELECT d.CON_ID, v.name, v.open_mode
FROM gv$pdbs v, dba_pdbs d WHERE v.guid = d.guid
ORDER BY 1;

    CON_ID NAME         OPEN_MODE
---------- -------------------- ----------
     2 PDB$SEED     READ ONLY
     3 PDB21        READ WRITE

SQL> 
```

Like Tim have already mentioned, [please don't use 21c](https://oracle-base.com/blog/2021/08/14/oracle-21c-is-here-please-dont-use-it/) unless is for your testing and to learn what new features are coming to the long term support releases (current one is 19c and next one should be 23c)