MÔ TẢ
Trong bài viết này tôi sẽ hướng dẫn các bạn từng bước Apply PSU Patch trên moi trường Oracle Dataguard
Những bước cần chú ý khi applay patch:
- Trên Primary site dừng chuyển log tới standby database và Stop MRP trên standby site
- Shutdown Standby Database và Listener
- Apply PSU patch trên Standby site
- Shutdown Primary database và Listener.
- Apply PSU Patch trên Primary Site
- Enable Log shipping trên Primary
- Thực thi Post installation Scripts (datapatch)
- Monitor redo apply từ Primary tới Standby
CHI TIẾT MÔI TRƯỜNG
Chi tiết Primary Database:prime> select status,instance_name,database_role,open_mode from v$database,v$Instance;
STATUS INSTANCE_NAME DATABASE_ROLE OPEN_MODE
———— —————- —————- ———–
OPEN prime PRIMARY READ WRITE
Chi tiết Standby Database:
Stand> select status,instance_name,database_role,open_mode from v$database,v$Instance;
STATUS INSTANCE_NAME DATABASE_ROLE OPEN_MODE
———— —————- —————- ———–
OPEN stand PHYSICAL STANDBY READ ONLY WITH APPLY
THỦ TỤC
Opatch Version
Oracle khuyến nghị nên dùng bán cuối cùng OPatch 12.1 tool bằng cách download và apply the patch: 6880880 từ support.oracle.com hay từ https://updates.oracle.com/download/6880880.html
Current version of Opatch Tool in our environment
export PATH=$ORACLE_HOME/OPatch:$PATH
[oracle@primary ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH
[oracle@primary ~]$ opatch version
OPatch Version: 12.1.0.1.3
OPatch succeeded.
Các bước chuẩn bị:
Cài đặt Opatch (cả Primary & Standby Side)
1. Download Opatch mới nhất từ from oracle support
[oracle@primary u01]$ ls -lrt
total 424836
drwxrwxr-x. 2 oracle oinstall 16384 Jun 11 23:28 lost+found
drwxrwxr-x. 4 oracle oinstall 4096 Jun 12 01:32 app
-rwxr-xr-x. 1 oracle oinstall 337586889 Jun 15 13:40 p25755742_121020_Linux-x86-64.zip
-rwxr-xr-x. 1 oracle oinstall 97422646 Jun 15 13:40 p6880880_121010_Linux-x86-64.zip
2. Thực hiện backup phiên bản cũ của OPatch trong $ORACLE_HOME và unzip file vừa download
[oracle@primary ~]$ cd $ORACLE_HOME
[oracle@primary db_1]$ mv OPatch OPatch.bkp.15.06.18
[oracle@primary db_1]$ unzip p6880880_121010_Linux-x86-64.zip
cd OPatch
oracle@primary OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.13
OPatch succeeded.
3. Thêm OPatch trong biến PATH của file .bash_profile
export PATH=$ORACLE_HOME/OPatch:$PATH
[oracle@primary db_1]$ export PATH=/u01/app/oracle/product/12.1.0.2/db_1/OPatch:$PATH
[oracle@primary db_1]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.13
Copyright (c) 2018, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0.2/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0.2/db_1/oraInst.loc
OPatch version : 12.2.0.1.13
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2018-06-15_14-29-03PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-15_14-29-03PM.txt
——————————————————————————–
Local Machine Information::
Hostname: primary
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
——————————————————————————–
OPatch succeeded.
Thực hiện Backup ORACLE_HOME (cả primary & Standby side) (để sau này cần thì Rollback)
[oracle@primary u01]$ tar -cvf oracle_home_jun1518.tar $ORACLE_HOME
Bước 1: Trên Primary site disable chuyển log sang standby database và Stop MRP trên standby site
DGMGRL> show configuration
Configuration – hari
Protection Mode: MaxPerformance
Members:
prime – Primary database
stand – Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 13 seconds ago)
DGMGRL> edit database prime set state=’LOG-TRANSPORT-OFF’;
Succeeded.
prime> show parameter log_archive_dest_state_2
NAME TYPE VALUE
———————— ———– ——-
log_archive_dest_state_2 string RESE
stand> alter database recover managed standby database cancel;
Database altered.
Bước 2: Shutdown Standby Database và Listener
[oracle@standby ~]$ export ORACLE_SID=stand
[oracle@standby ~]$ sqlplus ‘/as sysdba’
SQL*Plus: Release 12.1.0.2.0 Production on Fri Jun 15 16:39:06 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@standby ~]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 15-JUN-2018 16:39:44
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.25)(PORT=1539)))
The command completed successfully
Bước 3: Apply PSU patch trên Standby site
[oracle@standby u01]$ unzip p25755742_121020_Linux-x86-64.zip
[oracle@standby u01]$ ls -lrt
total 424936
drwxrwxr-x. 13 oracle oinstall 4096 Jun 29 2017 25755742
-rw-rw-r–. 1 oracle oinstall 96270 Aug 7 2017 PatchSearch.xml
drwxrwxr-x. 2 oracle oinstall 16384 Jun 11 23:28 lost+found
drwxrwxr-x. 4 oracle oinstall 4096 Jun 12 01:32 app
-rwxr-xr-x. 1 oracle oinstall 337586889 Jun 15 13:41 p25755742_121020_Linux-x86-64.zip
-rwxr-xr-x. 1 oracle oinstall 97422646 Jun 15 13:41 p6880880_121010_Linux-x86-64.zip
[oracle@standby u01]$ export PATH=/u01/app/oracle/product/12.1.0.2/db_1/OPatch:$PATH
[oracle@standby u01]$ cd 25755742/
[oracle@standby 25755742]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.13
Copyright (c) 2018, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0.2/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0.2/db_1/oraInst.loc
OPatch version : 12.2.0.1.13
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2018-06-15_16-50-22PM_1.log
Verifying environment and performing prerequisite checks…
OPatch continues with these patches: 19769480 20299023 20831110 21359755 21948354 22291127 23054246 24006101 24732082 25171037 25755742
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = ‘/u01/app/oracle/product/12.1.0.2/db_1’)
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files…
Applying sub-patch ‘19769480’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.xdk, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.util, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.xdk.parser.java, 12.1.0.2.0…
Patching component oracle.oraolap, 12.1.0.2.0…
Patching component oracle.xdk.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0…
Applying sub-patch ‘20299023’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
ApplySession: Optional component(s) [ oracle.has.crs, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf.ic, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0…
Applying sub-patch ‘20831110’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.oraolap.dbscripts, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Applying sub-patch ‘21359755’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.assistants.server, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Applying sub-patch ‘21948354’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.xdk, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.xdk.parser.java, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.xdk.rsf, 12.1.0.2.0…
Applying sub-patch ‘22291127’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
ApplySession: Optional component(s) [ oracle.oid.client, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.client, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.oraolap, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.oraolap.dbscripts, 12.1.0.2.0…
Applying sub-patch ‘23054246’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.dv, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.install.deinstalltool, 12.1.0.2.0…
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0…
Patching component oracle.oracore.rsf, 12.1.0.2.0…
Patching component oracle.ctx, 12.1.0.2.0…
Patching component oracle.xdk, 12.1.0.2.0…
Patching component oracle.nlsrtl.rsf, 12.1.0.2.0…
Patching component oracle.xdk.parser.java, 12.1.0.2.0…
Patching component oracle.ctx.atg, 12.1.0.2.0…
Applying sub-patch ‘24006101’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.sqlplus, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.network.listener, 12.1.0.2.0…
Patching component oracle.network.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.dv, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.sqlplus.ic, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Applying sub-patch ‘24732082’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.install.plugins, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Applying sub-patch ‘25171037’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.sqlplus.ic, 12.1.0.2.0…
Patching component oracle.sqlplus, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.ordim.client, 12.1.0.2.0…
Patching component oracle.ordim.client, 12.1.0.2.0…
Patching component oracle.ordim.jai, 12.1.0.2.0…
Patching component oracle.ordim.server, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms.install.plugins, 12.1.0.2.0…
Patching component oracle.javavm.containers, 12.1.0.2.0…
Applying sub-patch ‘25755742’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
ApplySession: Optional component(s) [ oracle.oid.client, 12.1.0.2.0 ] , [ oracle.has.crs, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.network.rsf, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.client, 12.1.0.2.0…
Patching component oracle.oracore.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.network.listener, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Composite patch 25755742 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2018-06-15_16-50-22PM_1.log
OPatch succeeded.
Bước 4:-Shutdown Primary database và Listener.
[oracle@primary ~]$ export ORACLE_SID=prime
[oracle@primary ~]$ sqlplus ‘/as sysdba’
SQL*Plus: Release 12.1.0.2.0 Production on Fri Jun 15 17:02:39 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@primary ~]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 15-JUN-2018 17:03:26
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.24)(PORT=1539)))
The command completed successfully
Bước 5:-Apply PSU Patch trên Primary Site
[oracle@primary ~]$ cd /u01/25755742/
[oracle@primary 25755742]$ export PATH=/u01/app/oracle/product/12.1.0.2/db_1/OPatch:$PATH
[oracle@primary 25755742]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.13
Copyright (c) 2018, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0.2/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0.2/db_1/oraInst.loc
OPatch version : 12.2.0.1.13
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2018-06-15_17-06-26PM_1.log
Verifying environment and performing prerequisite checks…
OPatch continues with these patches: 19769480 20299023 20831110 21359755 21948354 22291127 23054246 24006101 24732082 25171037 25755742
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = ‘/u01/app/oracle/product/12.1.0.2/db_1’)
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files…
Applying sub-patch ‘19769480’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.xdk, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.util, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.xdk.parser.java, 12.1.0.2.0…
Patching component oracle.oraolap, 12.1.0.2.0…
Patching component oracle.xdk.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0…
Applying sub-patch ‘20299023’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
ApplySession: Optional component(s) [ oracle.has.crs, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf.ic, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0…
Applying sub-patch ‘20831110’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.oraolap.dbscripts, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Applying sub-patch ‘21359755’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.assistants.server, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Applying sub-patch ‘21948354’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.xdk, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.xdk.parser.java, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.xdk.rsf, 12.1.0.2.0…
Applying sub-patch ‘22291127’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
ApplySession: Optional component(s) [ oracle.oid.client, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.client, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.oraolap, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.oraolap.dbscripts, 12.1.0.2.0…
Applying sub-patch ‘23054246’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.dv, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.install.deinstalltool, 12.1.0.2.0…
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0…
Patching component oracle.oracore.rsf, 12.1.0.2.0…
Patching component oracle.ctx, 12.1.0.2.0…
Patching component oracle.xdk, 12.1.0.2.0…
Patching component oracle.nlsrtl.rsf, 12.1.0.2.0…
Patching component oracle.xdk.parser.java, 12.1.0.2.0…
Patching component oracle.ctx.atg, 12.1.0.2.0…
Applying sub-patch ‘24006101’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.sqlplus, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.network.listener, 12.1.0.2.0…
Patching component oracle.network.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.dv, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.sqlplus.ic, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Applying sub-patch ‘24732082’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.rdbms.install.plugins, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Applying sub-patch ‘25171037’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
Patching component oracle.sqlplus.ic, 12.1.0.2.0…
Patching component oracle.sqlplus, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.ordim.client, 12.1.0.2.0…
Patching component oracle.ordim.client, 12.1.0.2.0…
Patching component oracle.ordim.jai, 12.1.0.2.0…
Patching component oracle.ordim.server, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Patching component oracle.rdbms.install.plugins, 12.1.0.2.0…
Patching component oracle.javavm.containers, 12.1.0.2.0…
Applying sub-patch ‘25755742’ to OH ‘/u01/app/oracle/product/12.1.0.2/db_1’
ApplySession: Optional component(s) [ oracle.oid.client, 12.1.0.2.0 ] , [ oracle.has.crs, 12.1.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.network.rsf, 12.1.0.2.0…
Patching component oracle.ldap.rsf, 12.1.0.2.0…
Patching component oracle.ldap.client, 12.1.0.2.0…
Patching component oracle.oracore.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.deconfig, 12.1.0.2.0…
Patching component oracle.tfa, 12.1.0.2.0…
Patching component oracle.network.listener, 12.1.0.2.0…
Patching component oracle.rdbms, 12.1.0.2.0…
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0…
Patching component oracle.rdbms.rsf, 12.1.0.2.0…
Patching component oracle.rdbms.rman, 12.1.0.2.0…
Composite patch 25755742 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2018-06-15_17-06-26PM_1.log
OPatch succeeded.
Bước 6:-Enable chuyển Log trên Primary
Bật database và listener trên cả 2 side
DGMGRL> edit database prime set state=’ONLINE’;
Succeeded.
Bước 7: Thực thi Post installation Scripts (datapatch)
[oracle@primary OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Fri Jun 15 18:27:13 2018
Copyright (c) 2012, 2016, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_10585_2018_06_15_18_27_13/sqlpatch_invocation.log
Connecting to database…OK
Bootstrapping registry and package to current versions…done
Determining current state…done
Current state of SQL patches:
Bundle series PSU:
ID 170718 in the binary registry and not installed in the SQL registry
Adding patches to installation queue and performing prereq checks…
Installation queue:
Nothing to roll back
The following patches will be applied:
25755742 (DATABASE PATCH SET UPDATE 12.1.0.2.170718)
Installing patches…
Patch installation complete. Total patches installed: 1
Validating logfiles…
Patch 25755742 apply: SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/25755742/21385018/25755742_apply_PRIME_2018Jun15_18_27_37.log (no errors)
SQL Patching tool complete on Fri Jun 15 18:28:34 2018
Bước 8: Monitor redo apply từ Primary tới Standby
SQL> SELECT ARCH.THREAD# “Thread”, ARCH.SEQUENCE# “Last Sequence Received”,
APPL.SEQUENCE# “Last Sequence Applied”, (ARCH.SEQUENCE# – APPL.SEQUENCE#) “Difference”
FROM
(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE
ARCH.THREAD# = APPL.THREAD#
ORDER BY 1; 2 3 4 5 6 7 8 9 10
Thread Last Sequence Received Last Sequence Applied Difference
———- ———————- ——————— ———-
1 18 18 0
Bước 9: Opatch Status
[oracle@primary ~]$ export PATH=/u01/app/oracle/product/12.1.0.2/db_1/OPatch:$PATH
[oracle@primary ~]$ opatch lsinventory|grep 25755742
Patch 25755742 : applied on Fri Jun 15 17:11:29 IST 2018
Patch description: “Database Patch Set Update : 12.1.0.2.170718 (25755742)”
[oracle@standby 25755742]$ export PATH=/u01/app/oracle/product/12.1.0.2/db_1/OPatch:$PATH
[oracle@standby 25755742]$ opatch lsinventory|grep 25755742
Patch 25755742 : applied on Fri Jun 15 16:55:37 IST 2018
Patch description: “Database Patch Set Update : 12.1.0.2.170718 (25755742)”
SQL> select PATCH_ID,ACTION_TIME,STATUS,DESCRIPTION from registry$sqlpatch;
PATCH_ID ACTION_TIME STATUS DESCRIPTION
———- —————————— ————— —
25755742 15-JUN-18 06.28.34.330133 PM SUCCESS DATABASE PATCH SET UPDATE 12.1.0.2.170718
Bạn đã thành công apply PSU Patch trên môi trường Oracle Dataguard 12.1
Hy vọng hữu ích cho bạn.
* KHOÁ HỌC ORACLE DATABASE A-Z ENTERPRISE trực tiếp từ tôi giúp bạn bước đầu trở thành những chuyên gia DBA, đủ kinh nghiệm đi thi chứng chỉ OA/OCP, đặc biệt là rất nhiều kinh nghiệm, bí kíp thực chiến trên các hệ thống Core tại VN chỉ sau 1 khoá học.
* CÁCH ĐĂNG KÝ: Gõ (.) hoặc để lại số điện thoại hoặc inbox https://m.me/tranvanbinh.vn hoặc Hotline/Zalo 090.29.12.888
* Chi tiết tham khảo:
https://bit.ly/oaz_w
=============================
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile: 0902912888
⚡️ Skype: tranbinh48ca
👨 Facebook: https://www.facebook.com/BinhOracleMaster
👨 Inbox Messenger: https://m.me/101036604657441 (profile)
👨 Fanpage: https://www.facebook.com/tranvanbinh.vn
👨 Inbox Fanpage: https://m.me/tranvanbinh.vn
👨👩 Group FB: https://www.facebook.com/groups/DBAVietNam
👨 Website: https://www.tranvanbinh.vn
👨 Blogger: https://tranvanbinhmaster.blogspot.com
🎬 Youtube: http://bit.ly/ytb_binhoraclemaster
👨 Tiktok: https://www.tiktok.com/@binhoraclemaster?lang=vi
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhoracle
👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội
=============================
học oracle database, Tự học Oracle, Tài liệu Oracle 12c tiếng Việt, Hướng dẫn sử dụng Oracle Database, Oracle SQL cơ bản, Oracle SQL là gì, Khóa học Oracle Hà Nội, Học chứng chỉ Oracle ở đầu, Khóa học Oracle online,khóa học pl/sql, học dba, học dba ở việt nam, khóa học dba, khóa học dba sql, tài liệu học dba oracle, Khóa học Oracle online, học oracle sql, học oracle ở đâu tphcm, học oracle bắt đầu từ đâu, học oracle ở hà nội, oracle database tutorial, oracle database 12c, oracle database là gì, oracle database 11g, oracle download, oracle database 19c, oracle dba tutorial, oracle tunning, sql tunning , oracle 12c, oracle multitenant, Container Databases (CDB), Pluggable Databases (PDB), oracle cloud, oracle security, oracle fga, audit_trail, oracle dataguard, oracle goldengate, mview, oracle exadata, oracle weblogic, middleware, hoc solaris, hoc linux, hoc aix, unix, oracle oca, oracle ocp, oracle ocm