You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Building applications
Deploying Oracle
Copy page
Download PDF
Deploying Oracle
Oracle is a database commonly used for online transaction processing (OLTP), data warehousing (DW), and hybrid (OLTP & DW) database workloads. This topic describes how to deploy Oracle.​
Prerequisites​
  • The ECS instance status is Running.​
Software versions​
  • Linux operating system: In the example provided by this topic, CentOS 7.6 is used.​
  • Oracle database: 19.3.0.0.​
Procedure​
Step 1: Download software​
  1. Download an installation package of Oracle database 19.3.​
  1. From a local computer, access the Oracle official website to download the LINUX.X64_193000_db_home.zip package.​
You need to register for and log in to an Oracle account to download the package.​
  1. Upload the local Oracle installation package to the /home directory on the Linux server. For detailed operations, refer to Overview of local data upload.​
Step 2: Install Oracle​
Prepare the installation environment​
  1. Execute the following command to update CentOS system components to the latest version.​
  • ​
    yum update -y​
    ​
  1. Execute the following command to install required components.​
  • ​
    yum install -y binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 \ glibc-devel.i686 glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 \ libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64 \ libXtst.i686 libXtst.x86_64 make.x86_64 sysstat.x86_64​
    ​
  1. Disable SELinux.​
  • Execute the sestatus -v command to view the SELinux status.​
tip​
  • By default, SELinux is disabled in a CentOS public image provided by VolcanoEngine.​
  • If SELinux is enabled, execute the setenforce 0 command to disable it.​
  1. Disable firewall.​
  • Execute the systemctl status firewalld command to view the firewall status.​
tip​
  • By default, the firewall is disabled in a CentOS public image provided by VolcanoEngine.​
  • If the firewall is enabled, execute the systemctl stop firewalld command to disable it.​
  1. Execute the following commands to create the required operating system groups and users for the Oracle database, and set the password for the Oracle user.​
  • ​
    groupadd oinstall​
    groupadd dba​
    groupadd asmdba​
    groupadd backupdba​
    groupadd dgdba​
    groupadd kmdba​
    groupadd racdba​
    groupadd oper​
    useradd -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper -m oracle​
    passwd oracle​
    ​
  1. Edit the file /etc/hosts to configure the domain name resolution file.​
  1. Execute the hostname command to view the hostname.​
  • A hostname refers to an internal computer name in the operating system. It identifies a computer on a network and differs from an instance ID.​
  1. Execute the following command to open the /etc/hosts file.​
  • ​
    vim /etc/hosts​
    ​
  1. Press i key to enter edit mode and add the private IP address and hostname to the end.​
  • ​
    192.xx.xx.xx hostname​
    ​
Description​
You can obtain the private IP address of the instance on the Instances page.​
  1. Press Esc, enter :wq, and then press Enter to save the modifications and close the file.​
  1. Edit the /etc/sysctl.conf file to modify kernel parameters.​
  1. Execute the following command to open the /etc/sysctl.conf file.​
  • ​
    vim /etc/sysctl.conf​
    ​
  1. Press i key to enter edit mode and add the following content at the end.​
  • ​
    fs.aio-max-nr = 1048576​
    fs.file-max = 6815744​
    kernel.shmall = 16451328​
    kernel.shmmax = 33692319744 #Half of the physical memory​
    kernel.shmmni = 4096​
    kernel.sem = 250 32000 100 128​
    net.ipv4.ip_local_port_range = 9000 65500​
    net.core.rmem_default = 262144​
    net.core.rmem_max = 4194304​
    net.core.wmem_default = 262144​
    net.core.wmem_max = 1048576​
    ​
  1. Press Esc, enter :wq, and then press Enter to save the modifications and close the file.​
  1. Execute the sysctl -p command to make kernel modifications take effect.​
  1. Edit the /etc/security/limits.conf file to modify user limits.​
  1. Execute the following command to open the /etc/security/limits.conf file.​
  • ​
    vim /etc/security/limits.conf​
    ​
  1. Press i key to enter edit mode and add the following content at the end.​
  • ​
    @oinstall soft nofile 2048​
    @oinstall hard nofile 65536​
    @oinstall soft nproc 16384​
    @oinstall soft stack 10240​
    ​
  1. Press Esc, enter :wq, and then press Enter to save the modifications and close the file.​
  1. Edit the .bash_profile file to set environment variables.​
  1. Execute the su - oracle command to switch to the oracle user.​
  1. Execute the following command to open the .bash_profile file.​
  • ​
    vim .bash_profile​
    ​
  1. Press i key to enter edit mode and add the following content at the end.​
tip​
Replace the value of the ORACLE_HOSTNAME parameter with the hostname.​
  • ​
    export ORACLE_BASE=/u01/app/oracle​
    export ORACLE_HOME=/u01/app/oracle/product/19c​
    export PATH=$PATH:$ORACLE_HOME/bin:/usr/local/bin​
    export ORACLE_HOSTNAME=i-7grb71fftuhprqn9**** #Please modify it to your hostname​
    export ORACLE_SID=test #Oracle System ID​
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/network/lib:/lib:/usr/lib​
    export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib​
    ​
  1. Press Esc, enter :wq, and then press Enter to save the modifications and close the file.​
  1. Execute the source .bash_profile command to make file modifications take effect.​
  1. Execute the following command to switch to the root user.​
  • ​
    su -​
    ​
  1. Execute the following commands to create an Oracle installation directory.​
  • ​
    mkdir /u01​
    chmod 777 /u01​
    ​
Extract the installation package​
  1. Execute the following commands to extract the zip file of the Oracle database software.​
  • ​
    mkdir -p /u01/app/oracle/product/19c​
    yum install zip unzip -y​
    unzip /home/LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19c​
    ​
  1. Execute the following command to change the ownership of /u01.​
  • ​
    chown -R oracle:oinstall /u01​
    ​
Install software​
You can choose silent command-line installation or graphical interface installation. If you select the graphical interface installation, make sure that your instance has the graphical interface installed.​
Silent command-line installation​
  1. Execute the su - oracle command to switch to the oracle user.​
  1. Execute the following commands to back up the response file.​
  • ​
    cd /u01/app/oracle/product/19c/install/response​
    cp db_install.rsp db_install.rsp.bak​
    ​
  1. Edit the db_install.rsp file to configure the response file.​
  1. Execute the following command to open the db_install.rsp file.​
  • ​
    vim db_install.rsp​
    ​
  1. Press i key to enter edit mode. Only modify the parameter values displayed below; keep all other parameters at their default values.​
  • ​
    oracle.install.option=INSTALL_DB_SWONLY​
    UNIX_GROUP_NAME=oinstall​
    INVENTORY_LOCATION=/u01/app/oraInventory​
    ORACLE_HOME=/u01/app/oracle/product/19c​
    ORACLE_BASE=/u01/app/oracle​
    oracle.install.db.InstallEdition=EE​
    oracle.install.db.OSDBA_GROUP=dba​
    oracle.install.db.OSOPER_GROUP=oper​
    oracle.install.db.OSBACKUPDBA_GROUP=backupdba​
    oracle.install.db.OSDGDBA_GROUP=dgdba​
    oracle.install.db.OSKMDBA_GROUP=kmdba​
    oracle.install.db.OSRACDBA_GROUP=racdba​
    oracle.install.db.rootconfig.executeRootScript=false​
    ​
  1. Press Esc, enter :wq, and then press Enter to save the modifications and close the db_install.rsp file.​
  1. Execute the following commands to install Oracle.​
  • ​
    cd /u01/app/oracle/product/19c​
    ./runInstaller -silent -responseFile /u01/app/oracle/product/19c/install/response/db_install.rsp​
    ​
  • If the following output is returned, the installation succeeds.​
  • ​​​
  1. Execute the following commands to run the scripts.​
  • ​
    su -​
    /u01/app/oraInventory/orainstRoot.sh​
    /u01/app/oracle/product/19c/root.sh​
    ​
  • If the following output is returned, scripts have run successfully.​
  • ​​​
Graphical interface installation​
  1. In the graphical interface, enter the Oracle user password, and then click "Applications > System Tools > Terminal" to open the terminal.​
  1. Execute the following commands to install Oracle.​
  • ​
    cd /u01/app/oracle/product/19c​
    ./runInstaller​
    ​
  1. In the "Select Configuration Option" window that pops up, select "Set Up Software Only", and click "Next".​
  • ​image​​
  1. In the windows from Step 2 to Step 6, keep the default configurations and click "Next" in sequence.​
  • ​image​​
  • ​image​​
  • ​image​​
  • ​image​​
  • ​image​​
  1. In the "Root script execution configuration" window, select "Automatically run configuration scripts", enter the root user password, and click "Next".​
  • ​image​​
  1. In the "Perform Prerequisite Checks" window, select "Ignore All" and then click "Next".​
  • ​image​​
  1. In the prompt window that pops up, select "Yes".​
  • ​image​​
  1. In the "Summary" window, click "Install".​
  • ​image​​
  1. Wait for the Oracle installation to complete. When the pop-up window appears, click "Yes" to complete the installation.​
  • ​image​​
  • ​image​​
  • ​image​​
Step 3: Create a database​
You can choose silent command-line creation or graphical interface creation. If you choose graphical interface creation, make sure that your instance has the graphical interface installed.​
Silent command-line creation​
Create a Listener​
  1. Execute the su - oracle command to switch to the oracle user.​
  1. Execute the following commands to create a Listener.​
  • ​
    netca /silent /responseFile /u01/app/oracle/product/19c/assistants/netca/netca.rsp​
    lsnrctl status​
    ​
  • If the following output is returned, the creation succeeds.​
  • ​image​​
Create the database​
  1. Execute the following commands to back up the response file.​
  • ​
    cd /u01/app/oracle/product/19c/assistants/dbca​
    cp dbca.rsp dbca.rsp.bak​
    ​
  1. Edit the dbca.rsp file to configure the response file.​
  1. Execute the following command to open the dbca.rsp file.​
  • ​
    vim dbca.rsp​
    ​
  1. Press i key to enter edit mode. Only modify the parameter values displayed below; keep all other parameters at their default values.​
  • ​
    gdbName=test​
    sid=test​
    databaseConfigType=SI​
    templateName=General_Purpose.dbc​
    sysPassword=“password” //Please customize the password​
    systemPassword=“passowrd” //Please customize the password​
    emConfiguration=DBEXPRESS​
    dbsnmpPassword=“password” //Please customize the password​
    datafileDestination=/u01/app/oracle/oradata​
    characterSet=AL32UTF8​
    totalMemory=8192​
    ​
  1. Press Esc, enter :wq, and then press Enter to save the modifications and close the file.​
  1. Execute the following command to install the database.​
  • ​
    dbca -silent -createDatabase -responseFile /u01/app/oracle/product/19c/assistants/dbca/dbca.rsp​
    ​
  • If the following output is returned, the creation succeeds.​
  • ​image​​
Graphical interface creation​
Configure the Listener​
  1. In the terminal, execute the netca command to open the "Oracle Net Configuration Assistant: Welcome" window. Then, select "Listener configuration" and click "Next" twice.​
tip​
In this step, you need to log in to the ECS via VNC and execute the command as the oracle user.​
  • ​image​​
  • ​image​​
  1. In the "Oracle Net Configuration Assistant: Listener Configuration, Listener" window, set the Listener name. In the example provided in this topic, the default name is used. Click "Next".​
  • ​image​​
  1. In the "Oracle Net Configuration Assistant: Listener Configuration, Select Protocols" window, select the protocol you need to add. In the example provided in this topic, TCP is selected. Click "Next".​
  • ​image​​
  1. Keep the default configurations, and click "Next" three times in a row.​
  • ​image​​
  • ​image​​
  • ​image​​
  1. In the "Oracle Net Configuration Assistant: Welcome" window, click "Finish" to complete the Listener configuration.​
  • ​image​​
Create the database​
  1. In the terminal, execute the dbca command to open the "Database Operation" window, select "create a database", and then click "Next".​
tip​
In this step, you need to log in to the ECS via VNC and execute the command as the oracle user.​
  • ​image​​
  1. In the "Select Database creation Mode" window, select "Advanced configuration", and then click "Next".​
  • ​image​​
  1. In the windows from Step 3 to Step 8, keep the default configurations and click "Next" in sequence.​
  • ​image​​
  • ​image​​
  • ​image​​
  • ​image​​
  • ​image​​
  • ​image​​
  1. In the "Specify Configuration Options" window, configure memory and character set in sequence as needed. This topic uses the default configuration as an example. After configurations are completed, click "Next".​
  • ​image​​
  • ​image​​
  1. In the "Specify database user credentials" window, select "Use the same administrative password for all accounts", set the password, and then click "Next".​
  • ​image​​
  1. In the "Select Database Creation option" window, keep the default configuration, and then click "Next".​
  • ​image​​
  1. In the "Summary" window, click "Finish" to start creating the database.​
  • ​image​​
  • ​image​​
  1. In the "Finish" window, click "Close" to complete the creation process.​
  • ​image​​
Step 4: Verify the database​
Execute the sqlplus / as sysdba command as the oracle user to connect to the database.​
You can execute the su - oracle command to switch to the oracle user.​
If the following output is returned, the database is created.​
​image​​
Last updated: 2026.06.18 17:48:26