[RAC] Rolling Installation/rollback patch on 11gR2rac

Source: Internet
Author: User
When installing small patches in the RAC environment, you can use Rolling installation to provide uninterrupted business applications! Stop a database instance when installing the patch,

When installing small patches in the RAC environment, you can use Rolling installation to provide uninterrupted business applications! Stop a database instance when installing the patch,

When installing small patches in the RAC environment, you can use Rolling installation to provide uninterrupted business applications! When installing the patch, stop a database instance, install the patch on this node, start the instance, stop another instance, and install the patch, this ensures that there are always available database instances and services can be provided without interruption!
The premise of Rolling Installation is that the patch can be Rolling installed. The following article will discuss how to determine whether a patch is Rolling.
In general, the general Rolling Installation Method is as follows:
1. download the patch.
2. Back up the database before patching.
3. Check whether the installed patch conflicts with the previous patch.
4. If you have a test library, you 'd better test the patch in the Test Library first.
5. Read the patch Readme carefully and install the patch according to the steps below:
1). Use Oracle users to upload the patch to a directory on the server.
2) decompress the file:
3). Stop all database instances + ASM instances under ORACLE_HOME Node 1 (11g rac is not needed, 10g is required );
4) patch Node 1:
$ Cd $ ORACLE_HOME/OPatch/9711859 (the directory can be changed as needed)
$ Opatch apply
5). Then opatch will ask if you want to set Node 2. Then, perform the following operations:
6). Start all database instances + ASM instances under ORACLE_HOME of Node 1 (if any );
7). Stop all database instances + ASM instances under ORACLE_HOME Node 2 (if any );
8). Confirm to continue hitting the next node at the patch prompt;
9). Start all database instances + ASM instances under ORACLE_HOME Node 2 (if any );
10). If there are multiple nodes, execute them in sequence.
Download opatch and patches ~!
A) Check the opatch version.
Oracle @ rac1:/home/oracle/software> opatch version
Invoking OPatch 11.1.0.6.6
OPatch Version: 11.1.0.6.6
OPatch succeeded.
B) download the latest version.
Take p9711859_112010_linux-x86-64.zip as an example!
Back up the old opatch and decompress the new optach
Oracle @ rac1:/home/oracle/software> cd $ ORACLE_HOME
Oracle @ rac1:/opt/rac/oracle/11.2.0/rac> tar zcvf OPatch _ 'date using policy?m=d'.tar.gz OPatch
OPatch/
Oracle @ rac1:/home/oracle/software> unzip p6880880_112000_Linux-x86-64.zip -- d $ ORACLE_HOME
Archive: p6880880_112000_Linux-x86-64.zip
Replace/opt/rac/oracle/11.2.0/rac/OPatch/docs/Users_Guide.txt? [Y] es, [n] o, [A] ll, [N] one, [r] ename:
..........
Inflating:/opt/rac/oracle/11.2.0/rac/OPatch/crs/s_crsconfig_lib.pm
View the opatch version!
Oracle @ rac1:/home/oracle/software> opatch version
OPatch Version: 11.2.0.3.0
OPatch succeeded.
Oracle @ rac1:/home/oracle/software>
C) download the patch to be installed and check whether rolling apply is satisfied
Oracle @ rac1:/home/oracle> opatch query-all/home/oracle/software/9711859 | grep rolling
Patch is a rolling patch: true
Two stop Node 1 rac1 listening
Oracle @ rac1:/home/oracle> srvctl stop listener-l LISTENER-n rac1
Oracle @ rac1:/home/oracle>
Oracle @ rac1:/home/oracle> srvctl status listener-l LISTENER
LISTENER Enabled
The LISTENER is running on the node: rac2
Stop the database instance on node 1 (for version 10, you need to stop the asm instance)
Oracle @ rac1:/home/oracle> srvctl status instance-d rac-I rac1
Instance rac1 is running on node rac1
Oracle @ rac1:/home/oracle> srvctl stop instance-d rac-I rac1
Three start rolling method application patch:
Oracle @ rac1:/home/oracle/software/9711859> opatch apply
Oracle Intermediate Patch installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home:/opt/rac/oracle/11.2.0/rac
Central Inventory:/opt/rac/oraInventory
From:/opt/rac/oracle/11.2.0/rac/oraInst. loc
OPatch version: 11.2.0.3.0
OUI version: 11.2.0.1.0
Log file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/9711859_Jun_25_2012_16_16_42/apply2012-06-25_16-16-42 afternoon _ 1.log
Applying interim patch '000000' to oh'/opt/rac/oracle/11.2.0/rac'
Verifying environment and padding Ming prerequisite checks...
All checks passed.
Provides an email address to receive notifications about security issues, install Oracle Configuration Manager, and start it. If you use My Oracle
Support email address/user name, which makes the operation easier.
For more information, visit.
Email Address/User name: qilong.yangql@gmail.com
Provide the My Oracle Support password to receive security updates through the My Oracle Support Account.
Password (optional ):
This node is part of Oracle Real Application Cluster.
Remote node: 'rac2'
Local node: 'rac1'
Close the Oracle instance running outside of ORACLE_HOME on the local system.
(Oracle main directory = '/opt/rac/oracle/11.2.0/rac ')

Is the local system patched? [Y | n] y
User Responded with: Y
Backing up files...
Installing patches for oracle. rdbms and 11.2.0.1.0...
Verifying the update...
The local system has been patched. You can restart the Oracle instance on the local system.
Patch in rolling mode.
Next, patch the node 'rac2.
Close the Oracle instance running outside of ORACLE_HOME on 'rac2.
(Oracle main directory = '/opt/rac/oracle/11.2.0/rac ')

// When you ask if you want to install a patch on another node
4. Start the database and listen on node rac1
Oracle @ rac1:/home/oracle/software/9711859> srvctl start instance-d rac-I rac1-o open
Oracle @ rac1:/home/oracle/software/9711859> srvctl status instance-d rac-I rac1
Instance rac1 is running on node rac1
Oracle @ rac1:/home/oracle/software/9711859> srvctl start listener-l LISTENER-n rac1
PRCC-1015: LISTENER is running on rac1 <= LISTENER started when the database is started!
5. Disable node rac2 listening and database instance operations
Oracle @ rac1:/home/oracle/software/9711859> srvctl stop listener-l LISTENER-n rac2
Oracle @ rac1:/home/oracle/software/9711859> srvctl stop instance-d rac-I rac2
Is the node patched? [Y | n] <========= before entering y, you must disable the database instance on node 2 and open the instance on node 1!
Y
User Responded with: Y
Updating nodes 'rac2'
Apply-related files are:
FP = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_files.txt"
DP = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_dirs.txt"
MP = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/make_cmds.txt"
RC = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remote_cmds.txt"

Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_files.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_files.txt "with actual path.
Propagating files to remote nodes...
Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_dirs.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_dirs.txt "with actual path.
Propagating directories to remote nodes...
Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/make_cmds.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/make_cmds.txt "with actual path.
Running command on remote node 'rac2 ':
Cd/opt/rac/oracle/11.2.0/rac/rdbms/lib; /usr/bin/make-f ins_rdbms.mk ioracle ORACLE_HOME =/opt/rac/oracle/11.2.0/rac | echo REMOTE_MAKE_FAILED ::>& 2
The node 'rac2' has been patched. You can restart the Oracle instance on this node.
There is a reconnection on the remote node. Check the size and timestamp of the binary file on the node 'rac2.
The following make command has been called on a remote node:
'CD/opt/rac/oracle/11.2.0/rac/rdbms/lib;/usr/bin/make-f ins_rdbms.mk ioracle ORACLE_HOME =/opt/rac/oracle/11.2.0/rac
'
Patch 9711859 successfully applied
Log file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/9711859_Jun_25_2012_16_16_42/apply2012-06-25_16-16-42 afternoon _ 1.log
OPatch succeeded.
Run the following commands on the two nodes to verify that the patch has been successfully installed.
Oracle @ rac1:/home/oracle/software/9711859> opatch lsinventory
Oracle Intermediate Patch installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home:/opt/rac/oracle/11.2.0/rac
Central Inventory:/opt/rac/oraInventory
From:/opt/rac/oracle/11.2.0/rac/oraInst. loc
OPatch version: 11.2.0.3.0
OUI version: 11.2.0.1.0
Log file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/opatch2012-06-25_16-36-30 PM _ 1.log
Lsinventory Output file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/lsinv/lsinventory2012-06-25_16-36-302.16.txt
--------------------------------------------------------------------------------
Installed top-level products (1 ):
Oracle Database 11g 11.2.0.1.0
One product has been installed in the Oracle Home Directory.
Intermediate Patch (1 ):
Patch 9711859: applied on Mon Jun 25 16:22:36 CST 2012
Unique Patch ID: 12670211
Created on 9 Jun 2010, 10:13:45 hrs PST8PDT
Bugs fixed:
9711859
RAC system with multiple nodes
Local node = rac1
Remote node = rac2
--------------------------------------------------------------------------------
OPatch succeeded.
Similarly, the confirmation output on node 2 is omitted!


Process of rolling back patch 9711859 ~
1. Shut down the database instance of Node 1
Run
Srvctl stop instance-d rac-I rac1
Srvctl stop listener-l LISTENER-n rac1
2. Execute the rollback patch:
Oracle @ rac1:/home/oracle/software/9711859> opatch rollback-id 9711859
Oracle Intermediate Patch installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home:/opt/rac/oracle/11.2.0/rac
Central Inventory:/opt/rac/oraInventory
From:/opt/rac/oracle/11.2.0/rac/oraInst. loc
OPatch version: 11.2.0.3.0
OUI version: 11.2.0.1.0
Log file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/9711859_Jun_25_2012_17_30_32/rollback2012-06-25_17-30-32 PM _ 1.log
RollbackSession from OH '/opt/rac/oracle/11.2.0/rac' roll back Intermediate Patch '123'
This node is part of Oracle Real Application Cluster.
Remote node: 'rac2'
Local node: 'rac1'
Close the Oracle instances running on all nodes outside of ORACLE_HOME.
(Oracle main directory = '/opt/rac/oracle/11.2.0/rac ')
Are all nodes patched? [Y | n]
Y
User Responded with: Y
Installing patches for oracle. rdbms and 11.2.0.1.0...
RollbackSession removes the Intermediate Patch '123456' from the product list'
Patch in rolling mode.
Next, patch the node 'rac2.
Close the Oracle instance running outside of ORACLE_HOME on 'rac2.
(Oracle main directory = '/opt/rac/oracle/11.2.0/rac ')
3. Start the database and listen on node rac1
Oracle @ rac1:/home/oracle/software/9711859> srvctl start instance-d rac-I rac1-o open
Oracle @ rac1:/home/oracle/software/9711859> srvctl status instance-d rac-I rac1
Instance rac1 is running on node rac1
Oracle @ rac1:/home/oracle/software/9711859> srvctl start listener-l LISTENER-n rac1
PRCC-1015: LISTENER is running on rac1 <= LISTENER started when the database is started!
4. Disable node rac2 listeners and database instance operations
Oracle @ rac1:/home/oracle/software/9711859> srvctl stop listener-l LISTENER-n rac2
Oracle @ rac1:/home/oracle/software/9711859> srvctl stop instance-d rac-I rac2
5. Select to uninstall the patch on node rac2!
Is the node patched? [Y | n]
Y
User Responded with: Y
Updating nodes 'rac2'
Rollback-related files are:
FR = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remove_files.txt"
DR = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remove_dirs.txt"
FP = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_files.txt"
MP = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/make_cmds.txt"
RC = "/opt/rac/oracle/11.2.0/rac/. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remote_cmds.txt"

Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remove_files.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remove_files.txt "with actual path.
Removing files on remote nodes...
Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remove_dirs.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/remove_dirs.txt "with actual path.
Removing directories on remote nodes...
Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_files.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_files.txt "with actual path.
Propagating files to remote nodes...
Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_dirs.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/copy_dirs.txt "with actual path.
Propagating directories to remote nodes...
Instantiating the file "/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/make_cmds.txt.instantiated "by replacing $ ORACLE_HOME in"/opt/rac/oracle/11.2.0/rac /. patch_storage/9711859_Jun_9_2010_10_13_45/rac/make_cmds.txt "with actual path.
Running command on remote node 'rac2 ':
Cd/opt/rac/oracle/11.2.0/rac/rdbms/lib; /usr/bin/make-f ins_rdbms.mk ioracle ORACLE_HOME =/opt/rac/oracle/11.2.0/rac | echo REMOTE_MAKE_FAILED ::>& 2


The node 'rac2' has been patched. You can restart the Oracle instance on this node.
There is a reconnection on the remote node. Check the size and timestamp of the binary file on the node 'rac2.
The following make command has been called on a remote node:
'CD/opt/rac/oracle/11.2.0/rac/rdbms/lib;/usr/bin/make-f ins_rdbms.mk ioracle ORACLE_HOME =/opt/rac/oracle/11.2.0/rac'
Log file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/9711859_Jun_25_2012_17_30_32/rollback2012-06-25_17-30-32 PM _ 1.log
OPatch succeeded.
Check whether the rollback is successful on both nodes!
Oracle @ rac1:/home/oracle/software/9711859> opatch lsinventory
Oracle Intermediate Patch installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home:/opt/rac/oracle/11.2.0/rac
Central Inventory:/opt/rac/oraInventory
From:/opt/rac/oracle/11.2.0/rac/oraInst. loc
OPatch version: 11.2.0.3.0
OUI version: 11.2.0.1.0
Log file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/opatch2012-06-25_17-41-29 PM _ 1.log
Lsinventory Output file location:/opt/rac/oracle/11.2.0/rac/export toollogs/opatch/lsinv/lsinventory2012-06-25_17-41-292.16.txt
-------------------------------------------------------------------------------
Installed top-level products (1 ):
Oracle Database 11g 11.2.0.1.0
One product has been installed in the Oracle Home Directory.
No intermediate patches are installed in this Oracle home directory.
RAC system with multiple nodes
Local node = rac1
Remote node = rac2
--------------------------------------------------------------------------------
OPatch succeeded.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.