Sunday, 15 June 2025

Oracle 19c Installation on CentOS Stream 9

Oracle 19c Installation on CentOS Stream 9

Oracle Database 19c Installation on CentOS Stream 9

1. Environment Details

OS: CentOS Stream release 9
Disk Layout: / (20G), /u01 (100G), /home (25G), /boot (960M)
Oracle Version: 19.27.0.0.0
Patch: 37642901
    

2. Required Packages

dnf install -y bc binutils gcc gcc-c++ glibc glibc-devel ksh \
libaio libaio-devel libX11 libXau libXi libXtst libgcc libnsl \
libstdc++ libstdc++-devel libxcb make smartmontools sysstat \
elfutils-libelf elfutils-libelf-devel libXrender libXrender-devel
    

3. User and Directory Setup

groupadd -g 54321 oinstall
groupadd -g 54322 dba
useradd -u 54321 -g oinstall -G dba oracle
passwd oracle

mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
    

4. Kernel Parameters

# /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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

sysctl -p
    

5. Resource Limits

# /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768

# /etc/pam.d/login
session required pam_limits.so
    

6. Oracle Environment Variables

# ~/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
export ORACLE_SID=vihaan
export PATH=$PATH:$ORACLE_HOME/bin
    

7. Installation and Patching

unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
mv OPatch OPatch-backup
unzip -qqd $ORACLE_HOME p6880880_190000_Linux-x86-64.zip
export PATH=$ORACLE_HOME/OPatch:$PATH

./opatch version
# Output: 12.2.0.1.46

export CV_ASSUME_DISTID=OL8
./runInstaller -applyRU /home/oracle/37642901

# Ignore compat-libcap1-1.10 check when prompted
    

8. Post-Installation


???
$ORACLE_HOME/bin/relink as_installed

# Verify patches
./opatch lsinventory | grep -E "(^Patch.*applied)|(^Sub-patch)"
Patch  37642901 : applied on Sat Jun 14 10:33:37 BST 2025
Patch  29585399 : applied on Thu Apr 18 08:21:33 BST 2019
    

9. Database Startup

sqlplus / as sysdba

SQL> Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0




SQL> alter pluggable database VIHAAN27 open ;

Warning: PDB altered with errors.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  YES
         3 VIHAAN27                       READ WRITE YES

=====================


steps to solve this 
Execute datapatch individually in each of the containers, starting with CDB$ROOT :


1. Apply datapatch is CDB$ROOT :
  ===================================
  ./datapatch -verbose -pdbs CDB\$ROOT

2. Apply datapatch is PDB :
  ===================================
  $ ./datapatch -verbose -pdbs 

3. Apply datapatch is PDB$SEED :
  ==================================
  SQL> alter session set container=PDB$SEED;
  SQL> alter session set "_oracle_script"=TRUE;
  SQL> alter pluggable database pdb$seed close immediate instances=all;
  SQL> alter pluggable database pdb$seed OPEN READ WRITE;
  SQL> select open_mode from v$database;
  SQL> exit

  Execute: ./datapatch -verbose -pdbs PDB\$SEED

  SQL> alter session set "_oracle_script"=FALSE;
  
4. show pdbs -> If this shows the PDB$SEED in restricted mode, bounce the database once.

5. Check for the relevant patch existence in the registry$sqlpatch for all the containers (CDB$ROOT, PDB$SEED and PDB) :

  set linesize 150
  col logfile for a90
  select patch_id, action, logfile, status from registry$sqlpatch;


============================================


alter session set container=CDB$ROOT;



 set linesize 200
 column name format a10
 column cause format a10
 column type format a10
 column message format a95
 column action format a30
col TIME for a30	 
 select TIME,name, cause, type, message,status from PDB_PLUG_IN_VIOLATIONS where status = 'PENDING';

TIME                           NAME       CAUSE      TYPE       MESSAGE                                                                                         STATUS
------------------------------ ---------- ---------- ---------- ----------------------------------------------------------------------------------------------- ---------
25-JUN-25 10.37.19.783536      VIHAAN27   SQL Patch  ERROR      19.27.0.0.0 Release_Update 2504061311: APPLY with status WITH ERRORS in the PDB                 PENDING
25-JUN-25 10.50.00.392479      PDB$SEED   SQL Patch  ERROR      19.27.0.0.0 Release_Update 2504061311: APPLY with status WITH ERRORS in the PDB                 PENDING






QL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  YES
         3 VIHAAN27                       READ WRITE YES


[root@ora19 oracle]# updatedb
[root@ora19 oracle]# locate datapatch
/u01/app/oracle/product/19.0.0/dbhome_1/OPatch/datapatch



./datapatch -verbose -pdbs CDB\$ROOT
SQL Patching tool version 19.27.0.0.0 Production on Wed Jun 25 10:48:28 2025
Copyright (c) 2012, 2025, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_4538_2025_06_25_10_48_28/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
  No interim patches found

Current state of release update SQL patches:
  Binary registry:
    19.27.0.0.0 Release_Update 250406131139: Installed
  PDB CDB$ROOT:
    Applied 19.27.0.0.0 Release_Update 250406131139 successfully on 14-JUN-25 11.00.09.198524

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT
    No interim patches need to be rolled back
    No release update patches need to be installed
    No interim patches need to be applied

SQL Patching tool complete on Wed Jun 25 10:48:40 2025

[oracle@ora19 OPatch]$ sqlme

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 25 10:49:17 2025
Version 19.27.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

SQL> alter session set container=PDB$SEED;

Session altered.

SQL> alter session set "_oracle_script"=TRUE;

Session altered.

SQL> alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SQL> alter pluggable database pdb$seed OPEN READ WRITE;

Warning: PDB altered with errors.

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> alter session set container=PDB$SEED;

Session altered.

@?/rdbms/admin/utlrp.sql remotely - Oracle Forums

SQL> alter session set container=PDB$SEED;

Session altered.

SQL> @?/rdbms/admin/utlrp.sql

Session altered.


 ./datapatch -verbose -pdbs PDB\$SEED
SQL Patching tool version 19.27.0.0.0 Production on Wed Jun 25 11:02:59 2025
Copyright (c) 2012, 2025, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_5662_2025_06_25_11_02_59/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
  No interim patches found

Current state of release update SQL patches:
  Binary registry:
    19.27.0.0.0 Release_Update 250406131139: Installed
  PDB PDB$SEED:
    Applied 19.27.0.0.0 Release_Update 250406131139 successfully on 25-JUN-25 10.57.08.184703

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: PDB$SEED
    No interim patches need to be rolled back
    No release update patches need to be installed
    No interim patches need to be applied

SQL Patching tool complete on Wed Jun 25 11:03:11 2025



SQL> alter session set container=VIHAAN27 ;

Session altered.




SQL> alter session set container=VIHAAN27 ;

Session altered.

SQL>  @?/rdbms/admin/utlrp.sql

Session altered.



 ./datapatch -verbose -pdbs VIHAAN27
SQL Patching tool version 19.27.0.0.0 Production on Wed Jun 25 11:05:23 2025
Copyright (c) 2012, 2025, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_6098_2025_06_25_11_05_23/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
  No interim patches found

Current state of release update SQL patches:
  Binary registry:
    19.27.0.0.0 Release_Update 250406131139: Installed
  PDB VIHAAN27:
    Applied 19.27.0.0.0 Release_Update 250406131139 with errors on 14-JUN-25 11.05.28.279212

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: VIHAAN27
    No interim patches need to be rolled back
    Patch 37642901 (Database Release Update : 19.27.0.0.250415 (37642901)):
      Apply from 19.1.0.0.0 Feature Release to 19.27.0.0.0 Release_Update 250406131139
    No interim patches need to be applied


WARNING: Following components are NOT in a valid state.
         This could cause patching failure. If it does, consider
         running utlrp.sql to bring components to VALID state.
         Then, re-run datapatch.

         VIHAAN27 : SDO [INVALID]

Installing patches...


Patch installation complete.  Total patches installed: 1

Validating logfiles...done
Patch 37642901 apply (pdb VIHAAN27): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_VIHAAN_VIHAAN27_2025Jun25_11_05_36.log (no errors)
SQL Patching tool complete on Wed Jun 25 11:12:50 2025



  set linesize 200
  col logfile for a90
  select patch_id, action, logfile, status from registry$sqlpatch;


 PATCH_ID ACTION                         LOGFILE                                                                                    STATUS
---------- ------------------------------ ------------------------------------------------------------------------------------------ -------------------------
  37642901 APPLY                          /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_VIHAAN_CDBROOT_2025J SUCCESS
                                          un14_10_47_31.log


SQL> alter pluggable database VIHAAN27 open ;

Pluggable database altered.


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 VIHAAN27                       READ WRITE NO
SQL>



VIHAAN =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ora19.lan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = vihaan)
    )
  )

LISTENER_VIHAAN =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19.lan)(PORT = 1521))



[oracle@ora19 admin]$ lsnrctl service|grep -i vihaan27
Service "vihaan27" has 1 instance(s).



VIHAAN27 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ora19.lan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = VIHAAN27)
    )
  )
  
  
  
VIHAAN27 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ora19.lan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = VIHAAN27)
    )
  )
  
  
  
  
[oracle@ora19 admin]$ tnsping VIHAAN27

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 25-JUN-2025 11:25:41

Copyright (c) 1997, 2025, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora19.lan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = VIHAAN27)))
OK (20 msec)



  sqlplus 'sys/sys@VIHAAN27 as sysdba'
  
  
  sqlplus 'sys/sys@VIHAAN27 as sysdba'

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 25 11:27:35 2025
Version 19.27.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 VIHAAN27                       READ WRITE NO
SQL>














     
Requirements for Installing Oracle Database/Client 19c (19.22 or higher) on OL9 or RHEL9 64-bit (x86-64) 
(Doc ID 2982833.1)

bc
binutils
compat-openssl11
elfutils-libelf
fontconfig
glibc
glibc-devel
ksh
libaio
libasan
liblsan
libX11
libXau
libXi
libXrender
libXtst
libxcrypt-compat
libgcc
libibverbs
libnsl
librdmacm
libstdc++
libxcb
libvirt-libs
make
policycoreutils
policycoreutils-python-utils
smartmontools
sysstat

Note - For 64-Bit Oracle Database Client Installs,below Packages are required
libnsl2
libnsl2-devel

    

©

No comments:

Post a Comment