Thursday, December 3, 2020

Stop/Start all Oracle RAC databases at once - It's safe to apply the patches

 Applied OCW Patch 30304402 


Node-1:

[oracle@rac-p1 ~]$ sh /u01/app/oracle/product/12.1.0/db_1/OPatch/opatch lspatches
30340202;Database Patch Set Update : 12.1.0.2.200114 (30340202)
25869825;OCW Patch Set Update : 12.1.0.2.170718 (25869825)
OPatch succeeded.

[oracle@rac-p1 ~]$ srvctl status database -d racp
Instance racp1 is running on node rac-p1
Instance racp2 is running on node rac-p2
[oracle@rac-p1 ~]$

[oracle@rac-p1 ~]$ srvctl status database -d racp
Instance racp1 is running on node rac-p1
Instance racp2 is running on node rac-p2
[oracle@rac-p1 ~]$

[oracle@rac-p1 ~]$ cd 30464119/30304402/
[oracle@rac-p1 30304402]$ cd custom/scripts
[oracle@rac-p1 scripts]$ ls
postpatch.sh  prepatch.sh

[oracle@rac-p1 scripts]$ pwd
/home/oracle/30464119/30304402/custom/scripts
[oracle@rac-p1 scripts]$

Stopping all RAC databases of an ORACLE_HOME

This command will stop all databases running on the ORACLE_HOME specified and save the state before the shutdown in a state file.

[oracle@rac-p1 scripts]$ srvctl stop home -o /u01/app/oracle/product/12.1.0/db_1 -s /tmp/rac-p1_stop_3.dmp -n rac-p1
[oracle@rac-p1 scripts]$

[oracle@rac-p1 scripts]$ srvctl status database -d racp
Instance racp1 is not running on node rac-p1
Instance racp2 is running on node rac-p2
[oracle@rac-p1 scripts]$

[oracle@rac-p1 scripts]$ ./prepatch.sh -dbhome /u01/app/oracle/product/12.1.0/db_1
./prepatch.sh completed successfully.
[oracle@rac-p1 scripts]$

[oracle@rac-p1 scripts]$ sh /u01/app/oracle/product/12.1.0/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/12.1.0/db_1/ -local /home/oracle/30464119/30304402/

Oracle Interim Patch Installer version 12.2.0.1.23
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.1.0/db_1//oraInst.loc
OPatch version    : 12.2.0.1.23
OUI version       : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2020-12-03_10-38-56AM_1.log

Verifying environment and performing prerequisite checks...
--------------------------------------------------------------------------

Start OOP by Prereq process.
Launch OOP...

Oracle Interim Patch Installer version 12.2.0.1.23
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.1.0/db_1//oraInst.loc
OPatch version    : 12.2.0.1.23
OUI version       : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2020-12-03_10-39-13AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   30304402

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/db_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '30304402' to OH '/u01/app/oracle/product/12.1.0/db_1'
ApplySession: Optional component(s) [ oracle.has.crs, 12.1.0.2.0 ] , [ oracle.has.cvu, 12.1.0.2.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.rdbms, 12.1.0.2.0...
Patching component oracle.has.db, 12.1.0.2.0...
Patching component oracle.has.common, 12.1.0.2.0...
Patching component oracle.has.deconfig, 12.1.0.2.0...
Patching component oracle.has.common.cvu, 12.1.0.2.0...

Patching component oracle.has.rsf, 12.1.0.2.0...
Patch 30304402 successfully applied.
Sub-set patch [25869825] has become inactive due to the application of a super-set patch [30304402].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2020-12-03_10-39-13AM_1.log

OPatch succeeded.
[oracle@rac-p1 scripts]$

[oracle@rac-p1 scripts]$ ./postpatch.sh -dbhome /u01/app/oracle/product/12.1.0/db_1

Reading /u01/app/oracle/product/12.1.0/db_1/install/params.ora..
Reading /u01/app/oracle/product/12.1.0/db_1/install/params.ora..
Found uninstantiated /u01/app/oracle/product/12.1.0/db_1/crs/sbs/srvctl.sbs file, copying to /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/srvconfig
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/cluvfy
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/kfod
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/racgwrap
Skipping the missing file /u01/app/oracle/product/12.1.0/db_1/bin/racgwrap
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/srvconfig
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/cluvfy
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/kfod
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/srvconfig
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/cluvfy
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/kfod
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/diskmon.bin
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/lsnodes
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/osdbagrp
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/rawutl
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/srvm/admin/ractrans
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/srvm/admin/getcrshome
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/crsdiag.pl
Postpatch completed successfully
[oracle@rac-p1 scripts]$

[oracle@rac-p1 scripts]$ srvctl status database -d racp
Instance racp1 is not running on node rac-p1
Instance racp2 is running on node rac-p2
[oracle@rac-p1 scripts]$

Starting all RAC databases of an ORACLE_HOME

This command uses a state file to restart all databases previously running on a node.

[oracle@rac-p1 scripts]$ srvctl start home -o /u01/app/oracle/product/12.1.0/db_1 -s /tmp/rac-p1_stop_3.dmp -n rac-p1
[oracle@rac-p1 scripts]$

[oracle@rac-p1 scripts]$ srvctl status database -d racp
Instance racp1 is running on node rac-p1
Instance racp2 is running on node rac-p2
[oracle@rac-p1 scripts]$

[oracle@rac-p1 scripts]$ sh /u01/app/oracle/product/12.1.0/db_1/OPatch/opatch lspatches
30304402;OCW PATCH SET UPDATE 12.1.0.2.200114 (30304402)
30340202;Database Patch Set Update : 12.1.0.2.200114 (30340202)

OPatch succeeded.
[oracle@rac-p1 scripts]$

Node-2:

[oracle@rac-p2 ~]$ sh /u01/app/oracle/product/12.1.0/db_1/OPatch/opatch lspatches
30340202;Database Patch Set Update : 12.1.0.2.200114 (30340202)
25869825;OCW Patch Set Update : 12.1.0.2.170718 (25869825)

OPatch succeeded.
[oracle@rac-p2 ~]$

[oracle@rac-p2 ~]$ srvctl status database -d racp
Instance racp1 is running on node rac-p1
Instance racp2 is running on node rac-p2
[oracle@rac-p2 ~]$
[oracle@rac-p2 ~]$ cd 30464119/30304402/custom/scripts/

[oracle@rac-p2 scripts]$ srvctl stop home -o /u01/app/oracle/product/12.1.0/db_1 -s /tmp/rac-p2_stop_3.dmp -n rac-p2
[oracle@rac-p2 scripts]$

[oracle@rac-p2 scripts]$ srvctl status database -d racp
Instance racp1 is running on node rac-p1
Instance racp2 is not running on node rac-p2
[oracle@rac-p2 scripts]$

[oracle@rac-p2 scripts]$ ./prepatch.sh -dbhome /u01/app/oracle/product/12.1.0/db_1
./prepatch.sh completed successfully.
[oracle@rac-p2 scripts]$

[oracle@rac-p2 scripts]$ sh /u01/app/oracle/product/12.1.0/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/12.1.0/db_1/ -local /home/oracle/30464119/30304402/

Oracle Interim Patch Installer version 12.2.0.1.23
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.1.0/db_1//oraInst.loc
OPatch version    : 12.2.0.1.23
OUI version       : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2020-12-03_02-33-15AM_1.log

Verifying environment and performing prerequisite checks...
-------------------------------------------------------------------------
Start OOP by Prereq process.
Launch OOP...

Oracle Interim Patch Installer version 12.2.0.1.23
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.1.0/db_1//oraInst.loc
OPatch version    : 12.2.0.1.23
OUI version       : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2020-12-03_02-33-34AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   30304402

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/db_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '30304402' to OH '/u01/app/oracle/product/12.1.0/db_1'
ApplySession: Optional component(s) [ oracle.has.crs, 12.1.0.2.0 ] , [ oracle.has.cvu, 12.1.0.2.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.rdbms, 12.1.0.2.0...
Patching component oracle.has.db, 12.1.0.2.0...
Patching component oracle.has.common, 12.1.0.2.0...
Patching component oracle.has.deconfig, 12.1.0.2.0...
Patching component oracle.has.common.cvu, 12.1.0.2.0...
Patching component oracle.has.rsf, 12.1.0.2.0...
Patch 30304402 successfully applied.

Sub-set patch [25869825] has become inactive due to the application of a super-set patch [30304402].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2020-12-03_02-33-34AM_1.log

OPatch succeeded.

[oracle@rac-p2 scripts]$ srvctl status database -d racp
Instance racp1 is running on node rac-p1
Instance racp2 is not running on node rac-p2
[oracle@rac-p2 scripts]$

[oracle@rac-p2 scripts]$ ./postpatch.sh -dbhome /u01/app/oracle/product/12.1.0/db_1

Reading /u01/app/oracle/product/12.1.0/db_1/install/params.ora..
Reading /u01/app/oracle/product/12.1.0/db_1/install/params.ora..
Found uninstantiated /u01/app/oracle/product/12.1.0/db_1/crs/sbs/srvctl.sbs file, copying to /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/srvconfig
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/cluvfy
Parsing file /u01/app/oracle/product/12.1.0/db_1/bin/kfod
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/racgwrap
Skipping the missing file /u01/app/oracle/product/12.1.0/db_1/bin/racgwrap
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/srvconfig
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/cluvfy
Verifying file /u01/app/oracle/product/12.1.0/db_1/bin/kfod
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/srvctl
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/srvconfig
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/cluvfy
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/kfod
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/diskmon.bin
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/lsnodes
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/osdbagrp
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/rawutl
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/srvm/admin/ractrans
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/srvm/admin/getcrshome
Reapplying file permissions on /u01/app/oracle/product/12.1.0/db_1/bin/crsdiag.pl
Postpatch completed successfully
[oracle@rac-p2 scripts]$

[oracle@rac-p2 scripts]$ srvctl start home -o /u01/app/oracle/product/12.1.0/db_1 -s /tmp/rac-p2_stop_3.dmp -n rac-p2
[oracle@rac-p2 scripts]$

[oracle@rac-p2 scripts]$ srvctl status database -d racp
Instance racp1 is running on node rac-p1
Instance racp2 is running on node rac-p2

[oracle@rac-p2 scripts]$ sh /u01/app/oracle/product/12.1.0/db_1/OPatch/opatch lspatches
30304402;OCW PATCH SET UPDATE 12.1.0.2.200114 (30304402)
30340202;Database Patch Set Update : 12.1.0.2.200114 (30340202)

OPatch succeeded.
[oracle@rac-p2 scripts]$


Final Status:

[oracle@rac-p1 scripts]$ srvctl status home -o /u01/app/oracle/product/12.1.0/db_1 -s /tmp/rac-p1_stop_3.dmp -n rac-p1
Database racp is running on node rac-p1

[oracle@rac-p1 scripts]$ srvctl status home -o /u01/app/oracle/product/12.1.0/db_1 -n rac-p1
PRKO-2082 : Missing mandatory option -statefile
[oracle@rac-p1 scripts]$

[oracle@rac-p2 scripts]$ srvctl status home -o /u01/app/oracle/product/12.1.0/db_1 -s /tmp/rac-p2_stop_4.dmp -n rac-p2
Database racp is running on node rac-p2
[oracle@rac-p2 scripts]$

[oracle@rac-p2 scripts]$ srvctl status home -o /u01/app/oracle/product/12.1.0/db_1 -s /tmp/rac-p2_stop_4.dmp
PRKO-2082 : Missing mandatory option -node
[oracle@rac-p2 scripts]$

Hope it helps....

No comments:

Post a Comment