Installing Oracle Express Database 18c (XE) On Oracle Cloud Free Tier Fails With ORA-00821: Specified value of sga_target | minimum requirements Scenario


Tried to install Oracle Express Database 18c (XE) on Oracle Cloud Free Tier ( Centos 7 machine ).
Followed steps suggested in : Oracle installation doc
As Oracle Cloud Free Tier machine is limited to 1000MB memory, installation fails with 2 different major issues :
Encountered 2 major issues : 


Issue 1 : [SEVERE] Oracle Database 18c Express Edition requires a minimum of 1GB of physical memory (RAM).  This system has 971 MB of RAM and does not meet minimum requirements."
Issue 2 : [WARNING] ORA-00821: Specified value of sga_target 296M is too small, needs to be at least 400M
ORA-01078: failure in processing system parameters
How to Install Oracle Database 18c Express Edition on Oracle Cloud Free Tier (for life) | Centos 7



Credits : 
1
2


 STEP 1 - Download Oracle Required Software


oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
oracle-database-xe-18c-1.0-1.x86_64.rpm


 

1. mkdir Downloads
2. cd /home/opc/Downloads
3. curl -L -O https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-18c-1.0-1.x86_64.rpm
3. curl -L -O https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
4. sudo yum localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm (Pre-Requistis only)







 STEP 2 - Change RPM To Avoid Issue 1 :

( Issue 1 : This system has 971 MB of RAM and does not meet minimum requirements ) 


Install &amp; run rpmrebuild (if you don't have it already)




1. sudo yum install rpmrebuild
2. cd /home/opc
3. rpmrebuild -e -p /home/opc/oracle-database-xe-18c-1.0-1.x86_64.rpm
   ( this might take few mins )





Once rpmrebuild is opened :




1. Scroll down ( to bottom ) -&gt; search for this line : [ $PhyMem -lt 1024 ]
2. Change to : [ $PhyMem -lt 102 ]
3. Press Esc -&gt; type : wq!
4. Wait for RPM to be re-build ( it's auto and take few mins ).





Do the rpmrebuild modification : 




1. Scroll down ( to bottom ) -&gt; search for this line : [ $PhyMem -lt 1024 ]
2. Change to : [ $PhyMem -lt 102 ]
3. Press Esc -&gt; type : wq!
4. Wait for RPM to be re-build ( it's auto and take few mins ).





Install Database from new RPM  : 




1. cd /home/opc/rpmbuild/RPMS/x86_64/
2. sudo yum localinstall oracle-database-xe-18c-1.0-1.x86_64.rpm







 STEP 3 - Change Config File Before Database Configuration To Avoid Issue 2 :

( Issue 2 : sga_target 296M is too small )


Once step 2 completed - Edit File : /etc/init.d/oracle-xe-18c




1. sudo -s
2. cp /etc/sysconfig/oracle-xe-18c.conf /etc/sysconfig/oracle-xe-18c.orig
3. vi /etc/sysconfig/oracle-xe-18c.conf 
4. search for "sga_target=" (/sga_target= in vi)
5. change from : MEMORY_CONSTRUCT="-initParams sga_target=${sga}M,pga_aggregate_target=${pga}M"
          To   : MEMORY_CONSTRUCT="-initParams sga_target=500M,pga_aggregate_target=${pga}M"
6. Save file.







 STEP 4 - Run Database Configuration :

( This may take up to 30 mins )



1. /etc/init.d/oracle-xe-18c configure