STEP 1: Create blackout for the database
STEP 2: Take backup of spfile
SQL>
create pfile='/tmp/initORAPRIM.ora' from spfile;
File created.
STEP 3: stop database using srvctl utility
[oracle@oratest2 ~]$ srvctl stop database -d ORA_PRIM
[oracle@oratest2
~]$ srvctl status database -d ORA_PRIM
Instance
ORAPRIM1 is not running on node oratest2
Instance ORAPRIM2 is not running on node oratest1
STEP 4: Remove database resource from CRS
[oracle@oratest2 ~]$ srvctl remove database -d ORA_PRIM
Remove the
database ORA_PRIM? (y/[n]) Y
STEP 5: Start Only one instance using pfile backup
SQL> startup pfile='/tmp/initORAPRIM.ora'
ORACLE
instance started.
Total System Global Area 2751459856 bytes
Fixed Size 9138704 bytes
Variable
Size 771751936 bytes
Database
Buffers 1962934272 bytes
Redo
Buffers 7634944 bytes
Database
mounted.
Database
opened.
STEP 6: create spfile from pfile backup and start the database using spfile
SQL> create spfile from pfile='/tmp/initORAPRIM.ora';
File created.
SQL> shut immediate
Database
closed.
Database
dismounted.
ORACLE
instance shut down.
SQL>
startup
ORACLE
instance started.
Total System Global Area 2751459856 bytes
Fixed Size 9138704 bytes
Variable
Size 771751936 bytes
Database
Buffers 1962934272 bytes
Redo
Buffers 7634944 bytes
Database
mounted.
Database
opened.
STEP 7: change db_unique_name and global_name
SQL>
alter system set db_unique_name='OCIPRIM' scope=spfile sid='*';
System
altered.
SQL> alter database rename global_name to OCIPRIM;
Database
altered.
SQL> shut immediate
Database
closed.
Database
dismounted.
ORACLE
instance shut down.
SQL>
STEP 8: Add database to CRS level
[oracle@oratest2 ~]$ srvctl add database -d OCIPRIM -n oratest2 -o /u01/app/oracle/product/19c/db_1
[oracle@oratest2
~]$
STEP 9: Add instance to CRS level
[oracle@oratest2 ~]$ srvctl add instance -i OCIPRIM2 -n oratest2 -d OCIPRIM
[oracle@oratest2
~]$ srvctl status database -d OCIPRIM
Instance
OCIPRIM1 is not running on node oratest1
Instance
OCIPRIM2 is not running on node oratest2
STEP 10: Create dependency between database and ASM instance so that the database will be started after ASM instance starts.
[oracle@oratest2 ~]$ srvctl modify instance -i OCIPRIM1 -d OCIPRIM -n oratest1 -s +ASM1
PRKO-2207 :
Warning:-asminstance option has been deprecated and will be ignored.
[oracle@oratest2
~]$ srvctl modify instance -i OCIPRIM2 -d OCIPRIM -n oratest2 -s +ASM2
PRKO-2207 :
Warning:-asminstance option has been deprecated and will be ignored.
STEP 11: Change environment variable across all the instances of the database
STEP 12: add spfile at CRS level
[oracle@oratest2 ~]$ srvctl modify database -d OCIPRIM -spfile +DATA/OCIPRIM/PARAMETERFILE/spfileOCIPRIM.ora
[oracle@oratest2
~]$ srvctl config database -d OCRPRIM | grep -i spfile
[oracle@oratest2
~]$
[oracle@oratest2 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Oct 3 21:01:05 2024
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 2751459856 bytes
Fixed Size 9138704 bytes
Variable
Size 771751936 bytes
Database
Buffers 1962934272 bytes
Redo
Buffers 7634944 bytes
SQL>
create pfile='/tmp/initOCIPRIM.ora' from spfile;
File
created.
SQL>
shut immediate
ORA-01507:
database not mounted
ORACLE
instance shut down.
SQL> startup nomount pfile='/tmp/initOCIPRIM.ora'
ORACLE
instance started.
Total System Global Area 2751459856 bytes
Fixed Size 9138704 bytes
Variable
Size 771751936 bytes
Database
Buffers 1962934272 bytes
Redo
Buffers 7634944 bytes
SQL>
create spfile='+DATA/OCIPRIM/PARAMETERFILE/spfileOCIPRIM.ora' from
pfile='/tmp/initOCIPRIM.ora';
File created.
SQL> shut immediate
ORA-01507:
database not mounted
ORACLE
instance shut down.
SQL> startup nomount
ORACLE instance
started.
Total System Global Area 2751459856 bytes
Fixed Size 9138704 bytes
Variable
Size 637534208 bytes
Database
Buffers 2097152000 bytes
Redo
Buffers 7634944 bytes
SQL>
SQL>
alter database mount;
Database altered.
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------
----------- ------------------------------
spfile string +DATA/OCIPRIM/PARAMETERFILE/spfileociprim.ora
STEP 13: start database using srvctl utility
[oracle@oratest2 ~]$ srvctl start database -d OCIPRIM
[oracle@oratest2
~]$ srvctl status database -d OCIPRIM -v
Instance
OCIPRIM1 is running on node oratest1. Instance status: Open.
Instance
OCIPRIM2 is running on node oratest2. Instance status: Open.
STEP 14: copy password file from old location to new location
[oracle@oratest2
~]$ srvctl modify database -d OCIPRIM -pwfile +DATA/OCIPRIM/PASSWORD/pwdOCIPRIM
[oracle@oratest2
~]$
ASMCMD> pwcopy --dbuniquename OCIPRIM +DATA/ORA_PRIM/PASSWORD/pwdora_prim
+DATA/OCIPRIM/PASSWORD/pwdOCIPRIM -f
copying +DATA/ORA_PRIM/PASSWORD/pwdora_prim ->
+DATA/OCIPRIM/PASSWORD/pwdOCIPRIM
ASMCMD> cd +DATA/OCIPRIM/PASSWORD/
ASMCMD>
ls -lt
Type Redund
Striped Time Sys Name
PASSWORD HIGH
COARSE OCT 03 21:00:00 Y
pwdociprim.337.1181425223
PASSWORD HIGH
COARSE OCT 03 21:00:00 N
pwdociprim => +DATA/OCIPRIM/PASSWORD/pwdociprim.337.1181425223
[oracle@oratest2 ~]$ srvctl config database -d OCIPRIM | grep -i password
Password
file: +DATA/OCIPRIM/PASSWORD/pwdOCIPRIM
STEP 15: create database services and start it
[oracle@oratest2
~]$ srvctl add service -s UK_SVC -d OCIPRIM -role PRIMARY -pdb UK_PDB
-preferred OCIPRIM1,OCIPRIM2
[oracle@oratest2
~]$ srvctl status service -d OCIPRIM
Service
uk_svc is not running.
STEP 16: validate database configuration
[oracle@oratest2 ~]$ srvctl config database -d OCIPRIM
Database
unique name: OCIPRIM
Database
name: oratest2
Oracle
home: /u01/app/oracle/product/19c/db_1
Oracle
user: oracle
Spfile:
+DATA/OCIPRIM/PARAMETERFILE/spfileOCIPRIM.ora
Password
file: +DATA/OCIPRIM/PASSWORD/pwdOCIPRIM
Domain:
Start
options: open
Stop
options: immediate
Database
role: PRIMARY
Management
policy: AUTOMATIC
Server
pools:
Disk
Groups: DATA
Mount point
paths:
Services:
UK_SVC
Type: RAC
Start
concurrency:
Stop
concurrency:
OSDBA
group: oinstall
OSOPER
group: oinstall
Database
instances: OCIPRIM1,OCIPRIM2
Configured
nodes: oratest1,oratest2
CSS
critical: no
CPU count:
0
Memory
target: 0
Maximum
memory: 0
Default
network number for database services:
Database is
administrator managed
[oracle@oratest2 ~]$ crsctl stat res ora.ociprim.db -t
--------------------------------------------------------------------------------
Name Target State
Server State
details
--------------------------------------------------------------------------------
Cluster
Resources
--------------------------------------------------------------------------------
ora.ociprim.db
1
ONLINE ONLINE oratest1 Open,HOME=/u01/app/o
racle/product/19c/db
_1,STABLE
2
ONLINE ONLINE oratest2 Open,HOME=/u01/app/o
racle/product/19c/db
_1,STABLE
STEP 17: modify oem entry
STEP 18: reconfigure backup and immediately run L0
STEP 19: Remove blackout from the database