Installing Oracle Database Using Command-Line Interface

Install Oracle Database software and create an Oracle Database using the gold image-based installation with the command-line interface.

Have all the information you need to provide regarding users groups, and storage paths before you start installation. Oracle recommends that you have your My Oracle Support credentials available during installation. You should also be prepared to run root scripts or provide information to automate root scripts.

  1. Log in as the Oracle installation owner user account (oracle) that you want to own the software binaries.
  2. If this is the first time you are installing Oracle software, then create the Oracle base and the Oracle inventory directories as per the Oracle Optimal Flexible Architecture (OFA) recommendations. Specify the correct owner, group, and permissions for these directories.
    mkdir -p /u01/app/oracle
    mkdir -p /u01/app/oraInventory
    chown -R oracle:oinstall /u01/app/oracle
    chown -R oracle:oinstall /u01/app/oraInventory
    chmod -R 775 /u01/app
  3. Download the Oracle Database installation image files (db_home.zip) to a directory of your choice. For example, you can download the image files to the /tmp directory.
  4. Create an OFA-compliant Oracle home directory and extract the image files that you have downloaded in to this Oracle home directory. For example:
    mkdir -p /u01/app/oracle/product/23.0.0/dbhome_1
    cd /u01/app/oracle/product/23.0.0/dbhome_1
    unzip -q /tmp/db_home.zip

    Note:

    • Ensure that the Oracle home directory path you create is in compliance with the Oracle Optimal Flexible Architecture recommendations. Also, unzip the installation image files only in this Oracle home directory that you created.
    • Oracle home or Oracle base cannot be symlinks, nor can any of their parent directories, all the way to up to the root directory.
  5. From the Oracle home directory, start the Oracle Database software installation and database creation:
    cd /u01/app/oracle/product/23.0.0/dbhome_1
    ./runInstaller -createDatabase -OSDBA dba -OSBACKUPDBA backupdba -OSDGDBA dgdba -OSKMDBA kmdba -OSRACDBA racdba 
    -ORACLE_BASE /u01/app/oracle -diskGroup DATA -gdbName mydb.example.com -pdbName mypdb1 -dbSID mydb -memoryLimit 24457 
    -OSOPER oper -installEdition EE -enableAutoMemoryManagement -INVENTORY_LOCATION /u01/app/oraInventory 
    -executeConfigTools -executeRootScript -configMethod ROOT

    Note:

    Run the runInstaller command from the Oracle home directory only. Do not run the runInstaller from $ORACLE_HOME/oui/bin/, or any other location, to install Oracle Database.
  6. Provide the root user password when prompted.