简介
本文档介绍如何解锁Cisco IoT Field Network Director(IoT-FND)的Oracle用户帐户,并将密码到期设置更改为无限制。
先决条件
要求
Cisco 建议您了解以下主题:
- 基本Linux外壳操作(查看日志、启动进程等)
- 基本了解SQL查询
使用的组件
本文档不限于特定的软件和硬件版本。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
背景信息
本文档假设您有两台独立的Linux服务器:
问题
症状 1:IoT-FND未启动,数据库连接验证失败。
[root@IoT-FND-SRV ~]# service cgms status
IoT-FND Version X.X.XX
08-01-2018 15:14:58 CEST: INFO: IoT-FND database server: XX.XX.XX.XX
08-01-2018 15:15:01 CEST: ERROR: IoT-FND database connection verification failed.
08-01-2018 15:15:02 CEST: ERROR: IoT-FND application server is not running.
症状 2:cgms_db_connection_test.log包含类似于的条目:
[root@IoT-FND-SRV ~]# tail -n 50 /opt/cgms/server/cgms/log/cgms_db_connection_test.log
2018-08-01 12:27:22,767:INFO:main:TestDBConnection: Checking database connection. Please wait ...
2018-08-01 12:27:22,856:INFO:main:TestDBConnection: Database URL: jdbc:oracle:thin:@XX.XX.XX.XX:1522:cgms
2018-08-01 12:27:22,856:INFO:main:TestDBConnection: Database user: cgms_dev
2018-08-01 12:27:23,156:ERROR:main:TestDBConnection: Unable to check database connection. Exception:
java.sql.SQLException: ORA-28001: the password has expired
注意:IoT-FND应用使用CGMS_DEV数据库用户访问Oracle数据库。
注意: 默认情况下,Oracle数据库启用了密码到期,因此,在一段时间后,帐户密码将过期,如果不更改密码,就无法使用这些密码。
症状 3:Oracle CGMS_DEV用户帐户状态设置为“已过期”。
[oracle@IoT-FND-Oracle]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Aug 1 16:02:25 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> SELECT USERNAME,ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME LIKE 'cg%';
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
CGMSDBA
OPEN
CGMS_DEV
EXPIRED
解决方案
步骤1.使用SSH登录IoT-FND服务器。
步骤2.停止FND服务。
[root@IoT-FND-SRV]$ service cgms stop
注意:如果不停止IoT-FND服务,FND将尝试使用旧密码连接到数据库,在完成此过程之前,帐户将被阻止。
步骤3.使用SSH登录Oracle服务器。
步骤4.切换到oracle系统用户:
[root@IoT-FND-Oracle]$ su - oracle
[oracle@IoT-FND-Oracle]$
步骤5.以sysdba用户身份连接到Oracle数据库的根实例:
[oracle@IoT-FND-Oracle]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Aug 1 16:19:23 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>
步骤6.将password_life_limit设置修改为无限制:
sql> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Profile altered.
步骤7.检查哪些帐户的密码已过期。
SQL> SELECT USERNAME,ACCOUNT_STATUS FROM DBA_USERS WHERE ACCOUNT_STATUS='EXPIRED';
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
CGMSDBA
OPEN
CGMS_DEV
EXPIRED
步骤8.为CGMS_DEV用户设置密码:
sql> ALTER USER CGMS_DEV IDENTIFIED BY
;
User altered.
注意:如果您知道旧密码,可以重用它。如果否,则需要在IoT-FND服务器上运行cgmsSetup.sh脚本,以修改FND中设置的数据库密码。
步骤9.解锁CGMS_DEV用户帐户:
SQL> ALTER USER CGMS_DEV ACCOUNT UNLOCK;
User altered.
步骤10.验证CGMS_用户的帐户状态:
SQL> SELECT USERNAME,ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME LIKE 'cg%';
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
CGMSDBA
OPEN
CGMS_DEV
OPEN
步骤11.使用SSH登录IoT-FND服务器。
步骤12.启动/opt/cgms/bin/setupCgms.sh脚本以更改数据库密码设置。保留所有其他设置的默认值:
[root@IoT-FND-SRV]# /opt/cgms/bin/setupCgms.sh
08-01-2018 16:40:43 CEST: INFO: ========== IoT-FND Setup Started - 2018-08-01-16-40-43 ==========
08-01-2018 16:40:43 CEST: INFO: Log file: /opt/cgms/bin/../server/cgms/log/cgms_setup.log
Are you sure you want to setup IoT-FND (y/n)? y
08-01-2018 16:40:46 CEST: INFO: User response: y
Do you want to change the database settings (y/n)? y
08-01-2018 16:40:54 CEST: INFO: User response: y
Enter database server hostname or IP [XX.XX.XX.XX]:
08-01-2018 16:40:55 CEST: INFO: Database server: XX.XX.XX.XX
Enter database server port [1522]:
08-01-2018 16:40:57 CEST: INFO: Database server port: 1522
Enter database SID [cgms]:
08-01-2018 16:40:59 CEST: INFO: Database SID: cgms
Do you wish to configure another database server for this IoT-FND ? (y/n)? n
08-01-2018 16:41:02 CEST: INFO: User response: n
08-01-2018 16:41:02 CEST: INFO: Configuring database settings. This may take a while. Please wait ...
08-01-2018 16:41:03 CEST: INFO: Database settings configured.
Do you want to change the database password (y/n)? y
08-01-2018 16:41:06 CEST: INFO: User response: y
Enter database password:
Re-enter database password:
08-01-2018 16:41:10 CEST: INFO: Configuring database password. This may take a while. Please wait ...
08-01-2018 16:41:13 CEST: INFO: Database password configured.
Do you want to change the keystore password (y/n)? n
08-01-2018 16:41:16 CEST: INFO: User response: n
Do you want to change the web application 'root' user password (y/n)? n
08-01-2018 16:41:19 CEST: INFO: User response: n
Do you want to change the FTP settings (y/n)? n
08-01-2018 16:41:22 CEST: INFO: User response: n
Do you want to change router CGDM protocol settings (y/n)? n
08-01-2018 16:41:24 CEST: INFO: User response: n
Do you want to change log file settings)? (y/n)? n
08-01-2018 16:41:25 CEST: INFO: User response: n
08-01-2018 16:41:25 CEST: INFO: ========== IoT-FND Setup Completed Successfully ==========
步骤13.检验数据库连通性:
[root@IoT-FND-SRV ~]# service cgms status
IoT-FND Version X.X.X-XXX
08-01-2018 16:46:14 CEST: INFO: IoT-FND database server: XX.XX.XX.XX
08-01-2018 16:46:15 CEST: INFO: IoT-FND database connection verified.
08-01-2018 16:46:15 CEST: ERROR: IoT-FND application server is not running.
步骤14.启动IoT-FND应用:
[root@IoT-FND-SRV ~]# service cgms start
步骤15.检验IoT-FND操作:
[root@IoT-FND-SRV ~]# service cgms status
IoT-FND Version X.X.X-XXX
08-01-2018 16:49:04 CEST: INFO: IoT-FND database server: XX.XX.XX.XX
08-01-2018 16:49:04 CEST: INFO: IoT-FND database connection verified.
08-01-2018 16:49:05 CEST: INFO: IoT-FND application server is up and running.
08-01-2018 16:49:06 CEST: INFO: IoT-FND is up and running.