数据库:11.2.0.4
系统:rhel 7.9
主库:OEL791
备库:OEL792
1、升级前备份数据库
RMAN>run {
allocatechannel d1 type disk;
allocatechannel d2 type disk;
allocatechannel d3 type disk;
allocatechannel d4 type disk;
backupas compressed backupset database format '/home/oracle/rman/data_%d_%T_%s.bak’plus archivelog format ‘/home/oracle/rman/arch_%d_%T_%s.bak’;
releasechannel d1;
releasechannel d2;
releasechannel d3;
releasechannel d4;
}
2、升级包
说明:主备库均上传
sftp>cd /soft
sftp>lcd F:\BaiduNetdiskDownload\2110最新补丁集-文档2118136.2\11GR2-201020\OPatch
sftp>put p6880880_112000_Linux-x86-64.zip
[root@OEL791/]# chown -R oracle:oinstall /soft
[root@OEL791soft]# su - oracle -c “unzip -q -o /soft/p6880880_112000_Linux-x86-64.zip-d /u01/app/oracle/product/11.2.0/db_1/”
[oracle@OEL791OPatch]$ opatch version
OPatchVersion: 11.2.0.3.31
OPatchsucceeded.
[root@OEL791soft]# su - oracle -c “unzip -q -o /soft/p31537677_112040_Linux-x86-64.zip-d /soft”
3、检查补丁
[oracle@OEL79131537677]$
O
R
A
C
L
E
H
O
M
E
/
O
P
a
t
c
h
/
o
p
a
t
c
h
p
r
e
r
e
q
C
h
e
c
k
C
o
n
f
l
i
c
t
A
g
a
i
n
s
t
O
H
W
i
t
h
D
e
t
a
i
l
−
p
h
.
/
O
r
a
c
l
e
I
n
t
e
r
i
m
P
a
t
c
h
I
n
s
t
a
l
l
e
r
v
e
r
s
i
o
n
11.2.0.3.4
C
o
p
y
r
i
g
h
t
(
c
)
2012
,
O
r
a
c
l
e
C
o
r
p
o
r
a
t
i
o
n
.
A
l
l
r
i
g
h
t
s
r
e
s
e
r
v
e
d
.
P
R
E
R
E
Q
s
e
s
s
i
o
n
O
r
a
c
l
e
H
o
m
e
:
/
u
01
/
a
p
p
/
o
r
a
c
l
e
/
p
r
o
d
u
c
t
/
11.2.0
/
d
b
1
C
e
n
t
r
a
l
I
n
v
e
n
t
o
r
y
:
/
u
01
/
a
p
p
/
o
r
a
I
n
v
e
n
t
o
r
y
f
r
o
m
:
/
u
01
/
a
p
p
/
o
r
a
c
l
e
/
p
r
o
d
u
c
t
/
11.2.0
/
d
b
1
/
o
r
a
I
n
s
t
.
l
o
c
O
P
a
t
c
h
v
e
r
s
i
o
n
:
11.2.0.3.4
O
U
I
v
e
r
s
i
o
n
:
11.2.0.4.0
L
o
g
f
i
l
e
l
o
c
a
t
i
o
n
:
/
u
01
/
a
p
p
/
o
r
a
c
l
e
/
p
r
o
d
u
c
t
/
11.2.0
/
d
b
1
/
c
f
g
t
o
o
l
l
o
g
s
/
o
p
a
t
c
h
/
o
p
a
t
c
h
2022
−
03
−
2
8
1
3
−
42
−
03
P
M
1
.
l
o
g
I
n
v
o
k
i
n
g
p
r
e
r
e
q
"
c
h
e
c
k
c
o
n
f
l
i
c
t
a
g
a
i
n
s
t
o
h
w
i
t
h
d
e
t
a
i
l
"
P
r
e
r
e
q
"
c
h
e
c
k
C
o
n
f
l
i
c
t
A
g
a
i
n
s
t
O
H
W
i
t
h
D
e
t
a
i
l
"
n
o
t
e
x
e
c
u
t
e
d
U
n
a
b
l
e
t
o
c
r
e
a
t
e
P
a
t
c
h
O
b
j
e
c
t
.
E
x
c
e
p
t
i
o
n
o
c
c
u
r
e
d
:
V
e
r
s
i
o
n
f
i
e
l
d
o
f
t
h
e
c
o
m
p
o
n
e
n
t
"
d
e
l
e
t
e
"
i
n
a
c
t
i
o
n
s
f
i
l
e
c
a
n
n
o
t
b
e
<
n
u
l
l
>
o
r
e
m
p
t
y
.
P
l
e
a
s
e
c
h
e
c
k
p
a
t
c
h
m
e
t
a
d
a
t
a
.
O
P
a
t
c
h
s
u
c
c
e
e
d
e
d
.
[
o
r
a
c
l
e
@
O
E
L
79231537677
]
ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail-ph ./ OracleInterim Patch Installer version 11.2.0.3.4 Copyright(c) 2012, Oracle Corporation. All rightsreserved. PREREQsession OracleHome :/u01/app/oracle/product/11.2.0/db_1 CentralInventory : /u01/app/oraInventory from :/u01/app/oracle/product/11.2.0/db_1/oraInst.loc OPatchversion : 11.2.0.3.4 OUIversion : 11.2.0.4.0 Log filelocation :/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2022-03-28_13-42-03PM_1.log Invokingprereq "checkconflictagainstohwithdetail" Prereq"checkConflictAgainstOHWithDetail"not executed Unable tocreate Patch Object. Exceptionoccured : Version field of the component "delete" in actions filecannot be <null> or empty. Please check patch metadata. OPatchsucceeded. [oracle@OEL79231537677]
ORACLEHOME/OPatch/opatchprereqCheckConflictAgainstOHWithDetail−ph./OracleInterimPatchInstallerversion11.2.0.3.4Copyright(c)2012,OracleCorporation.Allrightsreserved.PREREQsessionOracleHome:/u01/app/oracle/product/11.2.0/db1CentralInventory:/u01/app/oraInventoryfrom:/u01/app/oracle/product/11.2.0/db1/oraInst.locOPatchversion:11.2.0.3.4OUIversion:11.2.0.4.0Logfilelocation:/u01/app/oracle/product/11.2.0/db1/cfgtoollogs/opatch/opatch2022−03−2813−42−03PM1.logInvokingprereq"checkconflictagainstohwithdetail"Prereq"checkConflictAgainstOHWithDetail"notexecutedUnabletocreatePatchObject.Exceptionoccured:Versionfieldofthecomponent"delete"inactionsfilecannotbe<null>orempty.Pleasecheckpatchmetadata.OPatchsucceeded.[oracle@OEL79231537677]
O
R
A
C
L
E
H
O
M
E
/
O
P
a
t
c
h
/
o
p
a
t
c
h
p
r
e
r
e
q
C
h
e
c
k
C
o
n
f
l
i
c
t
A
g
a
i
n
s
t
O
H
W
i
t
h
D
e
t
a
i
l
−
p
h
.
/
O
r
a
c
l
e
I
n
t
e
r
i
m
P
a
t
c
h
I
n
s
t
a
l
l
e
r
v
e
r
s
i
o
n
11.2.0.3.4
C
o
p
y
r
i
g
h
t
(
c
)
2012
,
O
r
a
c
l
e
C
o
r
p
o
r
a
t
i
o
n
.
A
l
l
r
i
g
h
t
s
r
e
s
e
r
v
e
d
.
P
R
E
R
E
Q
s
e
s
s
i
o
n
O
r
a
c
l
e
H
o
m
e
:
/
u
01
/
a
p
p
/
o
r
a
c
l
e
/
p
r
o
d
u
c
t
/
11.2.0
/
d
b
1
C
e
n
t
r
a
l
I
n
v
e
n
t
o
r
y
:
/
u
01
/
a
p
p
/
o
r
a
I
n
v
e
n
t
o
r
y
f
r
o
m
:
/
u
01
/
a
p
p
/
o
r
a
c
l
e
/
p
r
o
d
u
c
t
/
11.2.0
/
d
b
1
/
o
r
a
I
n
s
t
.
l
o
c
O
P
a
t
c
h
v
e
r
s
i
o
n
:
11.2.0.3.4
O
U
I
v
e
r
s
i
o
n
:
11.2.0.4.0
L
o
g
f
i
l
e
l
o
c
a
t
i
o
n
:
/
u
01
/
a
p
p
/
o
r
a
c
l
e
/
p
r
o
d
u
c
t
/
11.2.0
/
d
b
1
/
c
f
g
t
o
o
l
l
o
g
s
/
o
p
a
t
c
h
/
o
p
a
t
c
h
2022
−
03
−
2
8
1
3
−
43
−
19
P
M
1
.
l
o
g
I
n
v
o
k
i
n
g
p
r
e
r
e
q
"
c
h
e
c
k
c
o
n
f
l
i
c
t
a
g
a
i
n
s
t
o
h
w
i
t
h
d
e
t
a
i
l
"
P
r
e
r
e
q
"
c
h
e
c
k
C
o
n
f
l
i
c
t
A
g
a
i
n
s
t
O
H
W
i
t
h
D
e
t
a
i
l
"
n
o
t
e
x
e
c
u
t
e
d
U
n
a
b
l
e
t
o
c
r
e
a
t
e
P
a
t
c
h
O
b
j
e
c
t
.
E
x
c
e
p
t
i
o
n
o
c
c
u
r
e
d
:
V
e
r
s
i
o
n
f
i
e
l
d
o
f
t
h
e
c
o
m
p
o
n
e
n
t
"
d
e
l
e
t
e
"
i
n
a
c
t
i
o
n
s
f
i
l
e
c
a
n
n
o
t
b
e
<
n
u
l
l
>
o
r
e
m
p
t
y
.
P
l
e
a
s
e
c
h
e
c
k
p
a
t
c
h
m
e
t
a
d
a
t
a
.
O
P
a
t
c
h
s
u
c
c
e
e
d
e
d
.
4
、
升
级
说
明
:
升
级
前
关
闭
数
据
库
、
监
听
。
先
打
备
库
补
丁
,
再
打
主
库
,
打
完
后
在
主
库
跑
脚
本
,
改
变
数
据
库
结
构
,
数
据
自
然
会
传
到
备
库
。
主
库
执
行
:
S
Q
L
>
a
l
t
e
r
s
y
s
t
e
m
s
e
t
l
o
g
a
r
c
h
i
v
e
d
e
s
t
s
t
a
t
e
2
=
d
e
f
e
r
s
c
o
p
e
=
b
o
t
h
s
i
d
=
′
∗
′
;
4.1
、
备
库
应
用
o
p
a
t
c
h
备
库
执
行
:
S
Q
L
>
s
e
l
e
c
t
o
p
e
n
m
o
d
e
f
r
o
m
v
ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail-ph ./ OracleInterim Patch Installer version 11.2.0.3.4 Copyright(c) 2012, Oracle Corporation. All rightsreserved. PREREQsession Oracle Home : /u01/app/oracle/product/11.2.0/db_1 CentralInventory : /u01/app/oraInventory from :/u01/app/oracle/product/11.2.0/db_1/oraInst.loc OPatchversion : 11.2.0.3.4 OUIversion : 11.2.0.4.0 Log filelocation : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2022-03-28_13-43-19PM_1.log Invokingprereq "checkconflictagainstohwithdetail" Prereq"checkConflictAgainstOHWithDetail"not executed Unable tocreate Patch Object. Exceptionoccured : Version field of the component "delete" in actions filecannot be <null> or empty. Please check patch metadata. OPatchsucceeded. 4、升级 说明:升级前关闭数据库、监听。 先打备库补丁,再打主库,打完后在主库跑脚本,改变数据库结构,数据自然会传到备库。 主库执行: SQL>alter system set log_archive_dest_state_2=defer scope=both sid='*'; 4.1、备库应用opatch 备库执行: SQL>select open_mode from v
ORACLEHOME/OPatch/opatchprereqCheckConflictAgainstOHWithDetail−ph./OracleInterimPatchInstallerversion11.2.0.3.4Copyright(c)2012,OracleCorporation.Allrightsreserved.PREREQsessionOracleHome:/u01/app/oracle/product/11.2.0/db1CentralInventory:/u01/app/oraInventoryfrom:/u01/app/oracle/product/11.2.0/db1/oraInst.locOPatchversion:11.2.0.3.4OUIversion:11.2.0.4.0Logfilelocation:/u01/app/oracle/product/11.2.0/db1/cfgtoollogs/opatch/opatch2022−03−2813−43−19PM1.logInvokingprereq"checkconflictagainstohwithdetail"Prereq"checkConflictAgainstOHWithDetail"notexecutedUnabletocreatePatchObject.Exceptionoccured:Versionfieldofthecomponent"delete"inactionsfilecannotbe<null>orempty.Pleasecheckpatchmetadata.OPatchsucceeded.4、升级说明:升级前关闭数据库、监听。先打备库补丁,再打主库,打完后在主库跑脚本,改变数据库结构,数据自然会传到备库。主库执行:SQL>altersystemsetlogarchivedeststate2=deferscope=bothsid=′∗′;4.1、备库应用opatch备库执行:SQL>selectopenmodefromvdatabase;
OPEN_MODE
READ ONLYWITH APPLY
SQL>alter database recover managed standby database cancel;
Databasealtered.
SQL>shutdown immediate;
Databaseclosed.
Databasedismounted.
ORACLEinstance shut down.
SQL>exit
Disconnectedfrom Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bitProduction
With thePartitioning, OLAP, Data Mining and Real Application Testing options
[oracle@OEL792db_1]$ lsnrctl stop
LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 29-MAR-2022 13:41:14
Copyright© 1991, 2013, Oracle. All rightsreserved.
Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.133.151)(PORT=1521)))
Thecommand completed successfully
[oracle@OEL792OPatch]$ ./opatch apply /soft/31537677
[oracle@OEL792OPatch]$ lsnrctl start
LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 29-MAR-2022 15:10:08
Copyright© 1991, 2013, Oracle. All rightsreserved.
Starting/u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait…
TNSLSNRfor Linux: Version 11.2.0.4.0 - Production
Systemparameter file is/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Logmessages written to /u01/app/oracle/diag/tnslsnr/OEL792/listener/alert/log.xml
Listeningon: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.133.151)(PORT=1521)))
Listeningon: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.133.151)(PORT=1521)))
STATUS ofthe LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate 29-MAR-2022 15:10:28
Uptime 0 days 0 hr. 0 min. 40 sec
TraceLevel off
Security ON: Local OS Authentication
SNMP OFF
ListenerParameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
ListenerLog File /u01/app/oracle/diag/tnslsnr/OEL792/listener/alert/log.xml
ListeningEndpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.133.151)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
ServicesSummary…
Service"orcl151" has 1 instance(s).
Instance “orcl151”, status UNKNOWN,has 1 handler(s) for this service…
Thecommand completed successfully
[oracle@OEL792OPatch]$ sqlplus / as sysdba
SQLPlus:Release 11.2.0.4.0 Production on Tue Mar 29 15:11:04 2022
Copyright© 1982, 2013, Oracle. All rightsreserved.
Connectedto an idle instance.
SQL>startup mount
ORACLEinstance started.
TotalSystem Global Area 3206836224 bytes
FixedSize 2257520 bytes
VariableSize 1811942800 bytes
DatabaseBuffers 1375731712 bytes
RedoBuffers 16904192 bytes
Databasemounted.
注意:如果使用了DG broker,需通过其修改state=APPLY-OFF,以避免DGbroker自动启动MRP.
4.2、主库应用Patch
[oracle@OEL791~]$ lsnrctl stop
LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 29-MAR-2022 15:16:50
Copyright© 1991, 2013, Oracle. All rightsreserved.
Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.133.150)(PORT=1521)))
Thecommand completed successfully
[oracle@OEL791~]$ sqlplus / as sysdba
SQLPlus:Release 11.2.0.4.0 Production on Tue Mar 29 15:17:14 2022
Copyright© 1982, 2013, Oracle. All rightsreserved.
Connectedto:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options
SQL>shutdown immediate
Databaseclosed.
Databasedismounted.
ORACLEinstance shut down.
[oracle@OEL791~]$ opatch version
OPatchVersion: 11.2.0.3.31
OPatchsucceeded.
[oracle@OEL791soft]$ cd
O
R
A
C
L
E
H
O
M
E
/
O
P
a
t
c
h
[
o
r
a
c
l
e
@
O
E
L
791
O
P
a
t
c
h
]
ORACLE_HOME/OPatch [oracle@OEL791OPatch]
ORACLEHOME/OPatch[oracle@OEL791OPatch] ./opatch apply /soft/31537677
OracleInterim Patch Installer version 11.2.0.3.31
Copyright© 2022, Oracle Corporation. All rightsreserved.
OracleHome : /u01/app/oracle/product/11.2.0/db_1
CentralInventory : /u01/app/oraInventory
from :/u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatchversion : 11.2.0.3.31
OUIversion : 11.2.0.4.0
Log filelocation : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2022-03-29_15-19-50PM_1.log
Verifyingenvironment and performing prerequisite checks…
Do youwant to proceed? [y|n]
y
UserResponded with: Y
Allchecks passed.
Pleaseshutdown Oracle instances running out of this ORACLE_HOME on the local system.
(OracleHome = ‘/u01/app/oracle/product/11.2.0/db_1’)
Is thelocal system ready for patching? [y|n]
y
UserResponded with: Y
Backingup files…
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
/bin/ld⚠️ -z lazyload ignored.
/bin/ld⚠️ -z nolazyload ignored.
Compositepatch 31537677 successfully applied.
OPatchSession completed with warnings.
Log filelocation: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2022-03-29_15-19-50PM_1.log
OPatchcompleted with warnings.
4.3、升级/修补RDBMS及字典对象
[oracle@OEL791admin]$ cd
O
R
A
C
L
E
H
O
M
E
/
r
d
b
m
s
/
a
d
m
i
n
[
o
r
a
c
l
e
@
O
E
L
791
a
d
m
i
n
]
ORACLE_HOME/rdbms/admin [oracle@OEL791admin]
ORACLEHOME/rdbms/admin[oracle@OEL791admin] sqlplus / as sysdba
SQL*Plus:Release 11.2.0.4.0 Production on Tue Mar 29 15:27:08 2022
Copyright© 1982, 2013, Oracle. All rightsreserved.
Connectedto an idle instance.
SQL>startup restrict;
ORACLEinstance started.
TotalSystem Global Area 3206836224 bytes
FixedSize 2257520 bytes
VariableSize 1811942800 bytes
DatabaseBuffers 1375731712 bytes
RedoBuffers 16904192 bytes
Databasemounted.
Databaseopened.
SQL>@catbundle psu apply
…
25 end;
26 commit;
27 end;
28 END LOOP;
29 close query_crs;
30 end;
31 /
PL/SQLprocedure successfully completed.
SQL>
SQL>
SQL>ALTER SESSION SET current_schema = SYS;
Sessionaltered.
SQL>PROMPT Updating registry…
Updatingregistry…
SQL>INSERT INTO registry
h
i
s
t
o
r
y
2
(
a
c
t
i
o
n
t
i
m
e
,
a
c
t
i
o
n
,
3
n
a
m
e
s
p
a
c
e
,
v
e
r
s
i
o
n
,
i
d
,
4
b
u
n
d
l
e
s
e
r
i
e
s
,
c
o
m
m
e
n
t
s
)
5
V
A
L
U
E
S
6
(
S
Y
S
T
I
M
E
S
T
A
M
P
,
′
A
P
P
L
Y
′
,
7
S
Y
S
C
O
N
T
E
X
T
(
′
R
E
G
I
S
T
R
Y
history 2 (action_time,action, 3 namespace, version, id, 4 bundle_series, comments) 5 VALUES 6 (SYSTIMESTAMP, 'APPLY', 7 SYS_CONTEXT('REGISTRY
history2(actiontime,action,3namespace,version,id,4bundleseries,comments)5VALUES6(SYSTIMESTAMP,′APPLY′,7SYSCONTEXT(′REGISTRYCTX’,‘NAMESPACE’),
8 ‘11.2.0.4’,
9 201020,
10 ‘PSU’,
11 ‘PSU 11.2.0.4.201020’);
1 rowcreated.
SQL>COMMIT;
Commitcomplete.
SQL>SPOOL off
SQL>SET echo off
Check thefollowing log file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ORCL150_APPLY_2022Mar29_15_28_06.log
4.4、主库重建 DG环境
[oracle@OEL791admin]$ lsnrctl start
LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 29-MAR-2022 15:38:23
Copyright© 1991, 2013, Oracle. All rightsreserved.
Starting/u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait…
TNSLSNR forLinux: Version 11.2.0.4.0 - Production
Systemparameter file is/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Logmessages written to /u01/app/oracle/diag/tnslsnr/OEL791/listener/alert/log.xml
Listeningon: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.133.150)(PORT=1521)))
Listeningon: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.133.150)(PORT=1521)))
STATUS ofthe LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate 29-MAR-2022 15:38:23
Uptime 0 days 0 hr. 0 min. 0 sec
TraceLevel off
Security ON: Local OS Authentication
SNMP OFF
ListenerParameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
ListenerLog File /u01/app/oracle/diag/tnslsnr/OEL791/listener/alert/log.xml
ListeningEndpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.133.150)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
ServicesSummary…
Service"orcl150" has 1 instance(s).
Instance “orcl150”, status UNKNOWN,has 1 handler(s) for this service…
Thecommand completed successfully
强制主节点向监听注册服务
SQL>alter system register;
Systemaltered.
在单个实例(非 RAC)中禁用受限会话以允许终端连接
SQL>alter system disable restricted session;
Systemaltered.
SQL>exit
Disconnectedfrom Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bitProduction
With thePartitioning, OLAP, Data Mining and Real Application Testing options
重新启用到备库的日志传送
SQL>alter system set log_archive_dest_state_2=enable scope=both sid=‘*’;
Systemaltered.
备库执行
SQL>alter database open;
Databasealtered.
SQL>select open_mode from v$database;
OPEN_MODE
READ ONLY
SQL>alter database recover managed standby database using current logfiledisconnect from session;
Databasealtered.
SQL>select open_mode from v$database;
OPEN_MODE
READ ONLYWITH APPLY
SQL>select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
299
SQL> r
1* select sequence#,to_char(first_time,‘yyyy-mm-ddhh24:mi:ss’),to_char(next_time,‘yyyy-mm-dd hh24:mi:ss’),applied fromv$archived_log order by 1
SEQUENCE#TO_CHAR(FIRST_TIME,'YYYY-MM-DDHH24:MI: TO_CHAR(NEXT_TIME,'YYYY-MM-DDHH24:MI:SAPPLIED
289 2022-03-29 10:26:02 2022-03-29 11:21:12 YES
290 2022-03-29 11:21:12 2022-03-29 11:21:44 YES
291 2022-03-29 11:21:44 2022-03-29 11:22:21 YES
292 2022-03-29 11:22:21 2022-03-29 11:23:29 YES
293 2022-03-29 11:23:29 2022-03-29 13:22:53 YES
294 2022-03-29 13:22:53 2022-03-29 13:23:00 YES
295 2022-03-29 13:23:00 2022-03-29 15:27:23 YES
296 2022-03-29 15:27:23 2022-03-29 15:27:28 YES
297 2022-03-29 15:27:28 2022-03-29 15:28:13 YES
298 2022-03-29 15:28:13 2022-03-29 15:28:34 YES
299 2022-03-29 15:28:34 2022-03-29 15:45:41 IN-MEMORY
11 rowsselected.
主库执行:
SQL>select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
299
5、主备库验证补丁是否成功应用
主库
[oracle@OEL791~]$ opatch lspatches
31537677;DatabasePatch Set Update : 11.2.0.4.201020 (31537677)
OPatchsucceeded.
备库
[oracle@OEL792OPatch]$ opatch lspatches
31537677;DatabasePatch Set Update : 11.2.0.4.201020 (31537677)
OPatchsucceeded.
检查注册表历史升级记录
SQL> r
1* selectaction_time,action,namespace,version,bundle_series,id from registry$history
ACTION_TIME ACTION NAMESPACE VERSION BUNDLE_SERIES ID
24-AUG-1312.03.45.119862 PM APPLY SERVER 11.2.0.4 PSU 0
07-OCT-2111.25.40.878982 AM APPLY SERVER 11.2.0.4 PSU 0
29-MAR-2203.28.39.351894 PM APPLY SERVER 11.2.0.4 PSU 201020