Labels

Android (1) Apache (1) bash (2) boost (2) C (37) C++ (5) cheatsheet (2) CLion (6) css (3) Debian (34) DL (17) dns (1) Docker (3) Dreamweaver (2) Eclipse (3) fail2ban (5) git (6) GitHub (5) Hacking (4) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (33) javascript (3) Linux (184) Mac (21) Machine Learning (1) mySQL (53) Netbeans (6) Networking (1) Nexus (1) OpenVMS (6) Oracle (5) Pandas (3) php (17) Postgresql (8) Python (9) raid (1) RedHat (15) Samba (3) Slackware (52) SQL (14) ssh (1) svn (1) tar (1) ThinkPad (1) Virtualbox (4) Visual Basic (2) Visual Studio (1) Windows (8) wire (1)

Monday, 14 September 2026

Oracle database 19c on Oracle Linux 8.10

See also:

Oracle database 11g on Windows 2012

Oracle database 11g on Oracle linux 6.10/7.9


Install Linux

1). Retrieve OracleLinux-R8-U10-x86_64-dvd.iso from here and install. 

In this example, this was done in a VM with 1Tb storage and 4Gb of ram.


Pre Installation


1). Do the preinstall;

dnf install -y oracle-database-preinstall-19c


Oracle Database Installation


1). Retrieve Oracle Database 19c from here [direct link]

2). Install with;
 
dnf localinstall -y /path/to/oracle-database-ee-19c-1.0-1.x86_64.rpm

This may take a while, so kick back and relax with a strong mug of Java, just like old times.



Oracle Database Post Installation


1). Change password with passwd oracle

2). Create data dir;

mkdir -p /var/DATA
chown -R oracle:oinstall /var/DATA
chmod -R 775 /var/DATA

3). Edit /etc/sysconfig/oracledb_ORCLCDB-19c.conf to match the data dir from above.

4). Execute configuration script /etc/init.d/oracledb_ORCLCDB-19c configure

This cause me several errors so it is important to have the hostname set correctly and in /etc/hosts
and done the following after it failed;
rm -f /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
rm -f /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora
rm -f /opt/oracle/product/19c/dbhome_1/network/admin/endpoints.ora

When  /etc/init.d/oracledb_ORCLCDB-19c configure finally worked, it also took an absolute age to complete.

5). Set environment variables;

Add the below to /home/oracle/.bash_profile

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export ORACLE_SID=ORCLCDB
export PATH=$PATH:$ORACLE_HOME/bin


If we have not yet set the passwords for SYS, SYSTEM or PDBADMIN then do;

sqlplus / as sysdba

-- Change SYS password
ALTER USER SYS IDENTIFIED BY "YourNewPassword123#";

-- Change SYSTEM password
ALTER USER SYSTEM IDENTIFIED BY "YourNewPassword123#";

-- Change PDBADMIN password in the pluggable database
ALTER SESSION SET CONTAINER = ORCLPDB1;
ALTER USER PDBADMIN IDENTIFIED BY "YourNewPassword123#";

EXIT;




Optional

Install SQL Developer

1). Install Java; dnf install -y java-11-openjdk-devel or dnf install -y java-17-openjdk-devel

2). Get SQL Developer from here

3). Install with dnf localinstall -y /path/to/sqldeveloper-*.noarch.rpm



Optional


To switch the container to PDB and allow 2 instances to run concurrently, do;
 
sqlplus / as sysdba

ALTER SESSION SET CONTAINER = ORCLPDB1;

CREATE USER app_test IDENTIFIED BY MySecurePassword123#;
GRANT CREATE SESSION, CREATE TABLE TO app_test;
ALTER USER app_test QUOTA UNLIMITED ON USERS;

Test logging in with new user;

sqlplus app_test/MySecurePassword123#@//localhost:1521/ORCLPDB1

Optional: Create test table and test;

CREATE TABLE employees_test (
    emp_id NUMBER PRIMARY KEY,
    emp_name VARCHAR2(50),
    hire_date DATE DEFAULT SYSDATE
);
INSERT INTO employees_test (emp_id, emp_name) VALUES (1, 'Alice');
INSERT INTO employees_test (emp_id, emp_name) VALUES (2, 'Bob');
COMMIT;

SELECT * FROM employees_test;

To create the second session;

ALTER SESSION SET CONTAINER = CDB$ROOT;

CREATE PLUGGABLE DATABASE ORCLPDB2 
ADMIN USER pdbadmin IDENTIFIED BY MySecurePassword123# 
ROLES = (CONNECT)
FILE_NAME_CONVERT = ('/var/DATA/oracle/oradata/ORCLCDB/pdbseed/', '/var/DATA/oracle/oradata/ORCLCDB/orclpdb2/');

ALTER PLUGGABLE DATABASE ORCLPDB1 OPEN READ ONLY;
CREATE PLUGGABLE DATABASE ORCLPDB2 FROM ORCLPDB1;
ALTER PLUGGABLE DATABASE ORCLPDB1 OPEN READ WRITE;

ALTER PLUGGABLE DATABASE ORCLPDB2 OPEN READ WRITE;
ALTER PLUGGABLE DATABASE ORCLPDB2 SAVE STATE;


Create directory for second instance;

sudo mkdir -p /var/DATA/oracle/oradata/ORCLCDB/orclpdb2
sudo chown -R oracle:oinstall /var/DATA/oracle/oradata/ORCLCDB/orclpdb2

CREATE PLUGGABLE DATABASE ORCLPDB2 
ADMIN USER pdbadmin IDENTIFIED BY MySecurePassword123# 
ROLES = (CONNECT)
FILE_NAME_CONVERT = ('/var/DATA/oracle/oradata/ORCLCDB/pdbseed/', '/var/DATA/oracle/oradata/ORCLCDB/orclpdb2');

Optional

If we need to rename the instances, the below are examples of renaming ORCLPDB1 to ORC_MES_PROD and ORCLPDB2 to ORC_MES_QA

sqlplus / as sysdba << 'EOF'
ALTER PLUGGABLE DATABASE ORCLPDB1 OPEN RESTRICTED;
ALTER SESSION SET CONTAINER = ORCLPDB1;
ALTER PLUGGABLE DATABASE RENAME GLOBAL_NAME TO ORC_MES_PROD;
ALTER SESSION SET CONTAINER = CDB$ROOT;
ALTER PLUGGABLE DATABASE ORC_MES_PROD CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE ORC_MES_PROD OPEN READ WRITE;
ALTER PLUGGABLE DATABASE ORC_MES_PROD SAVE STATE;
SHOW PDBS;
EXIT;
EOF


sqlplus / as sysdba << 'EOF'
ALTER PLUGGABLE DATABASE ORCLPDB2 CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE ORCLPDB2 OPEN RESTRICTED;
ALTER SESSION SET CONTAINER = ORCLPDB2;
ALTER PLUGGABLE DATABASE RENAME GLOBAL_NAME TO ORC_MES_QA;
ALTER SESSION SET CONTAINER = CDB$ROOT;
ALTER PLUGGABLE DATABASE ORC_MES_QA CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE ORC_MES_QA OPEN READ WRITE;
ALTER PLUGGABLE DATABASE ORC_MES_QA SAVE STATE;
SHOW PDBS;
EXIT;
EOF

 

Oracle Database Import


[STAGE 1] - Analise the DMP file.

1) using sqlplus / as sysdba do;
 
ALTER SESSION SET CONTAINER = ORC_MES_PROD;
CREATE OR REPLACE DIRECTORY MY_DUMP_DIR AS '/var/DATA';
GRANT READ, WRITE ON DIRECTORY MY_DUMP_DIR TO sys, system;
 
2) Create an inspect.par file;

USERID='system/some_password@localhost:1521/orc_mes_qa'
DIRECTORY=MY_DUMP_DIR
DUMPFILE=FULLDB_01.DMP
SQLFILE=dump_contents.sql
LOGFILE=inspect_dump.log
EXCLUDE=STATISTICS

3) We can then do impdp PARFILE=/var/DATA/inspect.par

The following are options to read from the output file;

grep -i "CREATE TABLESPACE" /var/DATA/dump_contents.sql

grep -i -A 5 "CREATE TABLESPACE" /var/DATA/dump_contents.sql

grep -i "CREATE USER" /var/DATA/dump_contents.sql

[STAGE 2] - Process the sql file.

The dump_contents.sql file can be further sanitized, in my case, removing windows paths and converting to Linux paths, the below is an example of removing J and L windows paths and replacing them with /var/DATA/oracle/oradata/ORCLCDB/ORCLPDB1
 
sed -E 's|[JL]:\\CHRDBP\\ORADATA\\(CHRDBP\\)?|/var/DATA/oracle/oradata/ORCLCDB/ORCLPDB1/|gI' original_ddl.sql | tr '\\' '/' > stage2_storage_setup.sql
 
We will then use this file stage2_storage_setup.sql to create our new table spaces, but firstly, we can check available PDB's using sqlplus / as sysdba
 
SELECT name, open_mode FROM v$pdbs;
 
OR
 
SHOW PDBS;
 
we can then switch to our desired target PDB, do this using; 
 
 -- For the Production environment:
ALTER SESSION SET CONTAINER = ORC_MES_PROD;

-- OR for the QA environment:
ALTER SESSION SET CONTAINER = ORC_MES_QA;
 

then from within the sql environment, do;
 
@stage2_storage_setup.sql

 

[STAGE 3] - Roles, Users, & Profiles.

 
We would then create an import.par file;
 
USERID="sys/my_password@localhost:1521/ORC_MES_QA as sysdba"
DIRECTORY=MY_DUMP_DIR
DUMPFILE=FULLDB_01.DMP
LOGFILE=impdp_full_import.log
TABLE_EXISTS_ACTION=APPEND
METRICS=YES
LOGTIME=ALL
PARALLEL=4
EXCLUDE=DIRECTORY
 
With sqlplus / as sysdba we can; 
 
See progress;
SQL> SELECT sid, serial#, opname, sofar, totalwork, units, ROUND(sofar/totalwork*100, 2) AS pct_complete FROM v$session_longops WHERE (opname LIKE '%IMPORT%' OR opname LIKE '%EXPORT%')  AND totalwork > 0;
 
or
 
SELECT owner, COUNT(*) AS loaded_tables, SUM(num_rows) AS total_rows FROM dba_tables WHERE owner IN ('MES', 'APS', 'SCD', 'BRONER', 'INTERFACES')  AND num_rows > 0GROUP BY owner;
 
or 
 
SELECT job_name, operation, job_mode, state, degree FROM dba_datapump_jobs WHERE state = 'EXECUTING';
 
 
Once complete, we can check with sqlplus / as sysdba do; 
 
SELECT tablespace_name, status, contents FROM dba_tablespaces;
 
\\
\\
\\
\\
 

Extra

 
To unlock a user, sqlplus / as sysdba
 
ALTER USER MES ACCOUNT UNLOCK;
ALTER USER MES IDENTIFIED BY "MESpassword";

//
//
//
//
//
 

Logs


[root@oracle SHARE]# dnf install -y oracle-database-preinstall-19c
Oracle Linux 8 BaseOS Latest (x86_64)            19 MB/s | 164 MB     00:08    
Oracle Linux 8 Application Stream (x86_64)       20 MB/s |  86 MB     00:04    
Latest Unbreakable Enterprise Kernel Release 7   19 MB/s | 119 MB     00:06    
Last metadata expiration check: 0:00:24 ago on Mon 14 Sep 2026 17:58:07 BST.
Dependencies resolved.
================================================================================
 Package         Arch   Version                         Repository         Size
================================================================================
Installing:
 oracle-database-preinstall-19c
                 x86_64 1.0-4.el8                       ol8_appstream      30 k
Installing dependencies:
 glibc-devel     x86_64 2.28-251.0.2.el8                ol8_baseos_latest  89 k
 ksh             x86_64 20120801-272.0.1.el8_10         ol8_appstream     924 k
 libaio-devel    x86_64 0.3.112-1.el8                   ol8_baseos_latest  19 k
 libnsl          x86_64 2.28-251.0.2.el8                ol8_baseos_latest 111 k
 libstdc++-devel x86_64 8.5.0-21.0.1.el8                ol8_appstream     2.1 M
 libxcrypt-devel x86_64 4.1.1-6.el8                     ol8_baseos_latest  25 k
 lm_sensors-libs x86_64 3.4.0-23.20180522git70f7e08.el8 ol8_baseos_latest  59 k
 make            x86_64 1:4.2.1-11.el8                  ol8_baseos_latest 498 k
 sysstat         x86_64 11.7.3-13.0.3.el8_10            ol8_appstream     427 k

Transaction Summary
================================================================================
Install  10 Packages

Total download size: 4.2 M
Installed size: 18 M
Downloading Packages:
(1/10): libaio-devel-0.3.112-1.el8.x86_64.rpm   120 kB/s |  19 kB     00:00    
(2/10): glibc-devel-2.28-251.0.2.el8.x86_64.rpm 437 kB/s |  89 kB     00:00    
(3/10): libxcrypt-devel-4.1.1-6.el8.x86_64.rpm  334 kB/s |  25 kB     00:00    
(4/10): libnsl-2.28-251.0.2.el8.x86_64.rpm      457 kB/s | 111 kB     00:00    
(5/10): lm_sensors-libs-3.4.0-23.20180522git70f 991 kB/s |  59 kB     00:00    
(6/10): ksh-20120801-272.0.1.el8_10.x86_64.rpm  6.1 MB/s | 924 kB     00:00    
(7/10): make-4.2.1-11.el8.x86_64.rpm            2.7 MB/s | 498 kB     00:00    
(8/10): oracle-database-preinstall-19c-1.0-4.el 789 kB/s |  30 kB     00:00    
(9/10): libstdc++-devel-8.5.0-21.0.1.el8.x86_64 8.5 MB/s | 2.1 MB     00:00    
(10/10): sysstat-11.7.3-13.0.3.el8_10.x86_64.rp 4.0 MB/s | 427 kB     00:00    
--------------------------------------------------------------------------------
Total                                           7.9 MB/s | 4.2 MB     00:00     
Oracle Linux 8 BaseOS Latest (x86_64)           3.0 MB/s | 3.1 kB     00:00    
Importing GPG key 0xAD986DA3:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : libxcrypt-devel-4.1.1-6.el8.x86_64                    1/10 
  Installing       : glibc-devel-2.28-251.0.2.el8.x86_64                   2/10 
  Running scriptlet: glibc-devel-2.28-251.0.2.el8.x86_64                   2/10 
  Installing       : libstdc++-devel-8.5.0-21.0.1.el8.x86_64               3/10 
  Installing       : ksh-20120801-272.0.1.el8_10.x86_64                    4/10 
  Running scriptlet: ksh-20120801-272.0.1.el8_10.x86_64                    4/10 
  Installing       : make-1:4.2.1-11.el8.x86_64                            5/10 
  Running scriptlet: make-1:4.2.1-11.el8.x86_64                            5/10 
  Installing       : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x8    6/10 
  Running scriptlet: lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x8    6/10 
  Installing       : sysstat-11.7.3-13.0.3.el8_10.x86_64                   7/10 
  Running scriptlet: sysstat-11.7.3-13.0.3.el8_10.x86_64                   7/10 
  Installing       : libnsl-2.28-251.0.2.el8.x86_64                        8/10 
  Installing       : libaio-devel-0.3.112-1.el8.x86_64                     9/10 
  Running scriptlet: oracle-database-preinstall-19c-1.0-4.el8.x86_64      10/10 
  Installing       : oracle-database-preinstall-19c-1.0-4.el8.x86_64      10/10 
  Running scriptlet: oracle-database-preinstall-19c-1.0-4.el8.x86_64      10/10 
  Verifying        : glibc-devel-2.28-251.0.2.el8.x86_64                   1/10 
  Verifying        : libaio-devel-0.3.112-1.el8.x86_64                     2/10 
  Verifying        : libnsl-2.28-251.0.2.el8.x86_64                        3/10 
  Verifying        : libxcrypt-devel-4.1.1-6.el8.x86_64                    4/10 
  Verifying        : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x8    5/10 
  Verifying        : make-1:4.2.1-11.el8.x86_64                            6/10 
  Verifying        : ksh-20120801-272.0.1.el8_10.x86_64                    7/10 
  Verifying        : libstdc++-devel-8.5.0-21.0.1.el8.x86_64               8/10 
  Verifying        : oracle-database-preinstall-19c-1.0-4.el8.x86_64       9/10 
  Verifying        : sysstat-11.7.3-13.0.3.el8_10.x86_64                  10/10 

Installed:
  glibc-devel-2.28-251.0.2.el8.x86_64                                           
  ksh-20120801-272.0.1.el8_10.x86_64                                            
  libaio-devel-0.3.112-1.el8.x86_64                                             
  libnsl-2.28-251.0.2.el8.x86_64                                                
  libstdc++-devel-8.5.0-21.0.1.el8.x86_64                                       
  libxcrypt-devel-4.1.1-6.el8.x86_64                                            
  lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64                        
  make-1:4.2.1-11.el8.x86_64                                                    
  oracle-database-preinstall-19c-1.0-4.el8.x86_64                               
  sysstat-11.7.3-13.0.3.el8_10.x86_64                                           

Complete!




[root@oracle SHARE]# dnf localinstall -y oracle-database-ee-19c-1.0-1.x86_64.rpm 
Last metadata expiration check: 0:07:57 ago on Mon 14 Sep 2026 17:58:07 BST.
Dependencies resolved.
================================================================================
 Package                      Architecture Version     Repository          Size
================================================================================
Installing:
 oracle-database-ee-19c       x86_64       1.0-1       @commandline       2.5 G

Transaction Summary
================================================================================
Install  1 Package

Total size: 2.5 G
Installed size: 6.9 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Running scriptlet: oracle-database-ee-19c-1.0-1.x86_64                    1/1 
  Installing       : oracle-database-ee-19c-1.0-1.x86_64                    1/1 
  Running scriptlet: oracle-database-ee-19c-1.0-1.x86_64                    1/1 
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure

  Verifying        : oracle-database-ee-19c-1.0-1.x86_64                    1/1 

Installed:
  oracle-database-ee-19c-1.0-1.x86_64                                           

Complete!




[root@oracle ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB1.log" for further details.

Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.


No comments:

Post a Comment

Note: only a member of this blog may post a comment.