Search This Blog

Monday, February 22, 2021


OCT 2020 OJVM patching in Multitenant RAC database.


1.  Stop the instance on node 1

srvctl stop home -o $ORACLE_HOME -s /u01/software/virtual-19crac1_19c_home_services.txt -n virtual-19crac1

2. Run the conflict check on node 1

export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
export PATH=$ORACLE_HOME/bin:$PATH

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/31668882

3. Apply the patch

cd /u01/software/31668882

export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/OPatch/opatch apply

4 start the oracle services 

srvctl start home -o $ORACLE_HOME -s /u01/software/virtual-19crac1_19c_home_services.txt -n virtual-19crac1


5) check the patch

$ORACLE_HOME/OPatch/opatch lspatches

----------------------------------------------------------------------------------------------------------------------

 Patching on second node:
_______________________

1. stop the instance on node 2

srvctl stop home -o $ORACLE_HOME -s /u01/software/vm19rac2_19c_home_services.txt -n vm19rac2

2. Run the conflict check on node 2

export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
export PATH=$ORACLE_HOME/bin:$PATH


$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/31668882

3. Apply the patch on node 2

cd /u01/software/31668882
export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/OPatch/opatch apply


4 start the oracle services on node 2

srvctl start home -o $ORACLE_HOME -s /u01/software/vm19rac2_19c_home_services.txt -n vm19rac2


5) check the patch

$ORACLE_HOME/OPatch/opatch lspatches


-------------------------------------------------------------------------------------------------------------------------

POST Patch -

--------------------------------------------

On node 1.

1. Set the cluster_database to FALSE in the 19c database.


sqlplus /nolog

SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> alter system set cluster_database=false scope=spfile;

2.  Stop the database using srvctl and start only the first instance as below.


$ORACLE_HOME/bin/srvctl stop database -d <dbname>

sqlplus /nolog

SQL> CONNECT / AS SYSDBA
SQL> STARTUP UPGRADE;

3. Start the pdbs in uprade mode as below.

show pdbs
alter pluggable database all open upgrade;
show pdbs

Make sure that all the PDBS are un upgrade mode

Sample output
-----------------------------

SQL> show pdbs

CON_ID CON_NAME                       OPEN MODE  RESTRICTED
--------- ------------------------------ ---------- ----------
2 PDB$SEED                       MIGRATE    YES
3 TESTPDB                          MIGRATE    YES
4 TEST121                            MIGRATE    YES
5 WALLE121                        MIGRATE    YES
6 BUZZ18C                          MIGRATE    YES


4. Run the datapatch 


export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
export PATH=$ORACLE_HOME/bin:$PATH
cd $ORACLE_HOME/OPatch
./datapatch -verbose 

5. Now set the cluster_database to true and shutdown the database 


To start the database back in normal mode

sqlplus /nolog

SQL> CONNECT / AS SYSDBA
SQL> alter system set cluster_database=true scope=spfile;
SQL> SHUTDOWN immediate;

6. Start the database back in normal mode.


$ORACLE_HOME/bin/srvctl start database -d <dbname>


7. Check the registry

set lin 1000
col action form a12
col version  form a40
col description form a85
col action_date form a20
select description, action, to_char(action_time,'DD/MM/RR HH24:MI:SS') action_date, ' ' versionfrom dba_registry_sqlpatch;

6. run the utlp script to compile the invalid objects

cd $ORACLE_HOME/rdbms/admin

sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @utlrp.sql


------------------------------------------------------END -------------------------------------------------------

No comments:

Post a Comment