از اوراکل 19.6RU، می توان بدون Downtime در سطح دیتابیس، عملیات Patching را بر روی Grid Infrastructure انجام داد. از اینرو قصد داریم patch شماره 31305339 که مربوط به GI Release Update 19.8 می باشد را بر روی Grid Infrastructure نسخه 19.6 اعمال کنیم(در محیط کلاستر).
به صورت کلی می توان این عملیات را در دو مرحله زیر خلاصه کرد:
1.نصب گرید 19cR3 به صورت Software only و اعمال پچ 19.8RU بر روی آن
2.سوییچ بین grid 19.6 و grid 19.8 با اجرای دستور gridSetup.sh به همراه پارامتر SwitchGridhome
در ادامه متن، نحوه انجام این عملیات را تشریح خواهیم کرد.
مرحله اول: بررسی وضعیت جاری کلاستر و ثبت زمان استارت دیتابیس قبل از شروع عملیات ارتقا
[root@RAC1 ~]# ps -ef | grep d.bin
root 983 1 1 Sep09 ? 00:11:05 /grid19c/home/bin/ohasd.bin reboot
grid 1203 1 0 Sep09 ? 00:02:23 /grid19c/home/bin/mdnsd.bin
grid 1204 1 0 Sep09 ? 00:05:22 /grid19c/home/bin/evmd.bin
grid 1232 1 0 Sep09 ? 00:02:27 /grid19c/home/bin/gpnpd.bin
grid 1316 1 0 Sep09 ? 00:05:12 /grid19c/home/bin/gipcd.bin
root 1371 1 1 Sep09 ? 00:18:57 /grid19c/home/bin/osysmond.bin
grid 1422 1 0 Sep09 ? 00:07:38 /grid19c/home/bin/ocssd.bin
root 1715 1 0 Sep09 ? 00:05:30 /grid19c/home/bin/octssd.bin reboot
root 1769 1 1 Sep09 ? 00:14:28 /grid19c/home/bin/crsd.bin reboot
[grid@RAC1 ~]$ sqlplus “/as sysasm”
SQL*Plus: Release 19.0.0.0.0 – Production on Thu Sep 10 09:26:05 2020
Version 19.6.0.0.0
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
SQL> select inst_id,status,to_char(startup_time,’YYYY/MM/DD HH24:mi:ss’,’NLS_CALENDAR=persian’) startup_time from gv$instance;
INST_ID STATUS STARTUP_TIME
———- ———- ——————–
2 STARTED 1399/06/19 17:18:40
1 STARTED 1399/06/19 16:56:06
قبل از ارتقا بررسی می کنیم که instance مربوط به دیتابیس، از چه زمانی استارت شده است:
[oracle@RAC1 ~]$ sqlplus “/as sysdba”
SQL*Plus: Release 18.0.0.0.0 – Production on Thu Sep 10 09:31:57 2020
Version 18.3.0.0.0
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 – Production
SQL> select inst_id,status,to_char(startup_time,’YYYY/MM/DD HH24:mi:ss’,’NLS_CALENDAR=persian’) startup_time from gv$instance;
INST_ID STATUS STARTUP_TIME
———- ———— ——————-
1 OPEN 1399/06/19 16:56:28
2 OPEN 1399/06/19 17:19:01
توجه: نسخه دیتابیس، 18c است که ما در این متن، قصد ارتقای آن را نداریم.
مرحله دوم: آماده سازی مقدمات نصب Grid Infrastructure 19cR3
برای نصب گرید 19cR3 (جدید)، دایرکتورهای زیر را در هر دو نود ایجاد می کنیم:
[root@RAC1 ~]# mkdir -p /grid19.8/home
[root@RAC1 ~]# mkdir -p /grid19.8/base
[root@RAC1 ~]# chown -R grid.oinstall /grid19.8
[root@RAC2 ~]# mkdir -p /grid19.8/home
[root@RAC2 ~]# mkdir -p /grid19.8/base
[root@RAC2 ~]# chown -R grid.oinstall /grid19.8
سورس نرم افزار گرید را در نود RAC1 و در مسیر grid19.8/home/ از حالت ZIP خارج می کنیم(unzip):
[grid@RAC1 ~]$ unzip /source/LINUX.X64_193000_grid_home.zip -d /grid19.8/home
Patch شماره 31305339 را در مسیر دلخواه unzip می کنیم:
[grid@RAC1 ~]$ unzip /source/19cR8/p31305339_190000_Linux-x86-64_5.zip -d /grid19.8/home
برای اعمال این شماره از patch، نیاز است تا نسخه opatch حداقل برابر با 12.2.0.1.21 باشد بنابرین ضمن دانلود patch شماره 6880880، ان را در مسیر ORACLE_HOME$ برمی گردانیم:
[grid@RAC1 ~]$ unzip /source/p6880880_190000_Linux-x86-64.zip -d /grid19.8/home
[grid@RAC1 ~]$ cd /grid19.8/home/OPatch/
[grid@RAC1 OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.21
OPatch succeeded.
مرحله سوم: نصب نرم افزار Grid Infrastructure 19cR3
در حین نصب نرم افزار گرید، برای اعمال patch شماره 31305339، از سوییچ applyPSU به همراه اجرای دستور gridSetup.sh استفاده می کنیم:
[grid@RAC1 ~]$ cd /grid19.8/home
[grid@RAC1 home]$ ./gridSetup.sh -applyPSU /grid19.8/home/31305339
Preparing the home to patch…
Applying the patch /grid19.8/home/31305339…
Successfully applied the patch.
The log can be found at: /grid18c/oraInventory/logs/GridSetupActions2020-09-10_10-15-21AM/installerPatchActions_2020-09-10_10-15-21AM.log
Launching Oracle Grid Infrastructure Setup Wizard…
[root@RAC1 ~]# /grid19.8/home/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /grid19.8/home
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of “dbhome” have not changed. No need to overwrite.
The contents of “oraenv” have not changed. No need to overwrite.
The contents of “coraenv” have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Cluster execute the following command as grid user:/grid19.8/home/gridSetup.sh
This command launches the Grid Infrastructure Setup Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.
[root@RAC2 ~]# /grid19.8/home/root.sh
مرحله چهارم: سوییچ بین دو گرید
در این مرحله قصد داریم بین دو نرم افزار Grid Infrastructure نسخه 19.6 و 19.8 سوییج کنیم. برای این کار نیاز است تا دستور gridSetup.sh را به همراه پارامتر SwitchGridhome اجرا کنیم:
[grid@RAC1 ~]$ cd /grid19.8/home
[grid@RAC1 home]$ ./gridSetup.sh -SwitchGridhome
Launching Oracle Grid Infrastructure Setup Wizard…
نکته مهم در این قسمت، اجرای اسکریپت root.sh به همراه سوییچهایtransparent و nodriverupdate می باشد بنابرین دو اسکریپت زیر را در هر دو نود اجرا می کنیم:
[root@RAC1 ~]# /grid19.8/home/root.sh -transparent -nodriverupdate
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /grid19.8/home
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of “dbhome” have not changed. No need to overwrite.
The contents of “oraenv” have not changed. No need to overwrite.
The contents of “coraenv” have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
LD_LIBRARY_PATH=’/grid19c/home/lib:/grid19.8/home/lib:’
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac1/crsconfig/rootcrs_rac1_2020-09-10_10-55-03AM.log
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac1/crsconfig/rootcrs_rac1_2020-09-10_10-55-03AM.log
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac1/crsconfig/crs_prepatch_rac1_2020-09-10_10-55-04AM.log
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac1/crsconfig/crs_prepatch_rac1_2020-09-10_10-55-05AM.log
2020/09/10 10:55:23 CLSRSC-347: Successfully unlock /grid19.8/home
2020/09/10 10:55:24 CLSRSC-671: Pre-patch steps for patching GI home successfully completed.
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac1/crsconfig/crs_postpatch_rac1_2020-09-10_10-55-24AM.log
Oracle Clusterware active version on the cluster is [19.0.0.0.0]. The cluster upgrade state is [NORMAL]. The cluster active patch level is [387459443].
2020/09/10 10:55:47 CLSRSC-329: Replacing Clusterware entries in file ‘oracle-ohasd_dummy.service’
2020/09/10 10:56:30 CLSRSC-329: Replacing Clusterware entries in file ‘oracle-ohasd.service’
Oracle Clusterware active version on the cluster is [19.0.0.0.0]. The cluster upgrade state is [ROLLING PATCH]. The cluster active patch level is [387459443].
2020/09/10 10:57:50 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
2020/09/10 10:57:51 CLSRSC-672: Post-patch steps for patching GI home successfully completed.
اجرای اسکریپت در نود دوم:
[root@RAC2 ~]# /grid19.8/home/root.sh -transparent -nodriverupdate
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /grid19.8/home
Relinking oracle with rac_on option
LD_LIBRARY_PATH=’/grid19c/home/lib:/grid19.8/home/lib:’
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac2/crsconfig/rootcrs_rac2_2020-09-10_11-01-23AM.log
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac2/crsconfig/rootcrs_rac2_2020-09-10_11-01-23AM.log
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac2/crsconfig/crs_prepatch_rac2_2020-09-10_11-01-23AM.log
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac2/crsconfig/crs_prepatch_rac2_2020-09-10_11-01-24AM.log
2020/09/10 11:01:44 CLSRSC-347: Successfully unlock /grid19.8/home
2020/09/10 11:01:45 CLSRSC-671: Pre-patch steps for patching GI home successfully completed.
Using configuration parameter file: /grid19.8/home/crs/install/crsconfig_params
The log of current session can be found at:
/grid18c/base/crsdata/rac2/crsconfig/crs_postpatch_rac2_2020-09-10_11-01-45AM.log
Oracle Clusterware active version on the cluster is [19.0.0.0.0]. The cluster upgrade state is [ROLLING PATCH]. The cluster active patch level is [387459443].
2020/09/10 11:02:03 CLSRSC-329: Replacing Clusterware entries in file ‘oracle-ohasd_dummy.service’
2020/09/10 11:04:12 CLSRSC-329: Replacing Clusterware entries in file ‘oracle-ohasd.service’
Oracle Clusterware active version on the cluster is [19.0.0.0.0]. The cluster upgrade state is [NORMAL]. The cluster active patch level is [441346801].
SQL Patching tool version 19.8.0.0.0 Production on Thu Sep 10 11:07:50 2020
Copyright (c) 2012, 2020, Oracle. All rights reserved.
Log file for this invocation: /grid18c/base/cfgtoollogs/sqlpatch/sqlpatch_8542_2020_09_10_11_07_50/sqlpatch_invocation.log
Connecting to database…OK
Gathering database info…done
Note: Datapatch will only apply or rollback SQL fixes for PDBs
that are in an open state, no patches will be applied to closed PDBs.
Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
(Doc ID 1585822.1)
Bootstrapping registry and package to current versions…done
Determining current state…done
Current state of interim SQL patches:
No interim patches found
Current state of release update SQL patches:
Binary registry:
19.8.0.0.0 Release_Update 200703031501: Installed
PDB CDB$ROOT:
Applied 19.6.0.0.0 Release_Update 191217155004 successfully on 09-SEP-20 05.30.19.517896 PM
PDB GIMR_DSCREP_10:
Applied 19.6.0.0.0 Release_Update 191217155004 successfully on 09-SEP-20 05.30.22.713305 PM
PDB PDB$SEED:
Applied 19.6.0.0.0 Release_Update 191217155004 successfully on 09-SEP-20 05.30.22.241977 PM
Adding patches to installation queue and performing prereq checks…done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED GIMR_DSCREP_10
No interim patches need to be rolled back
Patch 31281355 (Database Release Update : 19.8.0.0.200714 (31281355)):
Apply from 19.6.0.0.0 Release_Update 191217155004 to 19.8.0.0.0 Release_Update 200703031501
No interim patches need to be applied
Installing patches…
Patch installation complete. Total patches installed: 3
Validating logfiles…done
Patch 31281355 apply (pdb CDB$ROOT): SUCCESS
logfile: /grid18c/base/cfgtoollogs/sqlpatch/31281355/23688465/31281355_apply__MGMTDB_CDBROOT_2020Sep10_11_08_54.log (no errors)
Patch 31281355 apply (pdb PDB$SEED): SUCCESS
logfile: /grid18c/base/cfgtoollogs/sqlpatch/31281355/23688465/31281355_apply__MGMTDB_PDBSEED_2020Sep10_11_10_27.log (no errors)
Patch 31281355 apply (pdb GIMR_DSCREP_10): SUCCESS
logfile: /grid18c/base/cfgtoollogs/sqlpatch/31281355/23688465/31281355_apply__MGMTDB_GIMR_DSCREP_10_2020Sep10_11_10_27.log (no errors)
SQL Patching tool complete on Thu Sep 10 11:12:09 2020
2020/09/10 11:13:14 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
2020/09/10 11:13:25 CLSRSC-672: Post-patch steps for patching GI home successfully completed.
در حین اجرای اسکریپت root.sh، وضعیت پروسس PMON را برای دو instance مربوط به ASM و RDBMS زیر نظر داشتیم:
[root@RAC1 ~]# ps -eaf|grep pmon
grid 2504 1 0 Sep09 ? 00:00:03 asm_pmon_+ASM1
oracle 2931 1 0 Sep09 ? 00:00:04 ora_pmon_db18c1
[root@RAC1 ~]# ps -eaf|grep pmon
oracle 2931 1 0 Sep09 ? 00:00:04 ora_pmon_db18c1
[root@RAC1 ~]# ps -eaf|grep pmon
oracle 2931 1 0 Sep09 ? 00:00:04 ora_pmon_db18c1
grid 8860 1 0 10:57 ? 00:00:00 asm_pmon_+ASM1
بر اساس خروجی دستور ps، مشاهده می کنید که ASM1+ برای مدتی down شده است اما db18c1 downtimeای نداشته است. برای اطمینان از این مسئله، زمان startup time دو instance را نسبت به زمان استارت عملیات patching مقایسه می کنیم:
—ASM:
[grid@RAC1 ~]$ sqlplus “/as sysasm”
SQL*Plus: Release 19.0.0.0.0 – Production on Thu Sep 10 11:05:39 2020
Version 19.8.0.0.0
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
SQL>
SQL> select inst_id,status,to_char(startup_time,’YYYY/MM/DD HH24:mi:ss’,’NLS_CALENDAR=persian’) startup_time from gv$instance;
INST_ID STATUS STARTUP_TIME
———- ———- ——————–
1 STARTED 1399/06/20 10:57:25
2 STARTED 1399/06/20 11:05:10
–RDBMS:
[oracle@RAC1 ~]$ sqlplus “/as sysdba”
SQL*Plus: Release 18.0.0.0.0 – Production on Thu Sep 10 11:08:16 2020
Version 18.3.0.0.0
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 – Production
SQL> select inst_id,status,to_char(startup_time,’YYYY/MM/DD HH24:mi:ss’,’NLS_CALENDAR=persian’) startup_time from gv$instance;
INST_ID STATUS STARTUP_TIME
———- ———— ——————-
1 OPEN 1399/06/19 16:56:28
2 OPEN 1399/06/19 17:19:01
در انتها خواهیم دید که پروسسهای کلاستر از مسیر گرید 19.8 در حال اجرا هستند:
[root@RAC1 ~]# ps -eaf|grep d.bin
root 5911 1 2 10:56 ? 00:00:08 /grid19.8/home/bin/ohasd.bin reboot
grid 6243 1 1 10:56 ? 00:00:07 /grid19.8/home/bin/evmd.bin
grid 6246 1 0 10:56 ? 00:00:01 /grid19.8/home/bin/gpnpd.bin
grid 6250 1 0 10:56 ? 00:00:01 /grid19.8/home/bin/mdnsd.bin
grid 6446 1 0 10:56 ? 00:00:02 /grid19.8/home/bin/gipcd.bin
grid 6599 1 1 10:56 ? 00:00:05 /grid19.8/home/bin/ocssd.bin -P
root 6889 1 0 10:56 ? 00:00:02 /grid19.8/home/bin/octssd.bin reboot
root 7193 1 2 10:56 ? 00:00:09 /grid19.8/home/bin/crsd.bin reboot
root 7211 1 2 10:56 ? 00:00:07 /grid19.8/home/bin/osysmond.bin
Comment (1)