Thursday, July 29, 2021

Jul – 2021 Patch Release Information - Jul 2021 CPU and PAD Documentation

Critical Patch Update (CPU) Program Jul 2021 Patch Availability Document (PAD) (Doc ID 2773670.1) 

Login to oracle support / MOS portal and search for required Patches or Jul 2021 Patch Availability Document (PAD) or Jul 2021 CPU

https://support.oracle.com/

Example:
Critical Patch Update (CPU) Program Jul 2021 Patch Availability Document (PAD) (Doc ID 2773670.1)

Previous CPU:

Critical Patch Update (CPU) Program Jan 2021 Patch Availability Document (PAD) (Doc ID 2725756.1)
Critical Patch Update (CPU) Program Apr 2021 Patch Availability Document (PAD) (Doc ID 2749094.1)


Oracle will release patches on quarterly.

Q1 - Jan
Q2 - Apr
Q3 - Jul
Q4 - Oct

Go to section 3 on the above document
     - Patch Availability for Oracle Products
         - This section contains the following:

·        Section 3.1 "Oracle Database"
·        Section 3.2 "Oracle Enterprise Manager"
·        Section 3.3 "Oracle Fusion Middleware"
·        Section 3.4 "Oracle Sun Middleware"
·        Section 3.5 "Tools"
 
Go to section 3.1 on the above list
     - 3.1.4 Oracle Database
         - This section contains the following:

19c Patch Details:

Patch 32895426 – GI
Patch 32904851 – DB
Patch 32876380 – OJVM
Patch 32900021 – DB+OJVM
 

12.2 Patch Details:

Patch 32916808 – DB
Patch 32928749 – GI
Patch 32876409 – OJVM
Patch 32900144 – DB+OJVM
 

12.1 Patch Details:

Patch 32917362 – DB
Patch 32917447 – GI
Patch 32876425 – OJVM
Patch 32900201 – DB+OJVM

 
Regards,
Mallik

Sunday, July 18, 2021

DROP ASM Instance using asmca or servctl - How to Delete ASM from Clusterware & GI Home Cleanup?

DROP ASM Instance || servctl remove asm || How to Delete ASM from Clusterware? || GI Home Cleanup


Below are high level steps for drop ASM/DB and cleanup GI Home and Oracle Home:

Steps:

1. Verify the running ASM and Database details:
2. Drop database using dbca:
3. Verify the database dropped and cleanup done:
4. Deinstall Oracle Home :
5. Verify the Oracle Home is cleaned up:
6. Drop or delete ASM instance:
7. Deinstall ASM Clusterware Home:
8. Verify the GI Home is cleaned up:

1. Verify the running ASM and Database details:

[root@oraclelab3 ~]# ps -ef|grep smon
root      3809  3735  0 08:41 pts/1    00:00:00 grep --color=auto smon
oracle    7634     1  0 Jul16 ?        00:00:02 ora_smon_UATDB
oracle   17624     1  0 Jul15 ?        00:00:03 asm_smon_+ASM
[root@oraclelab3 ~]#

[root@oraclelab3 ~]#su - oracle
[oracle@oraclelab3]$ . oraenv
ORACLE_SID = [oracle] ? +UATDB
The Oracle base has been set to /u01/app/oracle
[oracle@oraclelab3]$

2. Drop database using dbca:

[oracle@oraclelab3]$dbca
>>> follow the GUI screen to proceed further and deinstall database

check the reinstall log on the below cfgtoollogs directory:

[root@oraclelab3 ~]# cd /u01/app/oracle/cfgtoollogs/
[root@oraclelab3 cfgtoollogs]# ll
total 12
drwxr-x---. 2 oracle oinstall 4096 Jul 15 10:40 asmca
drwxr-x---. 4 oracle oinstall   72 Jul 18 08:53 dbca
drwxr-x---. 3 oracle oinstall   42 Jul 15 10:50 dbua
drwxrwx---. 2 oracle oinstall    6 Jul 15 09:29 mgmtca
drwxrwx---. 2 oracle oinstall    6 Jul 15 09:29 mgmtua
drwxr-xr-x. 2 oracle oinstall 4096 Jul 15 09:30 netca
drwxrwx---. 2 oracle oinstall    6 Jul 15 10:40 restca
drwxr-x---. 5 oracle oinstall 4096 Jul 15 11:14 sqlpatch
[root@oraclelab3 cfgtoollogs]# cd dbca
[root@oraclelab3 dbca]# ll
total 828
drwxr-x---. 2 oracle oinstall   4096 Jul 18 08:53 DEVDB
-rw-r-----. 1 oracle oinstall 841440 Jul 15 09:44 trace.log_2021-07-15_09-42-23-AM
drwxr-x---. 2 oracle oinstall     27 Jul 18 08:53 UATDB
[root@oraclelab3 dbca]# 

3. Verify the database dropped and cleanup done:

Verify /etc/oratab

[root@oraclelab3 DEVDB]# su - oracle
Last login: Sun Jul 18 03:45:29 IST 2021
[oracle@oraclelab3 ~]$ cat /etc/oratab
#Backup file is  /u01/app/19.0.0.0/grid/srvm/admin/oratab.bak.oraclelab3.oracle line added by Agent
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/19.0.0.0/grid:N           # line added by Agent
[oracle@oraclelab3 ~]$

4. Deinstall Oracle Home :

[oracle@oraclelab3 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /u01/app/oraInventory/logs/

############ ORACLE DECONFIG TOOL START ############

######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##

Checking for existence of the Oracle home location /u01/app/oracle/product/19.0.0.0/dbhome_1
Oracle Home type selected for deinstall is: Oracle Single Instance Database
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory

## [END] Install check configuration ##

Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2021-07-18_08-56-09AM.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2021-07-18_08-56-09AM.log

Use comma as separator when specifying list of values as input

Specify the list of database names that are configured in this Oracle home []:
Database Check Configuration END

######################### DECONFIG CHECK OPERATION END #########################

####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Home selected for deinstall is: /u01/app/oracle/product/19.0.0.0/dbhome_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08-56-08-AM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2021-07-18_08-56-09AM.log

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2021-07-18_08-56-09AM.log

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring Local Net Service Names configuration file...
Local Net Service Names configuration file de-configured successfully.

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

######################### DECONFIG CLEAN OPERATION END #########################

####################### DECONFIG CLEAN OPERATION SUMMARY #######################
#######################################################################

############# ORACLE DECONFIG TOOL END #############

Using properties file /tmp/deinstall2021-07-18_08-55-52AM/response/deinstall_2021-07-18_08-56-08-AM.rsp
Location of logs /u01/app/oraInventory/logs/

############ ORACLE DEINSTALL TOOL START ############

####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08-56-08-AM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to oraclelab3
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2021-07-18_08-55-52AM/oraInst.loc
Setting oracle.installer.local to false

## [END] Preparing for Deinstall ##

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/u01/app/oracle/product/19.0.0.0/dbhome_1' from the central inventory on the local node : Done

Delete directory '/u01/app/oracle/product/19.0.0.0/dbhome_1' on the local node : Done

The Oracle Base directory '/u01/app/oracle' will not be removed on local node. The directory is in use by Oracle Hom

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END

## [START] Oracle install clean ##

## [END] Oracle install clean ##

######################### DEINSTALL CLEAN OPERATION END #########################

####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/oracle/product/19.0.0.0/dbhome_1' from the central inventory on the loca
Successfully deleted directory '/u01/app/oracle/product/19.0.0.0/dbhome_1' on the local node.
Oracle Universal Installer cleanup was successful.

Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'oraclelab3'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

############# ORACLE DEINSTALL TOOL END #############

[oracle@oraclelab3 ~]$ 

5. Verify the Oracle Home is cleaned up:

Verify /u01/app/oraInventory/ContentsXML/inventory.xml

[oracle@oraclelab3 ~]$ cd /u01/app/oracle/product/19.0.0.0/
[oracle@oraclelab3 19.0.0.0]$ ll
total 0
[oracle@oraclelab3 19.0.0.0]$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
[oracle@oraclelab3 19.0.0.0]$ cd /u01/app/oraInventory
[oracle@oraclelab3 oraInventory]$ ll
total 8
drwxrwx---. 9 oracle oinstall 4096 Jul 18 08:56 backup
drwxrwx---. 2 oracle oinstall   81 Jul 15 10:49 ContentsXML
drwxrwx---. 6 oracle oinstall 4096 Jul 18 08:56 logs
drwxrwx---. 2 oracle oinstall   22 Jul 15 09:36 oui
[oracle@oraclelab3 oraInventory]$ cd ContentsXML
[oracle@oraclelab3 ContentsXML]$ ll
total 16
-rw-rw----. 1 oracle oinstall 300 Jul 18 08:56 comps.xml
-rw-rw----. 1 oracle oinstall 663 Jul 18 08:56 inventory.xml
-rw-rw----. 1 oracle oinstall 292 Jul 18 08:56 libs.xml
-rw-rw----. 1 oracle oinstall 174 Jul 15 10:49 oui-patch.xml
[oracle@oraclelab3 ContentsXML]$

[oracle@oraclelab3 ContentsXML]$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2021, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>12.2.0.7.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="3" CRS="true"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2" REMOVED="T"/>
<HOME NAME="OraGI12Home1" LOC="/u01/app/12.2.0.1/grid" TYPE="O" IDX="1" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
[oracle@oraclelab3 ContentsXML]$

6. Drop or delete ASM instance:

[oracle@oraclelab3 12.2.0.1]$ . oraenv
ORACLE_SID = [oracle] ? +ASM
The Oracle base has been set to /u01/app/oracle

[oracle@oraclelab3 12.2.0.1]$ srvctl remove asm -force

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   12398  8016  0 09:00 pts/1    00:00:00 grep --color=auto smon
oracle   17624     1  0 Jul15 ?        00:00:03 asm_smon_+ASM

[oracle@oraclelab3 12.2.0.1]$ srvctl config ASM
PRCR-1001 : Resource ora.asm does not exist >>>>>>>>>>>>>>>>>>>>>>>>> ASM got removed from the clusterware

[oracle@oraclelab3 12.2.0.1]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       oraclelab3               STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       oraclelab3               STABLE
ora.RECO.dg
               OFFLINE OFFLINE      oraclelab3               STABLE
ora.ons
               OFFLINE OFFLINE      oraclelab3               STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       oraclelab3               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       oraclelab3               STABLE
--------------------------------------------------------------------------------
[oracle@oraclelab3 12.2.0.1]$

Connect to ASM and verify the password and spfile:

[oracle@oraclelab3 12.2.0.1]$ . oraenv
ORACLE_SID = [+ASM] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/19.0.0.0/grid
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@oraclelab3 12.2.0.1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 18 09:01:42 2021
Version 19.3.0.0.0

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

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> 
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/ASM/ASMPARAMETERFILE/registry.253.1077960677
SQL> 

Connect to asmcmd and verify the password and spfile:

[oracle@oraclelab3 12.2.0.1]$ asmcmd -p
ASMCMD [+] > cd +DATA/ASM
ASMCMD [+DATA/ASM] > ls
ASMPARAMETERFILE/
PASSWORD/
ASMCMD [+DATA/ASM] > cd PASSWORD/
ASMCMD [+DATA/ASM/PASSWORD] > ls
pwdasm.256.1077960677
ASMCMD [+DATA/ASM/PASSWORD] > ls -l
Type      Redund  Striped  Time             Sys  Name
PASSWORD  UNPROT  COARSE   JUL 15 09:00:00  Y    pwdasm.256.1077960677
ASMCMD [+DATA/ASM/PASSWORD] > pwd
+DATA/ASM/PASSWORD
ASMCMD [+DATA/ASM/PASSWORD] > exit
[oracle@oraclelab3 12.2.0.1]$

[oracle@oraclelab3 12.2.0.1]$ srvctl config asm
PRCR-1001 : Resource ora.asm does not exist >>>>>>>>>>>>>>>>>>> Since we removed it from cluster so srvctl command will not work 
[oracle@oraclelab3 12.2.0.1]$

Try to delete ASM instance now which will fail with syntax error:

[oracle@oraclelab3 12.2.0.1]$ asmca -silent -deleteASM –sysAsmPassword +DATA/ASM/PASSWORD/pwdasm.256.1077960677 -for

The command line is not formed properly. Type "asmca -h" to get the command line syntax.

[oracle@oraclelab3 12.2.0.1]$

We will reconfigure ASM Instance and add ASM Instance back to Cluster:

[oracle@oraclelab3 12.2.0.1]$ srvctl add asm -pwfile +DATA/ASM/PASSWORD/pwdasm.256.1077960677
[oracle@oraclelab3 12.2.0.1]$ srvctl config ASM
ASM home: <CRS home>
Password file: +DATA/ASM/PASSWORD/pwdasm.256.1077960677
Backup of Password file:
ASM listener: LISTENER
Spfile:
ASM diskgroup discovery string: ++no-value-at-resource-creation--never-updated-through-ASM++
[oracle@oraclelab3 12.2.0.1]$

Try to delete ASM Instance now using below command:

[oracle@oraclelab3 12.2.0.1]$ asmca -silent -deleteASM
Are you sure you want to delete the ASM instance (Y/N)? y

ASM instance deleted successfully. Check /u01/app/oracle/cfgtoollogs/asmca/asmca-210718AM091240.log for details.

[oracle@oraclelab3 12.2.0.1]$

Verify the logs:

============
[oracle@oraclelab3 12.2.0.1]$ more /u01/app/oracle/cfgtoollogs/asmca/asmca-210718AM091240.log
[main] [ 2021-07-18 09:12:40.624 IST ] [InventoryUtil.getOUIInvSession:349]  setting OUI READ level to ACCESSLEVEL_R
[main] [ 2021-07-18 09:12:40.624 IST ] [InventoryUtil.isCRSHome:386]  Homeinfo /u01/app/19.0.0.0/grid,3
[main] [ 2021-07-18 09:12:40.896 IST ] [HASContext.<init>:128]  moduleInit = 7
[main] [ 2021-07-18 09:12:40.896 IST ] [Library.load:205]  library.load
..............................
..............................
..............................
[main] [ 2021-07-18 09:12:41.776 IST ] [RuntimeExec.runCommand:323]  RunTimeExec: error>
[main] [ 2021-07-18 09:12:41.777 IST ] [RuntimeExec.runCommand:349]  Returning from RunTimeExec.runCommand
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1536]  retval =  0
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1537]  exitval =  0
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1538]  rtErrLength =  0
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1526]  OS Name is...Linux
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.enforceEnglishVars:1721]  Set environment for English language
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.enforceEnglishVars:1722]  OS Name is...Linux
[oracle@oraclelab3 12.2.0.1]$ 

Verify that ASM Instance has dropped:

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   16201  8016  0 09:13 pts/1    00:00:00 grep --color=auto smon
[oracle@oraclelab3 12.2.0.1]$

7. Deinstall ASM Clusterware Home:

Issue 1:
========
Deinstall ASM Clusterware Home failed due to ASM Instance started back using local pfile and not allowed us to create ASM spfile:

Error message cab eb found on the log file:

[oracle@oraclelab3 12.2.0.1]$ env |grep ORA
ORACLE_SID=+ASM
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/19.0.0.0/grid
[oracle@oraclelab3 12.2.0.1]$

[oracle@oraclelab3 12.2.0.1]$ /u01/app/19.0.0.0/grid/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2021-07-18_09-13-37AM/logs/

############ ORACLE DECONFIG TOOL START ############

######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##

Checking for existence of the Oracle home location /u01/app/19.0.0.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/19.0.0.0/grid

## [END] Install check configuration ##

Traces log file: /tmp/deinstall2021-07-18_09-13-37AM/logs//crsdc_2021-07-18_09-13-50-AM.log

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/netdc_check2021-07-18_09-13-5

Specify all Oracle Restart enabled listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/asmcadc_check2021-07-18_09-13-50A

ASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]: y
Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/19.0.0.0/grid.
ASM Diagnostic Destination : /u01/app/oracle
ASM Diskgroups : +DATA,+RECO
ASM diskstring : <Default>
Diskgroups will be dropped
De-configuring ASM will drop all the diskgroups and their contents at cleanup time. This will affect all of the datathat use this ASM instance(s).
 If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify byDo you  want to modify above information (y|n) [n]:
Database Check Configuration START

Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/databasedc_check2021-07-18_0

Database Check Configuration END

######################### DECONFIG CHECK OPERATION END #########################

####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/19.0.0.0/grid
Oracle Home selected for deinstall is: /u01/app/19.0.0.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
ASM instance will be de-configured from this Oracle home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2021-07-18_09-13-37AM/logs/deinstall_deconfig2021-07-18_09-
Any error messages from this session will be written to: '/tmp/deinstall2021-07-18_09-13-37AM/logs/deinstall_deconfi13-49-AM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/databasedc_clean2021-07-18_0
ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/asmcadc_clean2021-07-18_09-13-50A
ASM Clean Configuration START
ERROR: Exception while creating local spfile for ASMORA-29786: Oracle Restart attribute GET failed with error [Attrits[200] lsts[0]]

Exited from program.

############# ORACLE DECONFIG TOOL END #############

[oracle@oraclelab3 12.2.0.1]$

Logfile:

[oracle@oraclelab3 ~]$ more /tmp/deinstall2021-07-18_09-13-37AM/logs/asmcadc_clean2021-07-18_09-13-50AM.log
[main] [ 2021-07-18 09:15:44.686 IST ] [USMCleanConfig.cleanConfigInternal:293]  DC home value /tmp/deinstall2021-07
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:713]  ORACLE_HOME=/u01/app/19.0.0.0/grid
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:714]  ORACLE_BASE=/u01/app/oracle
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:715]  ORACLE_SID=+ASM
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:716]  ORA_CRS_HOME=null
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:717]  PATH=/usr/local/bin:/bin:/usr/bin:/usr/local
:/home/oracle/.local/bin:/home/oracle/bin:/u01/app/19.0.0.0/grid/bin
........................
........................
........................
[main] [ 2021-07-18 09:15:52.842 IST ] [OracleHome.getVersion:1182]  /u01/app/19.0.0.0/grid/bin/sqlplus Banner:

SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1200]  Current version from sqlplus: 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1066]  OracleHome.getVersion called.  Current Version:
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1134]  Current Version From Inventory: 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1066]  OracleHome.getVersion called.  Current Version:
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1134]  Current Version From Inventory: 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLPlusEngine.getCmmdParams:226]  m_home 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLPlusEngine.getCmmdParams:227]  version > 112 true
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLEngine.getEnvParams:619]  Default NLS_LANG: AMERICAN_AMERICA.AL32UTF8
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLEngine.getEnvParams:629]  NLS_LANG: AMERICAN_AMERICA.AL32UTF8
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLEngine.initialize:376]  Execing SQLPLUS/SVRMGR process...
[main] [ 2021-07-18 09:15:52.846 IST ] [SQLEngine.initialize:413]  m_bReaderStarted: false
[main] [ 2021-07-18 09:15:52.846 IST ] [SQLEngine.initialize:417]  Starting Reader Thread...
[main] [ 2021-07-18 09:15:53.873 IST ] [ASMUtils.discoverASMClients:1017]  SQL select unique(db_name) from v$asm_cli
me != '+ASM'
[main] [ 2021-07-18 09:15:53.875 IST ] [SQLEngine.done:2362]  Done called
[main] [ 2021-07-18 09:15:53.876 IST ] [ASMUtils.discoverASMClients:1022]  SQFatalErrorException while retrieving AS
-01034: ORACLE not available

[main] [ 2021-07-18 09:15:53.876 IST ] [SQLEngine.done:2362]  Done called
[main] [ 2021-07-18 09:15:53.876 IST ] [USMCleanConfig.createSPFileLocal:1444]  SPFile is not yet localized
[main] [ 2021-07-18 09:15:53.876 IST ] [USMCleanConfig.createSPFileLocal:1446]  create temp spfile sql= create spfil
0.0.0/grid/dbs/spfile+ASM.ora' from memory
[main] [ 2021-07-18 09:15:53.965 IST ] [SQLEngine.done:2362]  Done called
[main] [ 2021-07-18 09:15:53.967 IST ] [USMCleanConfig.createSPFileLocal:1459]  ORA-29786: Oracle Restart attribute
 error [Attribute 'SPFILE' sts[200] lsts[0]]

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at oracle.install.db.deinstall.wrapper.Deinstall.callCleanImpl(Deinstall.java:1867)
        at oracle.install.db.deinstall.wrapper.Deinstall.main(Deinstall.java:907)
Caused by: oracle.ops.util.FatalException: Exception while creating local spfile for ASMORA-29786: Oracle Restart at
led with error [Attribute 'SPFILE' sts[200] lsts[0]]

        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.createSPFileLocal(USMCleanConfig.java:1460)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanSIHAASM(USMCleanConfig.java:541)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanCreateASM(USMCleanConfig.java:466)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanConfigInternal(USMCleanConfig.java:357)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanConfig(USMCleanConfig.java:248)
        ... 6 more
[oracle@oraclelab3 ~]$ 

Verify that ASM Instance started and running from local pfile:
Kill that ASM Instance manually

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   19571     1  0 09:15 ?        00:00:00 asm_smon_+ASM
oracle   19939  8016  0 09:17 pts/1    00:00:00 grep --color=auto smon

[oracle@oraclelab3 12.2.0.1]$ . oraenv
ORACLE_SID = [+ASM] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/19.0.0.0/grid
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab3 12.2.0.1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 18 09:18:12 2021
Version 19.3.0.0.0

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

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

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   19571     1  0 09:15 ?        00:00:00 asm_smon_+ASM
oracle   20046  8016  0 09:18 pts/1    00:00:00 grep --color=auto smon
[oracle@oraclelab3 12.2.0.1]$

[oracle@oraclelab3 12.2.0.1]$ kill -9 19571

Start Deinstall Clusterware home now:

[oracle@oraclelab3 12.2.0.1]$ /u01/app/19.0.0.0/grid/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2021-07-18_09-18-40AM/logs/

############ ORACLE DECONFIG TOOL START ############

######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##

Checking for existence of the Oracle home location /u01/app/19.0.0.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/19.0.0.0/grid

## [END] Install check configuration ##

Traces log file: /tmp/deinstall2021-07-18_09-18-40AM/logs//crsdc_2021-07-18_09-18-46-AM.log

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/netdc_check2021-07-18_09-18-4

Specify all Oracle Restart enabled listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/asmcadc_check2021-07-18_09-18-47A

ASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]: y
Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/19.0.0.0/grid.
ASM Diagnostic Destination : /u01/app/oracle
ASM Diskgroups : +DATA,+RECO
ASM diskstring : <Default>
Diskgroups will be dropped
De-configuring ASM will drop all the diskgroups and their contents at cleanup time. This will affect all of the datathat use this ASM instance(s).
 If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify byDo you  want to modify above information (y|n) [n]:
Database Check Configuration START

Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/databasedc_check2021-07-18_0

Database Check Configuration END

######################### DECONFIG CHECK OPERATION END #########################

####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/19.0.0.0/grid
Oracle Home selected for deinstall is: /u01/app/19.0.0.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
ASM instance will be de-configured from this Oracle home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfig2021-07-18_09-
Any error messages from this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfi18-45-AM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/databasedc_clean2021-07-18_0
ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/asmcadc_clean2021-07-18_09-18-47A
ASM Clean Configuration START
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/netdc_clean2021-07-18_09-18-4

De-configuring Oracle Restart enabled listener(s): LISTENER

De-configuring listener: LISTENER
    Stopping listener: LISTENER
    Listener stopped successfully.
    Unregistering listener: LISTENER
    Listener unregistered successfully.
    Deleting listener: LISTENER
    Listener deleted successfully.
Listener de-configured successfully.

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

---------------------------------------->

Run the following command as the root user or the administrator on node "oraclelab3".

/u01/app/19.0.0.0/grid/crs/install/roothas.sh -force  -deconfig -paramfile "/tmp/deinstall2021-07-18_09-18-40AM/respOraGI19Home1.rsp"

Press Enter after you finish running the above commands

<----------------------------------------

*********************************************************************************************
Take A new session and run the above command and come back here and hit enter
*********************************************************************************************
[root@oraclelab3 ~]# /u01/app/19.0.0.0/grid/crs/install/roothas.sh -force  -deconfig -paramfile "/tmp/deinstall2021-M/response/deinstall_OraGI19Home1.rsp"
Using configuration parameter file: /tmp/deinstall2021-07-18_09-18-40AM/response/deinstall_OraGI19Home1.rsp
The log of current session can be found at:
  /tmp/deinstall2021-07-18_09-18-40AM/logs/hadeconfig.log
2021/07/18 09:20:12 CLSRSC-337: Successfully deconfigured Oracle Restart stack
[root@oraclelab3 ~]#
*********************************************************************************************
*********************************************************************************************
######################### DECONFIG CLEAN OPERATION END #########################

####################### DECONFIG CLEAN OPERATION SUMMARY #######################
ASM instance was de-configured successfully from the Oracle home
Following Oracle Restart enabled listener(s) were de-configured successfully: LISTENER
Oracle Restart was already stopped and de-configured on node "oraclelab3"
Oracle Restart is stopped and de-configured successfully.
#######################################################################

############# ORACLE DECONFIG TOOL END #############

Using properties file /tmp/deinstall2021-07-18_09-18-40AM/response/deinstall_2021-07-18_09-18-45-AM.rsp
Location of logs /tmp/deinstall2021-07-18_09-18-40AM/logs/

############ ORACLE DEINSTALL TOOL START ############

####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfig2021-07-18_09-
Any error messages from this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfi18-45-AM.err'

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to oraclelab3
Setting CRS_HOME to true
Setting oracle.installer.invPtrLoc to /tmp/deinstall2021-07-18_09-18-40AM/oraInst.loc
Setting oracle.installer.local to false

## [END] Preparing for Deinstall ##

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/u01/app/19.0.0.0/grid' from the central inventory on the local node : Done

Delete directory '/u01/app/19.0.0.0/grid' on the local node : Done

Delete directory '/u01/app/oraInventory' on the local node : Done

Failed to delete the directory '/u01/app/oracle/tfa/oraclelab3/output/dbzip'. Either user has no permission to deletse.
Failed to delete the directory '/u01/app/oracle/tfa/oraclelab3/output/tracefiles'. Either user has no permission to  in use.
Failed to delete the directory '/u01/app/oracle/tfa/oraclelab3/diagnostics_to_collect'. Either user has no permissioit is in use.
The Oracle Base directory '/u01/app/oracle' will not be removed on local node. The directory is not empty. User needleanup this directory.

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END

## [START] Oracle install clean ##

## [END] Oracle install clean ##

######################### DEINSTALL CLEAN OPERATION END #########################

####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/19.0.0.0/grid' from the central inventory on the local node.
Successfully deleted directory '/u01/app/19.0.0.0/grid' on the local node.
Successfully deleted directory '/u01/app/oraInventory' on the local node.
Oracle Universal Installer cleanup was successful.

Run 'rm -r /etc/oraInst.loc' as root on node(s) 'oraclelab3' at the end of the session.

Run 'rm -r /opt/ORCLfmap' as root on node(s) 'oraclelab3' at the end of the session.
Run 'rm -r /etc/oratab' as root on node(s) 'oraclelab3' at the end of the session.
Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'oraclelab3'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

############# ORACLE DEINSTALL TOOL END #############

[oracle@oraclelab3 12.2.0.1]$

8. Verify the GI Home is cleaned up:

Verify the ASM home cleanup done and manually remove the forlders woned by root user:

[root@oraclelab3 ~]# rm -r /etc/oraInst.loc
rm: remove regular file ‘/etc/oraInst.loc’? y
[root@oraclelab3 ~]# rm -r /opt/ORCLfmap
rm: descend into directory ‘/opt/ORCLfmap’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64/bin’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/bin/fmputl’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/bin/fmputlhp’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/bin’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64/etc’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/etc/filemap.ora’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/etc’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/log’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64’? y
rm: remove directory ‘/opt/ORCLfmap’? y
[root@oraclelab3 ~]# rm -r /etc/oratab
rm: remove regular file ‘/etc/oratab’? y
[root@oraclelab3 ~]# cd /u01/app/oracle
[root@oraclelab3 oracle]# ll
total 4
drwxr-x---. 3 oracle oinstall   21 Jul 18 09:19 admin
drwxr-xr-x. 3 oracle oinstall   18 Jul 15 09:32 log
drwxr-x---. 2 oracle oinstall 4096 Jul 15 02:42 oradata
drwxr-xr-x. 5 root   root       79 Jul 15 09:39 tfa
[root@oraclelab3 oracle]# rm -rf tfa/
[root@oraclelab3 oracle]# rm -rf *
[root@oraclelab3 oracle]# cd ..
[root@oraclelab3 app]# ll
total 0
drwxr-xr-x. 2 oracle oinstall 6 Jul 16 08:20 12.2.0.1
drwxr-xr-x. 2 oracle oinstall 6 Jul 18 09:20 19.0.0.0
drwxr-xr-x. 2 oracle oinstall 6 Jul 18 09:22 oracle
[root@oraclelab3 app]# 
[root@oraclelab3 12.2.0.1]# cd ../19.0.0.0/
[root@oraclelab3 19.0.0.0]# ll
total 0
[root@oraclelab3 19.0.0.0]#

Regards,
Mallik

Friday, July 16, 2021

nid (DBNEWID) - Changing DBID and Changing DBNAME in Oracle

nid (DBNEWID) - Changing DBID and Changing DBNAME in Oracle


We can change the DBID and Database name using nid command. 

We will do below 3 demonstration
1. Changing Your Database Identifier (DBID) Only:
2. Changing Your Database Name (DBNAME) Only:
3. Changing Both Your Database Name and Database Identifier:

1. Changing Your Database Identifier (DBID) Only:

SELECT dbid, name FROM v$database;

SHUTDOWN IMMEDIATE

STARTUP MOUNT

nid TARGET=SYS/secure@<service_name>
nid TARGET=SYS/Mallik123@DEVDB

SHUTDOWN IMMEDIATE

orapwd file=orapw<SID> password=<your password> entries=
orapwd file=orapwDEVDB password=Mallik123 entries=5

STARTUP MOUNT;

ALTER DATABASE OPEN RESETLOGS;

SELECT dbid, name FROM v$database;

2. Changing Your Database Name (DBNAME) Only:

SELECT name FROM v$database;

SHUTDOWN IMMEDIATE

STARTUP MOUNT

nid TARGET=<username>/<password>@<servicename> DBNAME=<newname> SETNAME=YES
nid TARGET=SYS/Mallik123@DEVDB DBNAME=TESTDB SETNAME=YES

SHUTDOWN IMMEDIATE

Change the DB_NAME initialization parameter to your new database name.
mv init<DB_NAME>.ora init<NEW_NAME>.ora 

orapwd file=orapw<SID> password=<your password> entries=
orapwd file=orapwTESTDB password=Mallik123 entries=5

STARTUP

SELECT name FROM v$database;

3. Changing Both Your Database Name and Database Identifier:

SELECT dbid, name FROM v$database;

SHUTDOWN IMMEDIATE

STARTUP MOUNT

nid TARGET=<username>/<password>@<service name> DBNAME=<new name>
nid TARGET=SYS/Mallik123@TESTDB DBNAME=UATDB

SHUTDOWN IMMEDIATE

Change the DB_NAME initialization parameter to your new database name.
mv init<DB_NAME>.ora init<NEW_NAME>.ora 

orapwd file=orapw<SID> password=<your password> entries=
orapwd file=orapwUATDB password=Mallik123 entries=5

STARTUP MOUNT

ALTER DATABASE OPEN RESETLOGS;

SELECT name, dbid FROM v$database;

Output Logs:

1. Changing Your Database Identifier (DBID) Only:

[oracle@oraclelab3 ~]$ ps -ef|grep smon
oracle   17624     1  0 Jul15 ?        00:00:01 asm_smon_+ASM
oracle   20985     1  0 09:47 ?        00:00:00 ora_smon_DEVDB
oracle   24985 19618  0 11:48 pts/2    00:00:00 grep --color=auto smon
[oracle@oraclelab3 ~]$

[oracle@oraclelab3 ~]$ . oraenv
ORACLE_SID = [DEVDB] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab3 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 11:53:42 2021
Version 19.3.0.0.0

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

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

SQL> SELECT dbid, name FROM v$database;

      DBID NAME
---------- ---------
 982691568 DEVDB

SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> STARTUP MOUNT
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
SQL>

[oracle@oraclelab3 ~]$ nid TARGET=SYS/Mallik123@DEVDB

DBNEWID: Release 19.0.0.0.0 - Production on Fri Jul 16 11:55:53 2021

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

Connected to database DEVDB (DBID=982691568)

Connected to server version 19.3.0

Control Files in database:
    +DATA/DEVDB/CONTROLFILE/current.261.1077961585
    +RECO/DEVDB/CONTROLFILE/current.256.1077961585

Change database ID of database DEVDB? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 982691568 to 982765001
    Control File +DATA/DEVDB/CONTROLFILE/current.261.1077961585 - modified
    Control File +RECO/DEVDB/CONTROLFILE/current.256.1077961585 - modified
    Datafile +DATA/DEVDB/DATAFILE/system.257.107796146 - dbid changed
    Datafile +DATA/DEVDB/DATAFILE/sysaux.258.107796151 - dbid changed
    Datafile +DATA/DEVDB/DATAFILE/undotbs1.259.107796154 - dbid changed
    Datafile +DATA/DEVDB/DATAFILE/users.260.107796154 - dbid changed
    Datafile +DATA/DEVDB/TEMPFILE/temp.265.107796159 - dbid changed
    Control File +DATA/DEVDB/CONTROLFILE/current.261.1077961585 - dbid changed
    Control File +RECO/DEVDB/CONTROLFILE/current.256.1077961585 - dbid changed
    Instance shut down

Database ID for database DEVDB changed to 982765001.
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 ID.
DBNEWID - Completed succesfully.

[oracle@oraclelab3 ~]$

[oracle@oraclelab3 ~]$ ps -ef|grep smon
oracle   17624     1  0 Jul15 ?        00:00:01 asm_smon_+ASM
oracle   27579 19618  0 11:57 pts/2    00:00:00 grep --color=auto smon
[oracle@oraclelab3 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 11:57:13 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> ALTER DATABASE OPEN RESETLOGS;

Database altered.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclelab3 ~]$ cd $ORACLE_HOME
[oracle@oraclelab3 dbhome_1]$ cd dbs
[oracle@oraclelab3 dbs]$ ls -ltrh
total 20K
-rw-r--r--. 1 oracle oinstall 3.1K May 14  2015 init.ora
-rw-r-----. 1 oracle oinstall   24 Jul 15 10:54 lkDEVDB
-rw-r-----. 1 oracle oinstall 3.5K Jul 15 11:19 orapwDEVDB
-rw-r-----. 1 oracle oinstall  608 Jul 15 11:19 initDEVDB.ora
-rw-rw----. 1 oracle oinstall 1.6K Jul 16 11:58 hc_DEVDB.dat
[oracle@oraclelab3 dbs]$

Creation of password file is optional since the databas name is same, We have only changed the DBID:
[oracle@oraclelab3 dbs]$ orapwd file=orapwDEVDB password=Mallik123 entries=5 force=y

OPW-00029: Password complexity failed for SYS user : Password must contain at least 1 special character.
[oracle@oraclelab3 dbs]$ orapwd file=orapwDEVDB password=Mallik123! entries=5 force=y
[oracle@oraclelab3 dbs]$
[oracle@oraclelab3 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:00:00 2021
Version 19.3.0.0.0

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


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

SQL> SELECT dbid, name FROM v$database;

      DBID NAME
---------- ---------
 982765001 DEVDB

SQL> SELECT name FROM v$database;

NAME
---------
DEVDB

SQL>

2. Changing Your Database Name (DBNAME) Only:

[oracle@oraclelab3 ~]$ ps -ef|grep smon
oracle   17624     1  0 Jul15 ?        00:00:01 asm_smon_+ASM
oracle   20985     1  0 09:47 ?        00:00:00 ora_smon_DEVDB
oracle   24985 19618  0 11:48 pts/2    00:00:00 grep --color=auto smon
[oracle@oraclelab3 ~]$

[oracle@oraclelab3 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:00:00 2021
Version 19.3.0.0.0

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


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

SQL> SELECT dbid, name FROM v$database;

      DBID NAME
---------- ---------
 982765001 DEVDB

SQL> SELECT name FROM v$database;

NAME
---------
DEVDB

SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
SQL>
[oracle@oraclelab3 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:02:53 2021
Version 19.3.0.0.0

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

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

SQL>
SQL> alter database open;

Database altered.

SQL> alter user sys identified by Mallik123;

User altered.

SQL>
[oracle@oraclelab3 dbs]$ sqlplus sys/Mallik123@DEVDB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:04:01 2021
Version 19.3.0.0.0

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


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

SQL>
SQL> shut immediate;
Database closed.
Database dismounted.

ORACLE instance shut down.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Warning: You are no longer connected to ORACLE.
SQL> 
[oracle@oraclelab3 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:04:55 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclelab3 dbs]$ 

[oracle@oraclelab3 dbs]$ nid TARGET=SYS/Mallik123@DEVDB DBNAME=TESTDB SETNAME=YES

DBNEWID: Release 19.0.0.0.0 - Production on Fri Jul 16 12:05:30 2021

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

Connected to database DEVDB (DBID=982765001)

Connected to server version 19.3.0

Control Files in database:
    +DATA/DEVDB/CONTROLFILE/current.261.1077961585
    +RECO/DEVDB/CONTROLFILE/current.256.1077961585

Change database name of database DEVDB to TESTDB? (Y/[N]) => Y

Proceeding with operation
Changing database name from DEVDB to TESTDB
    Control File +DATA/DEVDB/CONTROLFILE/current.261.1077961585 - modified
    Control File +RECO/DEVDB/CONTROLFILE/current.256.1077961585 - modified
    Datafile +DATA/DEVDB/DATAFILE/system.257.107796146 - wrote new name
    Datafile +DATA/DEVDB/DATAFILE/sysaux.258.107796151 - wrote new name
    Datafile +DATA/DEVDB/DATAFILE/undotbs1.259.107796154 - wrote new name
    Datafile +DATA/DEVDB/DATAFILE/users.260.107796154 - wrote new name
    Datafile +DATA/DEVDB/TEMPFILE/temp.265.107796159 - wrote new name
    Control File +DATA/DEVDB/CONTROLFILE/current.261.1077961585 - wrote new name
    Control File +RECO/DEVDB/CONTROLFILE/current.256.1077961585 - wrote new name
    Instance shut down

Database name changed to TESTDB.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.

[oracle@oraclelab3 dbs]$ ls -ltrh
total 24K
-rw-r--r--. 1 oracle oinstall 3.1K May 14  2015 init.ora
-rw-r-----. 1 oracle oinstall   24 Jul 15 10:54 lkDEVDB
-rw-r-----. 1 oracle oinstall  608 Jul 15 11:19 initDEVDB.ora
-rw-r-----. 1 oracle oinstall 6.0K Jul 16 12:05 orapwDEVDB
-rw-rw----. 1 oracle oinstall 1.6K Jul 16 12:05 hc_DEVDB.dat
[oracle@oraclelab3 dbs]$ mv initDEVDB.ora initTESTDB.ora
[oracle@oraclelab3 dbs]$ mv orapwDEVDB orapwTESTDB
[oracle@oraclelab3 dbs]$ 

[oracle@oraclelab3 dbs]$ cat /etc/oratab
#Backup file is  /u01/app/oracle/crsdata/oraclelab3/output/oratab.bak.oraclelab3.oracle line added by Agent
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/19.0.0.0/grid:N           # line added by Agent
DEVDB:/u01/app/oracle/product/19.0.0.0/dbhome_1:N               # line added by Agent 

[oracle@oraclelab3 dbs]$ vi /etc/oratab >>> update the DB name from DEVDB to TESTDB

#Backup file is  /u01/app/oracle/crsdata/oraclelab3/output/oratab.bak.oraclelab3.oracle line added by Agent
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/19.0.0.0/grid:N           # line added by Agent
TESTDB:/u01/app/oracle/product/19.0.0.0/dbhome_1:N               # line added by Agent
[oracle@oraclelab3 dbs]$ . oraenv
ORACLE_SID = [TESTDB] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab3 dbs]$
[oracle@oraclelab3 dbs]$ env |grep ORA
ORACLE_SID=TESTDB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
[oracle@oraclelab3 dbs]$
[oracle@oraclelab3 dbs]$ ll
total 24
-rw-rw----. 1 oracle oinstall 1544 Jul 16 12:05 hc_DEVDB.dat
-rw-r--r--. 1 oracle oinstall 3079 May 14  2015 init.ora
-rw-r-----. 1 oracle oinstall  608 Jul 15 11:19 initTESTDB.ora
-rw-r-----. 1 oracle oinstall   24 Jul 15 10:54 lkDEVDB
-rw-r-----. 1 oracle oinstall 6144 Jul 16 12:05 orapwTESTDB
[oracle@oraclelab3 dbs]$ 

[oracle@oraclelab3 dbs]$ vi initTESTDB.ora >>>> Change db_name=TESTDB

[oracle@oraclelab3 dbs]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs
[oracle@oraclelab3 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:10:15 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL> SELECT name FROM v$database;

NAME
---------
TESTDB

SQL> SELECT dbid, name FROM v$database;

      DBID NAME
---------- ---------
 982765001 TESTDB

SQL> 

[oracle@oraclelab3 dbs]$ sqlplus sys/Mallik123@DEVDB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:13:20 2021
Version 19.3.0.0.0

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

Last Successful login time: Fri Jul 16 2021 12:05:30 +05:30

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

SQL> show parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      DEVDB
SQL>

[oracle@oraclelab3 dbs]$ cd ../network/admin/
[oracle@oraclelab3 admin]$ ll
total 12
drwxr-xr-x. 2 oracle oinstall   64 Apr 17  2019 samples
-rw-r--r--. 1 oracle oinstall 1536 Feb 14  2018 shrept.lst
-rw-r--r--. 1 oracle oinstall  125 Jul 16 09:36 sqlnet.ora
-rw-r-----. 1 oracle oinstall  447 Jul 15 11:19 tnsnames.ora
[oracle@oraclelab3 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_DEVDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = oraclelab3.localdomain.com)(PORT = 1521))


DEVDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclelab3.localdomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DEVDB)
    )
  )

[oracle@oraclelab3 admin]$ vi tnsnames.ora >>> chnage tnsnmae alias to TESTDB 

[oracle@oraclelab3 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_DEVDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = oraclelab3.localdomain.com)(PORT = 1521))


TESTDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclelab3.localdomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DEVDB)
    )
  )

[oracle@oraclelab3 admin]$
[oracle@oraclelab3 admin]$ sqlplus sys/Mallik123@TESTDB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:14:32 2021
Version 19.3.0.0.0

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

Last Successful login time: Fri Jul 16 2021 12:13:20 +05:30

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

SQL> SELECT dbid, name FROM v$database;

      DBID NAME
---------- ---------
 982765001 TESTDB

SQL> 
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Warning: You are no longer connected to ORACLE.
SQL> exit
[oracle@oraclelab3 admin]$

[oracle@oraclelab3 admin]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:15:43 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> STARTUP MOUNT
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
ORA-01103: database name 'TESTDB' in control file is not 'DEVDB'

SQL> shut immediate;
ORA-01507: database not mounted

ORACLE instance shut down.

SQL> 

Issue:

Since we have modify the DBNAME from DEVDB to TESTDB, we need recreate the spfile which is inside the ASM +DATA diskgroup

SQL> startup pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL>
SQL> create spfile from pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';

File created.

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

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
ORA-01103: database name 'TESTDB' in control file is not 'DEVDB'

SQL> shut immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL>

Issue:

We have to specify the spfile location otherwise it will not create the spfile inside the ASM +DATA diskgroup.

ASMCMD [+DATA/DEVDB] > cd PARAMETERFILE/
ASMCMD [+DATA/DEVDB/PARAMETERFILE] > ls -l
Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  Y    spfile.266.1077967163
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  Y    spfile.267.1078057127
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  N    spfileDEVDB.ora => +DATA/DEVDB/PARAMETERFILE/spfile.266.1077967163
ASMCMD [+DATA/DEVDB/PARAMETERFILE] > pwd
+DATA/DEVDB/PARAMETERFILE

SQL> startup pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL> create spfile='+DATA/DEVDB/PARAMETERFILE/spfileTESTDB.ora' from pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora';

File created.

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

ASMCMD [+DATA/DEVDB/PARAMETERFILE] > pwd
+DATA/DEVDB/PARAMETERFILE
ASMCMD [+DATA/DEVDB/PARAMETERFILE] > ls -l
Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  Y    spfile.266.1077967163
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  Y    spfile.267.1078057127
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  Y    spfile.268.1078057341
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  N    spfileDEVDB.ora => +DATA/DEVDB/PARAMETERFILE/spfile.266.1077967163
PARAMETERFILE  UNPROT  COARSE   JUL 16 12:00:00  N    spfileTESTDB.ora => +DATA/DEVDB/PARAMETERFILE/spfile.268.1078057341
ASMCMD [+DATA/DEVDB/PARAMETERFILE] >

[oracle@oraclelab3 dbs]$ cat initTESTDB.ora
undo_tablespace=UNDOTBS1
db_recovery_file_dest_size=8405385216
processes=300
pga_aggregate_target=808452096
dispatchers="(PROTOCOL=TCP) (SERVICE=DEVDBXDB)"
sga_target=2432696320
db_recovery_file_dest="+RECO"
db_block_size=8192
diagnostic_dest=/u01/app/oracle
audit_file_dest="/u01/app/oracle/admin/DEVDB/adump"
db_create_file_dest="+DATA"
compatible=12.2.0
control_files='+DATA/DEVDB/CONTROLFILE/current.261.1077961585','+RECO/DEVDB/CONTROLFILE/current.256.1077961585'
audit_trail=DB
db_name="TESTDB"
remote_login_passwordfile=EXCLUSIVE
open_cursors=300
db_unique_name="DEVDB"
local_listener=LISTENER_DEVDB
[oracle@oraclelab3 dbs]$

[oracle@oraclelab3 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:24:07 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/DEVDB/PARAMETERFILE/spfi
                                                 letestdb.ora
SQL> alter database mount;

Database altered.

SQL>

3. Changing Both Your Database Name and Database Identifier:

[oracle@oraclelab3 admin]$ sqlplus sys/Mallik123@TESTDB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:14:32 2021
Version 19.3.0.0.0

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

Last Successful login time: Fri Jul 16 2021 12:13:20 +05:30

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

SQL> SELECT dbid, name FROM v$database;

      DBID NAME
---------- ---------
 982765001 TESTDB

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/DEVDB/PARAMETERFILE/spfi
                                                 letestdb.ora
SQL>

[oracle@oraclelab3 dbs]$ nid TARGET=SYS/Mallik123@TESTDB DBNAME=UATDB

DBNEWID: Release 19.0.0.0.0 - Production on Fri Jul 16 12:25:17 2021

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

Connected to database TESTDB (DBID=982765001)

Connected to server version 19.3.0

Control Files in database:
    +DATA/DEVDB/CONTROLFILE/current.261.1077961585
    +RECO/DEVDB/CONTROLFILE/current.256.1077961585

Change database ID and database name TESTDB to UATDB? (Y/[N]) => y

Proceeding with operation
Changing database ID from 982765001 to 1542247341
Changing database name from TESTDB to UATDB
    Control File +DATA/DEVDB/CONTROLFILE/current.261.1077961585 - modified
    Control File +RECO/DEVDB/CONTROLFILE/current.256.1077961585 - modified
    Datafile +DATA/DEVDB/DATAFILE/system.257.107796146 - dbid changed, wrote new name
    Datafile +DATA/DEVDB/DATAFILE/sysaux.258.107796151 - dbid changed, wrote new name
    Datafile +DATA/DEVDB/DATAFILE/undotbs1.259.107796154 - dbid changed, wrote new name
    Datafile +DATA/DEVDB/DATAFILE/users.260.107796154 - dbid changed, wrote new name
    Datafile +DATA/DEVDB/TEMPFILE/temp.265.107796159 - dbid changed, wrote new name
    Control File +DATA/DEVDB/CONTROLFILE/current.261.1077961585 - dbid changed, wrote new name
    Control File +RECO/DEVDB/CONTROLFILE/current.256.1077961585 - dbid changed, wrote new name
    Instance shut down

Database name changed to UATDB.
Modify parameter file and generate a new password file before restarting.
Database ID for database UATDB changed to 1542247341.
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.

[oracle@oraclelab3 dbs]$

[oracle@oraclelab3 dbs]$ ll
total 28
-rw-rw----. 1 oracle oinstall 1544 Jul 16 12:05 hc_DEVDB.dat
-rw-rw----. 1 oracle oinstall 1544 Jul 16 12:25 hc_TESTDB.dat
-rw-r--r--. 1 oracle oinstall 3079 May 14  2015 init.ora
-rw-r-----. 1 oracle oinstall  610 Jul 16 12:10 initTESTDB.ora
-rw-r-----. 1 oracle oinstall   24 Jul 15 10:54 lkDEVDB
-rw-r-----. 1 oracle oinstall 6144 Jul 16 12:25 orapwTESTDB
[oracle@oraclelab3 dbs]$ mv initTESTDB.ora initUATDB.ora
[oracle@oraclelab3 dbs]$ vi initUATDB.ora >>> Chnage to db_name as UATDB

[oracle@oraclelab3 dbs]$ ll
total 28
-rw-rw----. 1 oracle oinstall 1544 Jul 16 12:05 hc_DEVDB.dat
-rw-rw----. 1 oracle oinstall 1544 Jul 16 12:25 hc_TESTDB.dat
-rw-r--r--. 1 oracle oinstall 3079 May 14  2015 init.ora
-rw-r-----. 1 oracle oinstall  609 Jul 16 12:26 initUATDB.ora
-rw-r-----. 1 oracle oinstall   24 Jul 15 10:54 lkDEVDB
-rw-r-----. 1 oracle oinstall 6144 Jul 16 12:25 orapwTESTDB

[oracle@oraclelab3 dbs]$ vi /etc/oratab >>> update the DB name from TESTDB to UATDB 

[oracle@oraclelab3 dbs]$ . oraenv
ORACLE_SID = [TESTDB] ? UATDB
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab3 dbs]$

[oracle@oraclelab3 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 16 12:27:17 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initUATDB.ora';
ORACLE instance started.

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> ALTER DATABASE OPEN RESETLOGS;

Database altered.

SQL>
SQL> create spfile='+DATA/DEVDB/PARAMETERFILE/spfileUATDB.ora' from pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initUATDB.ora';

File created.

SQL> SELECT name, dbid FROM v$database;

NAME            DBID
--------- ----------
UATDB     1542247341

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

Total System Global Area 2432695144 bytes
Fixed Size                  8899432 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/DEVDB/PARAMETERFILE/spfi
                                                 leuatdb.ora
SQL> 
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oraclelab3 dbs]$

Regards,
Mallik

Automation Script | Archivelog Generation Hourly Monitoring

1. List out all the running databases and pic one database where we want to monitore the archive log generation from last 1 month. [oracle@o...