A) OPatch 업데이트
$DB_HOME의 OPatch 업데이트
$DB_HOME/OPatch/opatch version mv $DB_HOME/OPatch $DB_HOME/OPatch.bak cp -r $GRID_HOME/OPatch $DB_HOME chown -R oracle:oinstall $DB_HOME/OPatch $DB_HOME/OPatch/opatch version
[root@rac1 ~]# $GRID_HOME/OPatch/opatch version OPatch Version: 11.2.0.3.23 OPatch succeeded. [root@rac1 ~]# $DB_HOME/OPatch/opatch version OPatch Version: 11.2.0.3.4 OPatch succeeded. [root@rac1 ~]# mv $DB_HOME/OPatch $DB_HOME/OPatch.bak [root@rac1 ~]# cp -r $GRID_HOME/OPatch $DB_HOME [root@rac1 ~]# chown -R oracle:oinstall $DB_HOME/OPatch [root@rac1 ~]# $DB_HOME/OPatch/opatch version OPatch Version: 11.2.0.3.23 OPatch succeeded.
[root@rac2 ~]# $GRID_HOME/OPatch/opatch version OPatch Version: 11.2.0.3.23 OPatch succeeded. [root@rac2 ~]# $DB_HOME/OPatch/opatch version OPatch Version: 11.2.0.3.4 OPatch succeeded. [root@rac2 ~]# mv $DB_HOME/OPatch $DB_HOME/OPatch.bak [root@rac2 ~]# cp -r $GRID_HOME/OPatch $DB_HOME [root@rac2 ~]# chown -R oracle:oinstall $DB_HOME/OPatch [root@rac2 ~]# $DB_HOME/OPatch/opatch version OPatch Version: 11.2.0.3.23 OPatch succeeded.
B) 사전 조사
패치 적용 여부 확인
grid_env opatch lspatches db_env opatch lspatches
[racdb1:/home/oracle]> grid_env [+ASM1:/home/oracle]> opatch lspatches 18370031;Grid Infrastructure Patch Set Update : 11.2.0.4.x (gibugno) OPatch succeeded. [+ASM1:/home/oracle]> db_env [racdb1:/home/oracle]> opatch lspatches 이 Oracle 홈에 설치된 Interim 패치가 없습니다 "/u01/app/oracle/product/11g/db_1". OPatch succeeded.
[racdb2:/home/oracle]> grid_env [+ASM2:/home/oracle]> opatch lspatches 18370031;Grid Infrastructure Patch Set Update : 11.2.0.4.x (gibugno) OPatch succeeded. [+ASM2:/home/oracle]> db_env [racdb2:/home/oracle]> opatch lspatches 이 Oracle 홈에 설치된 Interim 패치가 없습니다 "/u01/app/oracle/product/11g/db_1". OPatch succeeded.
{}
패치 충돌 여부 조사
$GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph <패치 압축 해제 디렉토리>/30501155 -oh $GRID_HOME $DB_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph <패치 압축 해제 디렉토리>/30501155 -oh $DB_HOME
[racdb1:/home/oracle]> $GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /media/sf_oracle/11.2/30501155 -oh $GRID_HOME Oracle Interim 패치 설치 프로그램 버전 11.2.0.3.23 Copyright (c) 2020, Oracle Corporation. All rights reserved. PREREQ session Oracle 홈: /u01/app/11g/grid 중앙 인벤토리: /u01/app/oraInventory 출처: /u01/app/11g/grid/oraInst.loc OPatch 버전: 11.2.0.3.23 OUI 버전: 11.2.0.4.0 로그 파일 위치: /u01/app/11g/grid/cfgtoollogs/opatch/opatch2020-03-28_22-58-11오후_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [racdb1:/home/oracle]> $DB_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /media/sf_oracle/11.2/30501155 -oh $DB_HOME Oracle Interim 패치 설치 프로그램 버전 11.2.0.3.23 Copyright (c) 2020, Oracle Corporation. All rights reserved. PREREQ session Oracle 홈: /u01/app/oracle/product/11g/db_1 중앙 인벤토리: /u01/app/oraInventory 출처: /u01/app/oracle/product/11g/db_1/oraInst.loc OPatch 버전: 11.2.0.3.23 OUI 버전: 11.2.0.4.0 로그 파일 위치: /u01/app/oracle/product/11g/db_1/cfgtoollogs/opatch/opatch2020-03-28_22-58-25오후_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.
[racdb1:/home/oracle]> $GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /media/sf_oracle/11.2/30501155 -oh $GRID_HOME Oracle Interim 패치 설치 프로그램 버전 11.2.0.3.23 Copyright (c) 2020, Oracle Corporation. All rights reserved. PREREQ session Oracle 홈: /u01/app/11g/grid 중앙 인벤토리: /u01/app/oraInventory 출처: /u01/app/11g/grid/oraInst.loc OPatch 버전: 11.2.0.3.23 OUI 버전: 11.2.0.4.0 로그 파일 위치: /u01/app/11g/grid/cfgtoollogs/opatch/opatch2020-03-28_22-58-11오후_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [racdb1:/home/oracle]> $DB_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /media/sf_oracle/11.2/30501155 -oh $DB_HOME Oracle Interim 패치 설치 프로그램 버전 11.2.0.3.23 Copyright (c) 2020, Oracle Corporation. All rights reserved. PREREQ session Oracle 홈: /u01/app/oracle/product/11g/db_1 중앙 인벤토리: /u01/app/oraInventory 출처: /u01/app/oracle/product/11g/db_1/oraInst.loc OPatch 버전: 11.2.0.3.23 OUI 버전: 11.2.0.4.0 로그 파일 위치: /u01/app/oracle/product/11g/db_1/cfgtoollogs/opatch/opatch2020-03-28_22-58-25오후_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.
C) 1번 노드 패치
1번 노드 Database 패치
$DB_HOME/OPatch/opatch auto <패치 압축 해제 디렉토리>/30501155 -oh $DB_HOME
[root@rac1 ~]# $DB_HOME/OPatch/opatch auto /media/sf_oracle/11.2/30501155 -oh $DB_HOME Executing /u01/app/11g/grid/perl/bin/perl /u01/app/oracle/product/11g/db_1/OPatch/crs/patch11203.pl -patchdir /media/sf_oracle/11.2 -patchn 30501155 -oh /u01/app/oracle/product/11g/db_1 -paramfile /u01/app/11g/grid/crs/install/crsconfig_params This is the main log file: /u01/app/oracle/product/11g/db_1/cfgtoollogs/opatchauto2020-03-28_23-00-33.log This file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /u01/app/oracle/product/11g/db_1/cfgtoollogs/opatchauto2020-03-28_23-00-33.report.log 2020-03-28 23:00:33: Starting Clusterware Patch Setup Using configuration parameter file: /u01/app/11g/grid/crs/install/crsconfig_params Stopping RAC /u01/app/oracle/product/11g/db_1 ... Stopped RAC /u01/app/oracle/product/11g/db_1 successfully patch /media/sf_oracle/11.2/30501155/29938455/custom/server/29938455 apply successful for home /u01/app/oracle/product/11g/db_1 patch /media/sf_oracle/11.2/30501155/30298532 apply successful for home /u01/app/oracle/product/11g/db_1 Starting RAC /u01/app/oracle/product/11g/db_1 ... Started RAC /u01/app/oracle/product/11g/db_1 successfully opatch auto succeeded.
1번 노드 Grid 패치
$GRID_HOME/OPatch/opatch auto <패치 압축 해제 디렉토리>/30501155 -oh $GRID_HOME
[root@rac1 ~]# $GRID_HOME/OPatch/opatch auto /media/sf_oracle/11.2/30501155 -oh $GRID_HOME Executing /u01/app/11g/grid/perl/bin/perl /u01/app/11g/grid/OPatch/crs/patch11203.pl -patchdir /media/sf_oracle/11.2 -patchn 30501155 -oh /u01/app/11g/grid -paramfile /u01/app/11g/grid/crs/install/crsconfig_params This is the main log file: /u01/app/11g/grid/cfgtoollogs/opatchauto2020-03-28_23-07-30.log This file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /u01/app/11g/grid/cfgtoollogs/opatchauto2020-03-28_23-07-30.report.log 2020-03-28 23:07:30: Starting Clusterware Patch Setup Using configuration parameter file: /u01/app/11g/grid/crs/install/crsconfig_params Stopping CRS... Stopped CRS successfully patch /media/sf_oracle/11.2/30501155/29938455 apply successful for home /u01/app/11g/grid patch /media/sf_oracle/11.2/30501155/30298532 apply successful for home /u01/app/11g/grid patch /media/sf_oracle/11.2/30501155/29509309 apply successful for home /u01/app/11g/grid Starting CRS... Installing Trace File Analyzer CRS-4123: Oracle High Availability Services has been started. opatch auto succeeded.
1번 노드 패치 결과 확인
grid_env opatch lspatches db_env opatch lspatches
[racdb1:/home/oracle]> grid_env [+ASM1:/home/oracle]> opatch lspatches 30298532;Database Patch Set Update : 11.2.0.4.200114 (30298532) 29509309;ACFS Patch Set Update : 11.2.0.4.190716 (29509309) 29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455) OPatch succeeded. [+ASM1:/home/oracle]> db_env [racdb1:/home/oracle]> opatch lspatches 30298532;Database Patch Set Update : 11.2.0.4.200114 (30298532) 29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455) OPatch succeeded.
D) 2번 노드 패치
2번 노드 Database 패치
$DB_HOME/OPatch/opatch auto <패치 압축 해제 디렉토리>/30501155 -oh $DB_HOME
[root@rac2 ~]# $DB_HOME/OPatch/opatch auto /media/sf_oracle/11.2/30501155 -oh $DB_HOME Executing /u01/app/11g/grid/perl/bin/perl /u01/app/oracle/product/11g/db_1/OPatch/crs/patch11203.pl -patchdir /media/sf_oracle/11.2 -patchn 30501155 -oh /u01/app/oracle/product/11g/db_1 -paramfile /u01/app/11g/grid/crs/install/crsconfig_params This is the main log file: /u01/app/oracle/product/11g/db_1/cfgtoollogs/opatchauto2020-03-28_23-20-14.log This file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /u01/app/oracle/product/11g/db_1/cfgtoollogs/opatchauto2020-03-28_23-20-14.report.log 2020-03-28 23:20:14: Starting Clusterware Patch Setup Using configuration parameter file: /u01/app/11g/grid/crs/install/crsconfig_params Stopping RAC /u01/app/oracle/product/11g/db_1 ... Stopped RAC /u01/app/oracle/product/11g/db_1 successfully patch /media/sf_oracle/11.2/30501155/29938455/custom/server/29938455 apply successful for home /u01/app/oracle/product/11g/db_1 patch /media/sf_oracle/11.2/30501155/30298532 apply successful for home /u01/app/oracle/product/11g/db_1 Starting RAC /u01/app/oracle/product/11g/db_1 ... Started RAC /u01/app/oracle/product/11g/db_1 successfully opatch auto succeeded.
2번 노드 Grid 패치
$GRID_HOME/OPatch/opatch auto <패치 압축 해제 디렉토리>/30501155 -oh $GRID_HOME
[root@rac2 ~]# $GRID_HOME/OPatch/opatch auto /media/sf_oracle/11.2/30501155 -oh $GRID_HOME Executing /u01/app/11g/grid/perl/bin/perl /u01/app/11g/grid/OPatch/crs/patch11203.pl -patchdir /media/sf_oracle/11.2 -patchn 30501155 -oh /u01/app/11g/grid -paramfile /u01/app/11g/grid/crs/install/crsconfig_params This is the main log file: /u01/app/11g/grid/cfgtoollogs/opatchauto2020-03-28_23-28-24.log This file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /u01/app/11g/grid/cfgtoollogs/opatchauto2020-03-28_23-28-24.report.log 2020-03-28 23:28:24: Starting Clusterware Patch Setup Using configuration parameter file: /u01/app/11g/grid/crs/install/crsconfig_params Stopping CRS... Stopped CRS successfully patch /media/sf_oracle/11.2/30501155/29938455 apply successful for home /u01/app/11g/grid patch /media/sf_oracle/11.2/30501155/30298532 apply successful for home /u01/app/11g/grid patch /media/sf_oracle/11.2/30501155/29509309 apply successful for home /u01/app/11g/grid Starting CRS... Installing Trace File Analyzer CRS-4123: Oracle High Availability Services has been started. opatch auto succeeded.
2번 노드 패치 결과 확인
grid_env opatch lspatches db_env opatch lspatches
[racdb2:/home/oracle]> grid_env [+ASM2:/home/oracle]> opatch lspatches 30298532;Database Patch Set Update : 11.2.0.4.200114 (30298532) 29509309;ACFS Patch Set Update : 11.2.0.4.190716 (29509309) 29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455) OPatch succeeded. [+ASM2:/home/oracle]> db_env [racdb2:/home/oracle]> opatch lspatches 30298532;Database Patch Set Update : 11.2.0.4.200114 (30298532) 29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455) OPatch succeeded.
E) Database에 PSU 적용
데이터베이스에 PSU 패치 적용
@?/rdbms/admin/catbundle.sql psu apply @?/rdbms/admin/utlrp.sql
[racdb1:/home/oracle]> sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 29 00:34:52 2020 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> @?/rdbms/admin/catbundle.sql psu apply PL/SQL procedure successfully completed. ... << 중략 >> ... SQL> PROMPT Skipping Spatial because it is not installed or versions mismatch... Skipping Spatial because it is not installed or versions mismatch... SQL> ALTER SESSION SET current_schema = SYS; Session altered. SQL> PROMPT Updating registry... Updating registry... SQL> INSERT INTO registry$history 2 (action_time, action, 3 namespace, version, id, 4 bundle_series, comments) 5 VALUES 6 (SYSTIMESTAMP, 'APPLY', 7 SYS_CONTEXT('REGISTRY$CTX','NAMESPACE'), 8 '11.2.0.4', 9 200114, 10 'PSU', 11 'PSU 11.2.0.4.200114'); 1 row created. SQL> COMMIT; Commit complete. SQL> SPOOL off SQL> SET echo off Check the following log file for errors: /u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_RACDB_APPLY_2020Mar29_00_35_17.log
SQL> @?/rdbms/admin/utlrp.sql TIMESTAMP -------------------------------------------------------------------------------- COMP_TIMESTAMP UTLRP_BGN 2020-03-29 00:45:29 1 row selected. DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid DOC> objects in the database. Recompilation time is proportional to the DOC> number of invalid objects in the database, so this command may take DOC> a long time to execute on a database with a large number of invalid DOC> objects. DOC> DOC> Use the following queries to track recompilation progress: DOC> DOC> 1. Query returning the number of invalid objects remaining. This DOC> number should decrease with time. DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6); DOC> DOC> 2. Query returning the number of objects compiled so far. This number DOC> should increase with time. DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED; DOC> DOC> This script automatically chooses serial or parallel recompilation DOC> based on the number of CPUs available (parameter cpu_count) multiplied DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu). DOC> On RAC, this number is added across all RAC nodes. DOC> DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel DOC> recompilation. Jobs are created without instance affinity so that they DOC> can migrate across RAC nodes. Use the following queries to verify DOC> whether UTL_RECOMP jobs are being created and run correctly: DOC> DOC> 1. Query showing jobs created by UTL_RECOMP DOC> SELECT job_name FROM dba_scheduler_jobs DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%'; DOC> DOC> 2. Query showing UTL_RECOMP jobs that are running DOC> SELECT job_name FROM dba_scheduler_running_jobs DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%'; DOC># PL/SQL procedure successfully completed. TIMESTAMP -------------------------------------------------------------------------------- COMP_TIMESTAMP UTLRP_END 2020-03-29 00:45:33 1 row selected. DOC> The following query reports the number of objects that have compiled DOC> with errors. DOC> DOC> If the number is higher than expected, please examine the error DOC> messages reported with each object (using SHOW ERRORS) to see if they DOC> point to system misconfiguration or resource constraints that must be DOC> fixed before attempting to recompile these objects. DOC># OBJECTS WITH ERRORS ------------------- 0 1 row selected. DOC> The following query reports the number of errors caught during DOC> recompilation. If this number is non-zero, please query the error DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors DOC> are due to misconfiguration or resource constraints that must be DOC> fixed before objects can compile successfully. DOC># ERRORS DURING RECOMPILATION --------------------------- 0 1 row selected. Function created. PL/SQL procedure successfully completed. Function dropped. PL/SQL procedure successfully completed.
데이터베이스 PSU 패치 결과 확인
select ACTION_TIME, ACTION, VERSION, COMMENTS from REGISTRY$HISTORY;
SQL> col ACTION_TIME form a30 SQL> col ACTION form a10 SQL> col VERSION form a10 SQL> col COMMENTS form a20 SQL> select ACTION_TIME, ACTION, VERSION, COMMENTS from REGISTRY$HISTORY; ACTION_TIME ACTION VERSION COMMENTS ------------------------------ ---------- ---------- -------------------- 13/08/24 12:03:45.119862 APPLY 11.2.0.4 Patchset 11.2.0.2.0 20/03/27 23:01:46.153471 APPLY 11.2.0.4 Patchset 11.2.0.2.0 20/03/29 00:37:36.930710 APPLY 11.2.0.4 PSU 11.2.0.4.200114 3 rows selected. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options
1 개의 댓글
윤병훈
Can't locate Switch.pm in @INC 에러 발생시 다음 명령 수행