Tuesday, January 17, 2023

HugePages Configuration for Oracle on Linux (x86-64)

For large SGA sizes, HugePages can give substantial benefits in virtual memory management. Without HugePages, the memory of the SGA is divided into 4K pages, which have to be managed by the Linux kernel. Using HugePages, the page size is increased to 2MB (configurable to 1G if supported by the hardware), thereby reducing the total number of pages to be managed by the kernel and therefore reducing the amount of memory required to hold the page table in memory. In addition to these changes, the memory associated with HugePages can not be swapped out, which forces the SGA to stay memory resident. The savings in memory and the effort of page management make HugePages pretty much mandatory for Oracle systems running on x86-64 architectures. However their is a limitation by Oracle, because Automatic Memory Management (AMM) does not support HugePages. If you already use AMM and MEMORY_TARGET is set you have to disable it and switch back to Automatic Shared Memory Management (ASMM). That means set SGA_TARGET and PGA_AGGREGATE_TARGET.

1. To determine how much memory currently using to support the page table

[root@bo3udsmsxodb01 ~]# grep PageTables /proc/meminfo
PageTables:        9764 kB

2. Check current HugePage usages

[root@bo3udsmsxodb01 ~]$ grep Huge /proc/meminfo
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB

3. This script is intended to compute values for the recommended HugePages configuration

#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
# on Oracle Linux
#
# Note: This script does calculation for all shared memory
# segments available when the script is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
#
# This script is provided by Doc ID 401749.1 from My Oracle Support
# http://support.oracle.com

# Welcome text
echo "
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments on Oracle Linux. Before proceeding with the execution please note following:
 * For ASM instance, it needs to configure ASMM instead of AMM.
 * The 'pga_aggregate_target' is outside the SGA and
   you should accommodate this while calculating the overall size.
 * In case you changes the DB SGA size,
   as the new SGA will not fit in the previous HugePages configuration,
   it had better disable the whole HugePages,
   start the DB with new SGA size and run the script again.
And make sure that:
 * Oracle Database instance(s) are up and running
 * Oracle Database 11g Automatic Memory Management (AMM) is not setup
   (See Doc ID 749851.1)
 * The shared memory segments can be listed by command:
     # ipcs -m


Press Enter to proceed..."

read

# Check for the kernel version
KERN=`uname -r | awk -F. '{ printf("%d.%d\n",$1,$2); }'`

# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
if [ -z "$HPG_SZ" ];then
    echo "The hugepages may not be supported in the system where the script is being executed."
    exit 1
fi

# Initialize the counter
NUM_PG=0

# Cumulative number of pages required to handle the running shared memory segments
for SEG_BYTES in `ipcs -m | cut -c44-300 | awk '{print $1}' | grep "[0-9][0-9]*"`
do
    MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`
    if [ $MIN_PG -gt 0 ]; then
        NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`
    fi
done

RES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc -q`

# An SGA less than 100MB does not make sense
# Bail out if that is the case
if [ $RES_BYTES -lt 100000000 ]; then
    echo "***********"
    echo "** ERROR **"
    echo "***********"
    echo "Sorry! There are not enough total of shared memory segments allocated for
HugePages configuration. HugePages can only be used for shared memory segments
that you can list by command:

    # ipcs -m

of a size that can match an Oracle Database SGA. Please make sure that:
 * Oracle Database instance is up and running
 * Oracle Database 11g Automatic Memory Management (AMM) is not configured"
    exit 1
fi

# Finish with results
case $KERN in
    '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;
           echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;
    '2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '3.8') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '3.10') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '4.1') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '4.14') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '4.18') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '5.4') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    *) echo "Kernel version $KERN is not supported by this script (yet). Exiting." ;;
esac

# End

4. Create a text file named hugepages_settings.sh and Copy above contents

5. Make hugepages_settings.sh as executable file

[root@bo3udsmsxodb01 ~]# chmod +x hugepages_settings.sh

6. Verify all the below requiremnet has been met to execute the hugepages_settings.sh

  • Oracle Database instance(s) are up and running 
  • Automatic Memory Management (AMM) is not setup 
  • The shared memory segments can be listed by command "ipcs -m" 
  • Oracle Linux Package 'bc' installed

7. Run hugepages_settings.sh

[root@bo3udsmsxodb01 ~]# ./hugepages_settings.sh

8. Script return the computed value of HugePages.

[root@bo3udsmsxodb01 ~]# Recommended setting: vm.nr_hugepages = 16386

9. Modify /etc/sysctl.conf, Add 'vm.nr_hugepages = 16386' to end of the file and save

10. Run 'sysctl -p' effect the changes. Make sure the parameter and values are same as recommended

[root@bo3udsmsxodb01 ~]# sysctl -p
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
vm.nr_hugepages = 16386

11. You can verify whether HugePages are created now

[root@bo3udsmsxodb01 ~]# grep Huge /proc/meminfo
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:   16386
HugePages_Free:    16386
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:        33558528 kB


Reference

Oracle Linux: Shell Script to Calculate Values Recommended Linux HugePages / HugeTLB Configuration (Doc ID 401749.1)

Sunday, January 1, 2023

ORA-65140: invalid common profile name

Problem

Following Error occur while create new profile

SQL> Create profile ords_profile limit PASSWORD_LIFE_TIME unlimited;
Create profile ords_profile limit PASSWORD_LIFE_TIME unlimited
               *
ERROR at line 1:
ORA-65140: invalid common profile name;
Cause

Try to create profile by loging to the CDB when you should be logged into a PDB.

Solution

You can create profile when login to Pluggable database (PDB) instead of login to Container Database (CDB). If you want to continue from CDB, Please follow the step below

SQL> alter session set "_oracle_script"=true;

Session altered.
SQL> Create profile ords_profile limit PASSWORD_LIFE_TIME unlimited;

Profile created.
SQL> alter user ORDS_PUBLIC_USER profile ords_profile;

User altered.

Tuesday, September 20, 2022

Apex Loading Failed - 503 Service Unavailable or 404 Page not Found

Problem

When try to access Apex via URL 'https:/localhost/ords/pdb1' , following error occurred. 

404 Not found error with detail - The request could not be mapped to any database

The following errors may be seen in the web server related logs

ORA-01017: invalid username/password; logon denied (Associate with the HTTP-403 error.)

Cause

Either one of DB user APEX_PUBLIC_USER, APEX_LISTENER, APEX_REST_PUBLIC_USER, ORDS_PUBLIC_USER expired due to No non-expiry profile exist for the db user accounts

Cause

1. Connect to the container database follow the steps

SQL> ALTER SESSION SET container = CDB$ROOT;
SQL> select account_status from dba_users where username='ORDS_PUBLIC_USER';
SQL> Alter user ords_public_user identified by 'xxxx';
SQL> Alter user ords_public_user account unlock;

2. Connect to pluggable database and perform following steps

SQL> ALTER SESSION SET container = PDB1;
SQL> Alter user APEX_PUBLIC_USER identified by xxxx;
SQL> Alter user APEX_REST_PUBLIC_USER identified by xxxx;
SQL> Alter user APEX_LISTENER identified by xxxx;
SQL> ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
SQL> ALTER USER APEX_REST_PUBLIC_USER ACCOUNT UNLOCK;
SQL> ALTER USER APEX_LISTENER ACCOUNT UNLOCK;

3. Create profile and assign to users from Pluggable database

SQL> ALTER SESSION SET container = PDB1;
SQL> Create profile apex_public_profile limit password_life_time unlimited;
SQL> alter user apex_public_user profile apex_public_profile;
SQL> alter user apex_rest_public_user profile apex_public_profile;
SQL> alter user apex_listener profile apex_public_profile;
SQL> alter user ords_public_user profile apex_public_profile;

4. Restart ORDS

[root@wcsprd ~]# /etc/init.d/ords restart 
OR
[root@wcsprd ~]# /u01/app/oracle/product/ords/ords stop
[root@wcsprd ~]# /u01/app/oracle/product/ords/ords start
Reference

APEX Unavailable After the Expiration of the APEX_PUBLIC_USER Password - 503 Service Unavailable or 404 Page not Found (Doc ID 2058706.1)

Stop / Kill Datapump Job (EXPDP and IMPDP)

1. Check the datapump job status

SQL> select * from dba_datapump_jobs;
                      
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
---------- ---------- ---------- ---------- ---------- ---
SYS SYS_EXPORT_FULL_01 EXPORT FULL NOT RUNNING 		0		0		0

2. Attach the job which need to kill

[oracle@dporadb01 dba]$ expdp \"/ as sysdba\" attach=SYS_EXPORT_FULL_01
Export: Release 12.1.0.2.0 - Production on Wed Mar 23 10:37:01 2022

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit                                                                                         Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt                                                                                        ions

Job: SYS_EXPORT_FULL_01
  Owner: SYS
  Operation: EXPORT
  Creator Privs: TRUE
  GUID: DAD2C6D266D0A795E0530D19020A2BD5
  Start Time: Wednesday, 23 March, 2022 10:37:02
  Mode: FULL
  Instance: finres
  Max Parallelism: 4
  Timezone: +10:00
  Timezone version: 18
  Endianness: LITTLE
  NLS character set: US7ASCII
  NLS NCHAR character set: AL16UTF16
  EXPORT Job Parameters:
  Parameter Name      Parameter Value:
     CLIENT_COMMAND        "/******** AS SYSDBA" full=y directory=DBA_DUMP_DIR d                                                                                        umpfile=expdp_ussprd_20220321_%U.dmp logfile=expdp_ussprd.log parallel=4
  State: IDLING
  Bytes Processed: 1,466,272,712
  Percent Done: 3
  Current Parallelism: 4
  Job Error Count: 0
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_%u.dmp
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_01.dmp
    bytes written: 2,988,707,840
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_02.dmp
    bytes written: 139,264

Worker 1 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW00
  State: UNDEFINED
  Object Schema: SYS
  Object Name: TSDP_POLICY$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
  Completed Objects: 1
  Worker Parallelism: 1

Worker 2 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW01
  State: UNDEFINED
  Object Schema: SYS
  Object Name: AUD$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
  Completed Objects: 1
  Total Objects: 41
  Completed Rows: 3,212,545
  Completed Bytes: 2,044,985,344
  Percent Done: 6
  Worker Parallelism: 1

Worker 3 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW02
  State: UNDEFINED
  Object Schema: K2
  Object Name: UNIT_OFFERING_ENROL_20210401
  Object Type: DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
  Completed Objects: 7
  Total Objects: 3,241
  Completed Rows: 2,456,997
  Completed Bytes: 288,557,936
  Percent Done: 85
  Worker Parallelism: 1

3. Check the status

Export> status

Job: SYS_EXPORT_FULL_01
  Operation: EXPORT
  Mode: FULL
  State: IDLING
  Bytes Processed: 1,466,272,712
  Percent Done: 3
  Current Parallelism: 4
  Job Error Count: 0
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_%u.dmp
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_01.dmp
    bytes written: 2,988,707,840
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_02.dmp
    bytes written: 139,264

Worker 1 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW00
  State: UNDEFINED
  Object Schema: SYS
  Object Name: TSDP_POLICY$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
  Completed Objects: 1
  Worker Parallelism: 1

Worker 2 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW01
  State: UNDEFINED
  Object Schema: SYS
  Object Name: AUD$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
  Completed Objects: 1
  Total Objects: 41
  Completed Rows: 3,212,545
  Completed Bytes: 2,044,985,344
  Percent Done: 6
  Worker Parallelism: 1

Worker 3 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW02
  State: UNDEFINED
  Object Schema: K2
  Object Name: UNIT_OFFERING_ENROL_20210401
  Object Type: DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
  Completed Objects: 7
  Total Objects: 3,241
  Completed Rows: 2,456,997
  Completed Bytes: 288,557,936
  Percent Done: 85
  Worker Parallelism: 1

4. Kill Attached job

Export> kill_JOB
Are you sure you wish to stop this job ([yes]/no): yes

5. Check the datapump job status again to verify

SQL> select * from dba_datapump_jobs;
                      
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
---------- ---------- ---------- ---------- ---------- ---

Wednesday, September 7, 2022

Silent Installation- Oracle 19c Database

    Install Database Software only

    1. Install preinstall package for Oracle 19c
    2. yum install -y oracle-database-preinstall-19c
    3. If you using RHEL8, then retreive RPM's from repository as follows
    4. curl -o oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
      
      yum -y localinstall oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
    5. Download oracle 19c database software
    6. https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html
    7. Copy downloaded file to the server and unzip under oracle_home
    8. cd /u01/app/oracle/product/19.0.0/dbhome_1
      cp ~/V982063-01.zip .
      unzip V982063-01.zip
    9. Backup existing response file
    10. cd /u01/app/oracle/product/19.0.0/db_1/install/response
      cp db_install.rsp db_install.rsp_bkp
    11. Modify Response file as below
    12. [oracle@ip-10-82-109-39 ~]$ cat /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
      
      oracle.install.option=INSTALL_DB_SWONLY
      UNIX_GROUP_NAME=dba
      INVENTORY_LOCATION=/u01/app/oraInventory
      ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
      ORACLE_BASE=/u01/app/oracle
      oracle.install.db.InstallEdition=EE
      oracle.install.db.OSDBA_GROUP=dba
      oracle.install.db.OSOPER_GROUP=dba
      oracle.install.db.OSBACKUPDBA_GROUP=dba
      oracle.install.db.OSDGDBA_GROUP=dba
      oracle.install.db.OSKMDBA_GROUP=dba
      oracle.install.db.OSRACDBA_GROUP=dba
      oracle.install.db.rootconfig.executeRootScript=false
    13. To avoid bug '[INS-08101] Unexpected error while executing the action at state: 'supportedOSCheck'' in Oracle 19c on RHEL8
    14. export CV_ASSUME_DISTID=OEL7.8
    15. Install Pre-requisites to check any errors
    16. [oracle@ip-10-82-109-14 dbhome_1]$ ./runInstaller -executePrereqs -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
    17. Install DB software as silent mode
    18. [oracle@ip-10-82-109-14 dbhome_1]$ ./runInstaller -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
    19. Execute root.sh from root user
    20. [root@ip-10-82-109-14 dbhome_1]$ /u01/app/oraInventory/orainstRoot.sh
      [root@ip-10-82-109-14 dbhome_1]$ /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
    21. Verify the Installation

    Create Database

    1. Modify Response file accordingly
    2. vi /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/dbca.rsp
    3. Modify template file as per the requirement
    4. vi /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/templates/New_Database.dbt
    5. Create Database using response and template (template file use within response file)
    6.  cd /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca
       dbca -createDatabase -silent -responseFile ./dbca.rsp
    7. Configure Listener (listener and tns entries) after the DB creation
    8.  cd /u01/app/oracle/product/19.0.0/dbhome_1/network/admin
       vi tnsnames.ora
       vi listener.ora

Tuesday, August 2, 2022

IMPDP Error - ORA-04031: unable to allocate shared memory

Problem

Following Error Occurred during the datapump import

Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
ORA-39097: Data Pump job encountered unexpected error -4031
ORA-39065: unexpected master process exception in MAIN
ORA-04031: unable to allocate 40 bytes of shared memory ("shared pool","select t.ts#,t.file#,t.block...","SQLA^b52a5f10","idndef : qcuAllocIdn")
ORA-39014: One or more workers have prematurely exited.
ORA-39029: worker 1 with process name "DW00" prematurely terminated
ORA-31671: Worker process DW00 had an unhandled exception.
ORA-04031: unable to allocate 272 bytes of shared memory ("shared pool","SELECT /*+all_rows*/ SYS_XML...","SQLA^896032bf","kccdef: qkxrMemAlloc")
ORA-06512: at "SYS.KUPW$WORKER", line 2144
ORA-06512: at line 2
ORA-04031: unable to allocate 40 bytes of shared memory ("shared pool","select t.ts#,t.file#,t.block...","SQLA^b52a5f10","idndef : qcuAllocIdn")

Solution

If the large pool is not large enough, then you get an error ORA-4031 in the large pool.  The issue is generated because the dm00 process is running out space in the large pool

1. Increase the Large pool in parameter file

SQL> alter system set large_pool_size=64m scope=spfile;

System altered.

2. Restart database to effect the parameter changes

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  838860800 bytes
Fixed Size                  2929936 bytes
Variable Size             432016112 bytes
Database Buffers          369098752 bytes
Redo Buffers               34816000 bytes
Database mounted.
Database opened.

Reference

DataPump Import (IMPDP) Fails With Errors ORA-39097 ORA-39065 ORA-56937 (Doc ID 1471910.1)

Monday, August 1, 2022

Change DB name using nid utility

1.  Mount the Database
SQL> startup mount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 6442448976 bytes
Fixed Size                  8910928 bytes
Variable Size            2030043136 bytes
Database Buffers         4378853376 bytes
Redo Buffers               24641536 bytes
Database mounted.
2.  Execute nid utility to with new DB name
[oracle@ofprim ~]$  nid target= / dbname=test

DBNEWID: Release 19.0.0.0.0 - Production on Tue Aug 2 00:17:22 2022

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to database PRDDB (DBID=3869830090)

Connected to server version 19.12.0

Control Files in database:
    +RECO/TEST_SYD1MQ/CONTROLFILE/current.309.1095468811

Change database ID and database name PRDDB to TEST? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 3869830090 to 3502387348
Changing database name from PRDDB to TEST
    Control File +RECO/TEST_SYD1MQ/CONTROLFILE/current.309.1095468811 - modified
    Datafile +DATA/TEST_SYD1MQ/DATAFILE/system.586.111161509 - dbid changed, wrote new name
    Datafile +DATA/TEST_SYD1MQ/DATAFILE/data1.498.111160622 - dbid changed, wrote new name
    Datafile +DATA/TEST_SYD1MQ/DATAFILE/indx_large.500.111160622 - dbid changed, wrote new name
    Datafile +DATA/TEST_SYD1MQ/DATAFILE/tools.351.111161899 - dbid changed, wrote new name
    Datafile +DATA/TEST_SYD1MQ/DATAFILE/undotbs.458.111161936 - dbid changed, wrote new name
    Datafile +DATA/TEST_SYD1MQ/DATAFILE/sysaux.448.111161920 - dbid changed, wrote new name
    Datafile +DATA/TEST_SYD1MQ/TEMPFILE/temp.490.111162268 - dbid changed, wrote new name
    Control File +RECO/TEST_SYD1MQ/CONTROLFILE/current.309.1095468811 - dbid changed, wrote new name
    Instance shut down

Database name changed to TEST.
Modify parameter file and generate a new password file before restarting.
Database ID for database TEST changed to 3502387348.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
3.  Change db_name from parameter file
[oracle@ofprim ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 2 00:17:58 2022
Version 19.12.0.0.0

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

Connected to an idle instance.

SQL> startup nomount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 6442448976 bytes
Fixed Size                  8910928 bytes
Variable Size            2030043136 bytes
Database Buffers         4378853376 bytes
Redo Buffers               24641536 bytes
SQL> alter system set db_name=testt scope=spfile;

System altered.

SQL> shutdown immediate;
ORA-01507: database not mounted;
ORACLE instance shut down.
4.  Open DB with resetlogs option
SQL> startup mount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 6442448976 bytes
Fixed Size                  8910928 bytes
Variable Size            2030043136 bytes
Database Buffers         4378853376 bytes
Redo Buffers               24641536 bytes
Database mounted.
SQL> alter database open resetlogs;

Database altered.