暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

MGMTDB密码过期导致打补丁异常

原创 陈兴望 2020-10-23
2431

MGMTDB密码过期导致打补丁异常

ORACLE 12C引入了GIMR(集群管理资料库),这是一个名叫mgmtdb的CDB数据库,用于存储集群相关的一些信息。在12.2中,这个数据库在安装集群的时候是需要强制进行安装的,但是19C中,这个数据库又调整为可选安装。最近在安装补丁的时候,遇到了因为mgmtdb数据库用户密码过期导致安装补丁异常的问题,感觉这是Oracle留下的一个坑,这里做一些记录。

mgmtdb下面的PDB数据库GIMR_DSCREP_10的用户使用默认的PROFILE,也就是说默认180天,密码会过期。

SQL> select username,account_status,profile from dba_users where account_status='EXPIRED';

USERNAME     ACCOUNT_STATUS       PROFILE
------------ -------------------- ------------
CALOG        EXPIRED              DEFAULT
CHM          EXPIRED              DEFAULT

SQL> select limit from dba_profiles where profile='DEFAULT' AND RESOURCE_NAME='PASSWORD_LIFE_TIME';

LIMIT
-----------------------------
180

GI下安装补丁之后,会运行postpatch步骤,这个步骤需要连接到GIMR中。此时就会因为数据库用户密码过期,导致postpatch中途失败:

[root@ora19c1 soft]# /u01/app/19.3.0/grid/crs/install/rootcrs.sh -postpatch   
Using configuration parameter file: /u01/app/19.3.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/ora19c1/crsconfig/crs_postpatch_ora19c1_2020-10-22_09-02-50PM.log
2020/10/22 21:03:00 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 [2700853977].
SQL Patching tool version 19.7.0.0.0 Production on Thu Oct 22 21:05:30 2020
Copyright (c) 2012, 2020, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/grid/cfgtoollogs/sqlpatch/sqlpatch_86409_2020_10_22_21_05_30/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.7.0.0.0 Release_Update 200404035018: Installed
  PDB CDB$ROOT:
    Applied 19.7.0.0.0 Release_Update 200404035018 successfully on 22-OCT-20 10.54.49.833349 AM
  PDB GIMR_DSCREP_10:
    Applied 19.7.0.0.0 Release_Update 200404035018 successfully on 22-OCT-20 11.02.15.323004 AM
  PDB PDB$SEED:
    Applied 19.7.0.0.0 Release_Update 200404035018 successfully on 22-OCT-20 11.02.15.323004 AM

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
    No release update patches need to be installed
    No interim patches need to be applied

SQL Patching tool complete on Thu Oct 22 21:06:27 2020
MGTCA-1005 : Could not connect to the GIMR. 

ORA-28001: the password has expired



2020/10/22 21:06:36 CLSRSC-180: An error occurred while executing the command '/u01/app/19.3.0/grid/bin/mgmtca applysql'
Died at /u01/app/19.3.0/grid/crs/install/crspatch.pm line 2110.
The command '/u01/app/19.3.0/grid/perl/bin/perl -I/u01/app/19.3.0/grid/perl/lib -I/u01/app/19.3.0/grid/crs/install -I/u01/app/19.3.0/grid/xag /u01/app/19.3.0/grid/crs/install/rootcrs.pl -postpatch' execution failed

这里可以很明显的看到因为密码过期,导致无法连接到GIMR数据库。需要通过以下命令重置mgmtdb数据库的用户密码:

[grid@ora19c1 ~]$ mgmtca configRepos setpasswd -allusers

然后再次运行rootcrs.sh -postpatch,就可以通过了。

安装的补丁的时候,建议先检查一下MGMTDB上数据库用户的账户情况。或者直接在安装数据库的时候,直接将MGMTDB下默认的密码策略修改为不过期。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论