签到成功

知道了

CNDBA社区CNDBA社区

Oracle 12.2.0.1 Opatch 打补丁 datapatch Could not open logfile 错误解决方法

2021-03-26 21:07 2429 0 原创 Oracle 19c
作者: dave

1 错误现象

给windows 平台的12.2.0.1 打最新的补丁,opatch apply 没有问题,但是在执行datapatch -verbose 报如下错误:http://www.cndba.cn/dave/article/4455

PS D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/OPatch> datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Fri Mar 26 19:30:27 2021
Copyright (c) 2012, 2020, Oracle.  All rights reserved.

Log file for this invocation: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/sqlpatch_3696_20
21_03_26_19_30_27/sqlpatch_invocation.log

Connecting to database...OK
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 SQL patches:
Patch 31035002 (31035002:WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.2.0.1.200414):
  CDB$ROOT (APPLY with errors) LHCZDB (ROLLBACK with errors) PDB$SEED (APPLY with errors) only
Bundle series PSU:
  ID 210119 in the binary registry and ID 200414 with errors in PDB CDB$ROOT, ID 200414 with errors in PDB PDB$SEED, ID
210119 with errors in PDB LHCZDB

Adding patches to installation queue and performing prereq checks...
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED LHCZDB
    The following patches will be rolled back:
      31035002 (31035002:WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.2.0.1.200414)
    The following patches will be applied:
      31987852 (WINDOWS DB BUNDLE PATCH 12.2.0.1.210119(64bit):31987852)

Installing patches...
Patch installation complete.  Total patches installed: 6

Validating logfiles...
Patch 31035002 rollback (pdb CDB$ROOT): WITH ERRORS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31035002/23522919/31035002_rollback
_ORCL_CDBROOT_20213? 26_19_31_08.log (errors)
    Error at line 0: Could not open logfile D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31
035002/23522919/31035002_rollback_ORCL_CDBROOT_20213? 26_19_31_08.log
Patch 31987852 apply (pdb CDB$ROOT): WITH ERRORS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31987852/23999087/31987852_apply_OR
CL_CDBROOT_20213? 26_19_34_24.log (errors)
    Error at line 0: Could not open logfile D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31
987852/23999087/31987852_apply_ORCL_CDBROOT_20213? 26_19_34_24.log
Patch 31035002 rollback (pdb PDB$SEED): WITH ERRORS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31035002/23522919/31035002_rollback
_ORCL_PDBSEED_20213? 26_19_42_17.log (errors)
    Error at line 0: Could not open logfile D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31
035002/23522919/31035002_rollback_ORCL_PDBSEED_20213? 26_19_42_17.log
Patch 31987852 apply (pdb PDB$SEED): WITH ERRORS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31987852/23999087/31987852_apply_OR
CL_PDBSEED_20213? 26_19_42_51.log (errors)
    Error at line 0: Could not open logfile D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31
987852/23999087/31987852_apply_ORCL_PDBSEED_20213? 26_19_42_51.log
Patch 31035002 rollback (pdb LHCZDB): WITH ERRORS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31035002/23522919/31035002_rollback
_ORCL_LHCZDB_20213? 26_19_46_34.log (errors)
    Error at line 0: Could not open logfile D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31
035002/23522919/31035002_rollback_ORCL_LHCZDB_20213? 26_19_46_34.log
Patch 31987852 apply (pdb LHCZDB): WITH ERRORS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31987852/23999087/31987852_apply_OR
CL_LHCZDB_20213? 26_19_47_06.log (errors)
    Error at line 0: Could not open logfile D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/31
987852/23999087/31987852_apply_ORCL_LHCZDB_20213? 26_19_47_06.log

Please refer to MOS Note 1609718.1 and/or the invocation log
D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlpatch/sqlpatch_3696_2021_03_26_19_30_27/sqlpatch_inv
ocation.log
for information on how to resolve the above errors.

SQL Patching tool complete on Fri Mar 26 19:50:37 2021
PS D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/OPatch>

这个补丁执行需要20分钟,这个错误是在最后验证的时候报的,实际上之前的活都干完了,验证没过去。http://www.cndba.cn/dave/article/4455http://www.cndba.cn/dave/article/4455http://www.cndba.cn/dave/article/4455http://www.cndba.cn/dave/article/4455

2 解决方法

上MOS 搜了一下,是12c 的bug:http://www.cndba.cn/dave/article/4455

Due to Bug 25459405 - DATAPATCH FAILS WITH SP2-0768 IF NLS_LANGUAGE IS NOT SET TO AMERICAN
which is closed as duplicate of unpublished "Bug 28338592 - Add nls_date_language to to_char statement in generated apply/rollback scripts".
This is an ER in patch packaging to add the additional information.

1. Set the NLS_LANG to American_America temporarily.
eg:
NLS_LANG=American_America.US8PC437
2. Run the "datapatch -verbose" command.


"Could not open logfile" occurred when run "datapatch -verbose" (Doc ID 2243580.1)

解决方法就是设置 nls_language 为 american, 再重新执行:http://www.cndba.cn/dave/article/4455

C:/Users/www.cndba.cn>set NLS_LANG=American_America

C:/Users/www.cndba.cn>set NLS_LANG
NLS_LANG=American_America

C:/Users/www.cndba.cn>cd D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/O
Patch

C:/Users/www.cndba.cn>D:

D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/OPatch>set NLS_LANG
NLS_LANG=American_America

D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/OPatch>datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Fri Mar 26 20:26:36 2021
Copyright (c) 2012, 2020, Oracle.  All rights reserved.

Log file for this invocation: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome
_1/cfgtoollogs/sqlpatch/sqlpatch_4980_2021_03_26_20_26_36/sqlpatch_invocation.lo
g

Connecting to database...OK
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 SQL patches:
Patch 31035002 (31035002:WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.2.0.1.2
00414):
  CDB$ROOT (ROLLBACK with errors) LHCZDB (ROLLBACK with errors) PDB$SEED (ROLLBA
CK with errors) only
Bundle series PSU:
  ID 210119 in the binary registry and ID 210119 with errors in PDB CDB$ROOT, ID
 210119 with errors in PDB PDB$SEED, ID 210119 with errors in PDB LHCZDB

Adding patches to installation queue and performing prereq checks...
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED LHCZDB
    The following patches will be rolled back:
      31035002 (31035002:WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.2.0.1.2
00414)
    The following patches will be applied:
      31987852 (WINDOWS DB BUNDLE PATCH 12.2.0.1.210119(64bit):31987852)

Installing patches...
Patch installation complete.  Total patches installed: 6

Validating logfiles...
Patch 31035002 rollback (pdb CDB$ROOT): SUCCESS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlp
atch/31035002/23522919/31035002_rollback_ORCL_CDBROOT_2021Mar26_20_27_04.log (no
 errors)
Patch 31987852 apply (pdb CDB$ROOT): SUCCESS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlp
atch/31987852/23999087/31987852_apply_ORCL_CDBROOT_2021Mar26_20_27_04.log (no er
rors)
Patch 31035002 rollback (pdb PDB$SEED): SUCCESS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlp
atch/31035002/23522919/31035002_rollback_ORCL_PDBSEED_2021Mar26_20_33_24.log (no
 errors)
Patch 31987852 apply (pdb PDB$SEED): SUCCESS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlp
atch/31987852/23999087/31987852_apply_ORCL_PDBSEED_2021Mar26_20_33_24.log (no er
rors)
Patch 31035002 rollback (pdb LHCZDB): SUCCESS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlp
atch/31035002/23522919/31035002_rollback_ORCL_LHCZDB_2021Mar26_20_36_18.log (no
errors)
Patch 31987852 apply (pdb LHCZDB): SUCCESS
  logfile: D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/cfgtoollogs/sqlp
atch/31987852/23999087/31987852_apply_ORCL_LHCZDB_2021Mar26_20_36_19.log (no err
ors)
SQL Patching tool complete on Fri Mar 26 20:39:33 2021
D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/OPatch>
D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/OPatch>
D:/app/www.cndba.cn/Dave/product/12.2.0/dbhome_1/OPatch>

注意:在windows 平台还有一个坑,就是不能在powershell里执行,需要在cmd里执行,powershell里设置的环境变量不能生效。http://www.cndba.cn/dave/article/4455http://www.cndba.cn/dave/article/4455http://www.cndba.cn/dave/article/4455

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2249
    原创
  • 3
    翻译
  • 573
    转载
  • 191
    评论
  • 访问:7506115次
  • 积分:4303
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ