Video address: https://edu.51cto.com/center/course/lesson/index?id=57819
1. Download the patch and patch Opatch tool
Take Patch 31537677-Oracle Database Patch Set Update 11.2.0.4.201020 as an example
p31537677_112040_Linux-x86-64_DB
Opatch_11.2.0.3.27
2. Upload the patch related files to the server to decompress
Check the README.html documentation, the requirements for the OPatch version
Check whether the environment meets the requirements
3. Stop all database services
#Stop listening
lsnrctl stop
#Stop EM console
emctl stop dbconsole
#Log in as sysdba user to stop the database
sqlplus "/as sysdba";
shoutdown immediate;
#Exit the database connection and check whether there are oracle related processes
ps -ef|grep ora_
4. Install the Opatch tool and patch
cd $ORACLE_HOME
cd OPatch/
./opatch version
#Backup opatch
cd $ORACLE_HOME
mv OPatch OPatch_old #备份
cp -r
#Replace OPatch directory
cd /backup
unzip opatch.zip
cp -r /backup/OPatch . #将新的OPatch目录拷贝到ORACLE_HOME目录下
cd OPatch
./opatch version #再次检查OPatch版本
#Write the OPatch directory into the environment variable
vi ~/.bash_profile
OPatch directory: /oracle/app/oracle/product/11.2.0/db_1/OPatch
#Check whether the environmental requirements are met
cd 31537677
opatch prereq CheckConflictAgainstOHWithDetail -ph ./
#Patch
cd 31537677
opatch apply
Select y for all y/n options that appear
After patching, the warning that appears is okay, it doesn’t matter if no error is reported.
5. Check the patch situation
opatch lsinventory
Execute commands in the database to recompile the database
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT
Check the view
select action_time,action,comments from registry$history;
Compiled object
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
Confirm that there is no error message
6. Start the database service
Previous: Create a database
Next: