Oracle 19c, as an enterprise-level relational database management system, can fully leverage its high performance and high availability advantages on Rocky Linux (a RHEL-compatible distribution). Given the limited installation documentation specifically for Oracle 19c on Rocky Linux 9.6, this article systematically organizes and optimizes the deployment process by combining Oracle’s official documentation with general installation methods for RHEL-compatible systems, aiding in efficient deployment.
1. Pre-installation Preparation
(1) System Environment Check
Before deployment, ensure that the system meets the basic operational requirements for Oracle 19c, as shown in the table below:
| Resource Type | Minimum Requirement | Recommended for Production Environment | Notes |
|---|---|---|---|
| Memory | 4GB RAM | 8GB or more | Insufficient memory may lead to decreased database performance; increase based on concurrency in production environments. |
| Disk Space | 10GB for installation directory | 20GB+ for installation directory, with separate planning for data storage area | It is recommended to use high-performance disks, such as SSDs, for the data storage area, and reserve sufficient space based on data volume. |
| Swap Space | 2 times physical memory if < 16GB; 16GB if ≥ 16GB | Same as minimum requirement, adjustable based on actual business needs | Insufficient swap space may lead to system memory overflow, affecting database stability. |
| System Architecture | x86-64 architecture | Same as minimum requirement | Currently, Oracle 19c primarily supports x86-64 architecture; other architectures need to confirm official compatibility. |
(2) Dependency Package Installation
Dependency packages are the foundational support for Oracle database operation. Install the required dependency packages in one go using the following command to avoid failures during subsequent installations due to missing dependencies:
First, update the system packages to ensure the system is up to date.<span><span><span>sudo</span></span></span><span><span> dnf update </span></span><span><span><span>-y</span></span></span><span><span><span># Install required dependency packages for Oracle 19c</span></span></span><span><span><span>sudo</span></span></span><span><span> dnf </span></span><span><span><span>install</span></span></span><span><span><span>-y</span></span></span><span><span> binutils gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel </span></span><span><span><span>make</span></span></span><span><span> sysstat elfutils-libelf elfutils-libelf-devel fontconfig-devel libxcb smartmontools libX11 libXau libXtst libXrender libXrender-devel net-tools nfs-utils bind-utils</span></span>
(3) User and Group Creation
Oracle database requires dedicated users and groups to run, ensuring permission isolation and system security. Follow these steps to create the relevant users and groups:
Create the oinstall group for managing Oracle installations.<span><span><span>sudo</span></span></span><span><span><span>groupadd</span></span></span><span><span><span>-g</span></span></span><span><span><span>54321</span></span></span><span><span> oinstall</span></span><span><span><span># Create dba group for database administrator permission control</span></span></span><span><span><span>sudo</span></span></span><span><span><span>groupadd</span></span></span><span><span><span>-g</span></span></span><span><span><span>54322</span></span></span><span><span> dba</span></span><span><span><span># Create oper group for database operator permission control</span></span></span><span><span><span>sudo</span></span></span><span><span><span>groupadd</span></span></span><span><span><span>-g</span></span></span><span><span><span>54323</span></span></span><span><span> oper</span></span><span><span><span># Create oracle user, specifying the primary group as oinstall, and additional groups as dba and oper</span></span></span><span><span><span>sudo</span></span></span><span><span><span>useradd</span></span></span><span><span><span>-u</span></span></span><span><span><span>54321</span></span></span><span><span><span>-g</span></span></span><span><span> oinstall </span></span><span><span><span>-G</span></span></span><span><span> dba,oper oracle</span></span><span><span><span># Set password for oracle user, enter and confirm password as prompted after executing the command</span></span></span><span><span><span>sudo</span></span></span><span><span><span>passwd</span></span></span><span><span> oracle</span></span>
(4) Installation Directory Configuration
Proper planning of the installation directory facilitates subsequent management and maintenance. Create the directory and set the correct permissions:
Create the Oracle software installation directory, using the -p option to ensure parent directories are created automatically if they do not exist.<span><span><span>sudo</span></span></span><span><span><span>mkdir</span></span></span><span><span><span>-p</span></span></span><span><span> /u01/app/oracle/product/19.3.0/dbhome_1</span></span><span><span><span># Set directory owner to oracle user and oinstall group, ensuring oracle user has control over the directory</span></span></span><span><span><span>sudo</span></span></span><span><span><span>chown</span></span></span><span><span><span>-R</span></span></span><span><span> oracle:oinstall /u01</span></span><span><span><span># Set directory permissions to 775, meaning owner and group users have read, write, and execute permissions, while other users have read and execute permissions</span></span></span><span><span><span>sudo</span></span></span><span><span><span>chmod</span></span></span><span><span><span>-R</span></span></span><span><span><span>775</span></span></span><span><span> /u01</span></span>
(5) System Parameter Optimization
Optimize system kernel parameters and user limits to provide the best operating environment for the Oracle database. The specific operations are as follows:
- Kernel Parameter Configuration Edit the
<span><span>/etc/sysctl.conf</span></span>file and add the following parameters. These parameters can optimize system memory management, network performance, etc., to meet the operational needs of the Oracle database:
fs.aio-max-nr = 1048576<span><span>fs.file-max = 6815744</span></span><span><span>kernel.shmall = 16451328</span></span><span><span>kernel.shmmax = 33692319744</span></span><span><span>kernel.shmmni = 4096</span></span><span><span>kernel.sem = 250 32000 100 128</span></span><span><span>net.ipv4.ip_local_port_range = 9000 65500</span></span><span><span>net.core.rmem_default = 262144</span></span><span><span>net.core.rmem_max = 4194304</span></span><span><span>net.core.wmem_default = 262144</span></span><span><span>net.core.wmem_max = 1048576</span></span>
After adding, execute the following command to make the configuration take effect immediately:
sudo<span><span>sysctl</span></span><span><span>-p</span></span>
- User Limit Configuration Edit the
<span><span>/etc/security/limits.conf</span></span>file and add Oracle user limit parameters to prevent resource limitations from affecting database operation:
oracle soft nproc 2047<span><span>oracle hard nproc 16384</span></span><span><span>oracle soft nofile 1024</span></span><span><span>oracle hard nofile 65536</span></span><span><span>oracle soft stack 10240</span></span><span><span>oracle hard stack 32768</span></span>
At the same time, edit the <span><span>/etc/pam.d/login</span></span> file to ensure it includes the following content to make the user limit configuration effective:
session required /lib64/security/pam_limits.so<span><span>session required pam_limits.so</span></span>
(6) Firewall and SELinux Settings
To ensure normal communication for the Oracle database, adjust the firewall and SELinux configurations. Choose one of the following two methods based on actual needs:
| Operation Method | Command | Applicable Scenario |
|---|---|---|
| Disable Firewall (simple and direct, suitable for testing environments) | sudo systemctl stop firewalldsudo systemctl disable firewalld | Testing environment or internal closed network environment, no strict network protection required |
| Open Necessary Ports (secure and reliable, suitable for production environments) | sudo firewall-cmd –permanent –add-port=1521/tcpsudo firewall-cmd –permanent –add-port=5500/tcpsudo firewall-cmd –reload | Production environment, need to ensure network security, only open ports required for the database |
SELinux may impose restrictions on the operation of the Oracle database, it is recommended to disable it:
Temporarily disable SELinux, effective immediately<span><span><span>sudo</span></span></span><span><span> setenforce </span></span><span><span><span>0</span></span></span><span><span><span># Permanently disable SELinux, effective after reboot</span></span></span><span><span><span>sudo</span></span></span><span><span><span>sed</span></span></span><span><span><span>-i</span></span></span><span><span><span>'s/SELINUX=enforcing/SELINUX=disabled/g'</span></span></span><span><span> /etc/selinux/config</span></span>
(7) Hostname and Hosts File Configuration
Ensure the system can correctly resolve the hostname to avoid issues with database deployment and operation due to hostname resolution problems:
Check the current hostname<span><span><span>hostname</span></span></span><span><span><span># If you need to change the hostname, replace "oracle-server" with your custom hostname</span></span></span><span><span><span>sudo</span></span></span><span><span> hostnamectl set-hostname oracle-server</span></span><span><span><span># Edit the hosts file, adding hostname and IP mapping</span></span></span><span><span><span>sudo</span></span></span><span><span><span>vim</span></span></span><span><span> /etc/hosts</span></span><span><span><span># Add the following content to the file, replacing "192.168.1.100" with the actual server IP and "oracle-server" with the actual hostname</span></span></span><span><span><span># 192.168.1.100 oracle-server</span></span></span>
2. Oracle 19c Installation
(1) Installation File Preparation
- Download the Oracle 19c installation package (LINUX.X64_193000_db_home.zip) from the Oracle official website. Note that you need to register an Oracle account and accept the license agreement.
- Upload the downloaded installation package to the Rocky Linux 9.6 server using tools like scp or sftp, for example:
Upload the installation package to the server, replacing “local installation package path” with the actual path and “server IP” with the actual IP<span><span><span>scp</span></span></span><span><span> local installation package path/oracle-server:/tmp/</span></span>
- Switch to the oracle user, prepare the installation directory, and unzip the installation package:
Switch to the oracle user<span><span><span>sudo</span></span></span><span><span><span>su</span></span></span><span><span> - oracle</span></span><span><span><span># Ensure the installation directory is created (if previously created, this step can be skipped)</span></span></span><span><span><span>mkdir</span></span></span><span><span><span>-p</span></span></span><span><span> /u01/app/oracle/product/19.3.0/dbhome_1</span></span><span><span><span># Enter the installation directory</span></span></span><span><span><span>cd</span></span></span><span><span> /u01/app/oracle/product/19.3.0/dbhome_1</span></span><span><span><span># Unzip the installation package, replacing "/tmp/LINUX.X64_193000_db_home.zip" with the actual installation package path</span></span></span><span><span><span>unzip</span></span></span><span><span> /tmp/LINUX.X64_193000_db_home.zip</span></span><span><span><span># Set installation directory file permissions, ensuring the oracle user has sufficient permissions</span></span></span><span><span><span>chmod</span></span></span><span><span><span>-R</span></span></span><span><span><span>755</span></span></span><span><span> /u01/app/oracle</span></span>
(2) Oracle User Environment Variable Configuration
Configuring environment variables can simplify Oracle command operations, ensuring that Oracle-related commands can execute normally. Edit the <span><span>~/.bash_profile</span></span> file as the oracle user:
Edit the .bash_profile file<span><span><span>vim</span></span></span><span><span> ~/.bash_profile</span></span>
Add the following content at the end:
export<span><span><span>ORACLE_BASE</span></span></span><span><span><span>=</span></span></span><span><span>/u01/app/oracle</span></span><span><span><span>export</span></span></span><span><span><span>ORACLE_HOME</span></span></span><span><span><span>=</span></span></span><span><span><span>$ORACLE_BASE</span></span></span><span><span>/product/19.3.0/dbhome_1</span></span><span><span><span>export</span></span></span><span><span><span>ORACLE_SID</span></span></span><span><span><span>=</span></span></span><span><span>orcl</span></span><span><span><span>export</span></span></span><span><span><span>PATH</span></span></span><span><span><span>=</span></span></span><span><span><span>$PATH</span></span></span><span><span><span>:</span></span></span><span><span><span>$ORACLE_HOME</span></span></span><span><span>/bin</span></span><span><span><span>export</span></span></span><span><span><span>LD_LIBRARY_PATH</span></span></span><span><span><span>=</span></span></span><span><span><span>$ORACLE_HOME</span></span></span><span><span>/lib:/usr/lib</span></span><span><span><span>export</span></span></span><span><span><span>CLASSPATH</span></span></span><span><span><span>=</span></span></span><span><span><span>$ORACLE_HOME</span></span></span><span><span>/jlib:</span></span><span><span><span>$ORACLE_HOME</span></span></span><span><span>/rdbms/jlib</span></span>
After adding, execute the following command to make the environment variables take effect immediately:
source<span><span> ~/.bash_profile</span></span>
(3) Silent Installation Configuration
Silent installation does not require graphical interface interaction, suitable for server environments. Create a response file to configure installation parameters:
Enter the response file directory<span><span><span>cd</span></span></span><span><span><span>$ORACLE_HOME</span></span></span><span><span>/install/response</span></span><span><span><span># Backup the original response file for later recovery</span></span></span><span><span><span>cp</span></span></span><span><span> db_install.rsp db_install.rsp.bak</span></span><span><span><span># Edit the response file</span></span></span><span><span><span>vim</span></span></span><span><span> db_install.rsp</span></span>
Configure the following key parameters in the response file; other parameters can remain default or be adjusted based on actual needs:
Installation option, install only the database software<span><span><span>oracle.install.option</span></span></span><span><span><span>=</span></span></span><span><span><span>INSTALL_DB_SWONLY</span></span></span><span><span><span># Operating system group name, corresponding to the previously created oinstall group</span></span></span><span><span><span>UNIX_GROUP_NAME</span></span></span><span><span><span>=</span></span></span><span><span><span>oinstall</span></span></span><span><span><span># Inventory directory for recording Oracle installation information</span></span></span><span><span><span>INVENTORY_LOCATION</span></span></span><span><span><span>=</span></span></span><span><span><span>/u01/app/oraInventory</span></span></span><span><span><span># Oracle software installation directory, consistent with the previously configured ORACLE_HOME</span></span></span><span><span><span>ORACLE_HOME</span></span></span><span><span><span>=</span></span></span><span><span><span>/u01/app/oracle/product/19.3.0/dbhome_1</span></span></span><span><span><span># Oracle base directory, consistent with the previously configured ORACLE_BASE</span></span></span><span><span><span>ORACLE_BASE</span></span></span><span><span><span>=</span></span></span><span><span><span>/u01/app/oracle</span></span></span><span><span><span># Installation version, EE indicates Enterprise Edition</span></span></span><span><span><span>oracle.install.db.InstallEdition</span></span></span><span><span><span>=</span></span></span><span><span><span>EE</span></span></span><span><span><span># DBA group name, corresponding to the previously created dba group</span></span></span><span><span><span>oracle.install.db.OSDBA_GROUP</span></span></span><span><span><span>=</span></span></span><span><span><span>dba</span></span></span><span><span><span># OPER group name, corresponding to the previously created oper group</span></span></span><span><span><span>oracle.install.db.OSOPER_GROUP</span></span></span><span><span><span>=</span></span></span><span><span><span>oper</span></span></span><span><span><span># The following parameters specify related management groups, all set to the dba group</span></span></span><span><span><span>oracle.install.db.OSBACKUPDBA_GROUP</span></span></span><span><span><span>=</span></span></span><span><span><span>dba</span></span></span><span><span><span>oracle.install.db.OSDGDBA_GROUP</span></span></span><span><span><span>=</span></span></span><span><span><span>dba</span></span></span><span><span><span>oracle.install.db.OSKMDBA_GROUP</span></span></span><span><span><span>=</span></span></span><span><span><span>dba</span></span></span><span><span><span>oracle.install.db.OSRACDBA_GROUP</span></span></span><span><span><span>=</span></span></span><span><span><span>dba</span></span></span><span><span><span># Do not automatically execute root scripts, to be executed manually later</span></span></span><span><span><span>oracle.install.db.rootconfig.executeRootScript</span></span></span><span><span><span>=</span></span></span><span><span><span>false</span></span></span>
(4) Execute Silent Installation
After completing the response file configuration, execute the following command to start the silent installation. The installation duration depends on server performance, typically taking 10-30 minutes:
Enter the Oracle installation directory<span><span><span>cd</span></span></span><span><span><span>$ORACLE_HOME</span></span></span><span><span><span># Execute the silent installation command, -silent indicates silent mode, -responseFile specifies the response file path, -ignorePrereqFailure ignores prerequisite check failures (some non-critical checks failing do not affect installation)</span></span></span><span><span>./runInstaller </span></span><span><span><span>-silent</span></span></span><span><span><span>-responseFile</span></span></span><span><span><span>$ORACLE_HOME</span></span></span><span><span>/install/response/db_install.rsp </span></span><span><span><span>-ignorePrereqFailure</span></span></span>
During the installation process, you can check the installation progress through the logs, which are usually located in <span><span>/u01/app/oraInventory/logs</span></span>. After installation is complete, run the following scripts as root as prompted:
Execute the root script in the inventory directory<span><span><span>sudo</span></span></span><span><span> /u01/app/oraInventory/orainstRoot.sh</span></span><span><span><span># Execute the root script in the Oracle installation directory</span></span></span><span><span><span>sudo</span></span></span><span><span> /u01/app/oracle/product/19.3.0/dbhome_1/root.sh</span></span>
3. Database Creation
(1) DBCA Silent Database Creation
Use the Database Configuration Assistant (DBCA) tool to silently create a database instance, which does not require a graphical interface and is efficient. Execute the following command, modifying parameter values as needed:
dbca <span><span>-silent</span></span><span><span>-createDatabase</span></span><span><span>\</span></span>