Oracle Linux 7.9 install Oracle11g database-5, install the database patch

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
Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Check whether the environment meets the requirements
Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

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;

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

#Exit the database connection and check whether there are oracle related processes

ps -ef|grep ora_

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

4. Install the Opatch tool and patch

cd $ORACLE_HOME
cd OPatch/
./opatch version

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

#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版本

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

#Write the OPatch directory into the environment variable

vi ~/.bash_profile 

Oracle Linux 7.9 install Oracle11g database-5, install the database patch
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 ./

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

#Patch

cd 31537677 
opatch apply

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Select y for all y/n options that appear

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

After patching, the warning that appears is okay, it doesn’t matter if no error is reported.

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

5. Check the patch situation

opatch lsinventory 

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

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

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Check the view

select action_time,action,comments from registry$history;

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Compiled object

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Confirm that there is no error message

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

6. Start the database service

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Oracle Linux 7.9 install Oracle11g database-5, install the database patch

Previous: Create a database

Next:

Guess you like

Origin blog.51cto.com/190242856/2663616