启动jar包的时候报错

java.sql.SQLException: ORA-28001: the password has expired

解决步骤

1、进入容器:docker exec -it oracle11g bash

2、初始化环境变量:source /etc/profile

3、进入sqlplus:sqlplus /nolog

4、进入管理员:conn /as sysdba

5、alter user 想要修改对数据库名 identified by 新密码;

操作如下

[root@localhost ~]# docker ps
CONTAINER ID   IMAGE                                                  COMMAND                  CREATED        STATUS        PORTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       NAMES
98322a507c45   mysql                                                  "docker-entrypoint.s…"   2 weeks ago    Up 2 weeks    0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp                                                                                                                                                                                                                                                                                                                                                                                                                                                                        mysqltest5
bb60a6571fca   elasticsearch:7.5.1                                    "/usr/local/bin/dock…"   7 months ago   Up 7 months   0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp                                                                                                                                                                                                                                                                                                                                                                                                                                        elasticsearch
a56a6cc6b64d   harisekhon/hbase                                       "/entrypoint.sh"         7 months ago   Up 5 days     0.0.0.0:16000->16000/tcp, :::16000->16000/tcp, 0.0.0.0:16010->16010/tcp, :::16010->16010/tcp, 0.0.0.0:16020->16020/tcp, :::16020->16020/tcp, 0.0.0.0:16030->16030/tcp, :::16030->16030/tcp, 0.0.0.0:16201->16201/tcp, :::16201->16201/tcp, 0.0.0.0:16301->16301/tcp, :::16301->16301/tcp, 0.0.0.0:12181->2181/tcp, :::12181->2181/tcp, 0.0.0.0:18080->8080/tcp, :::18080->8080/tcp, 0.0.0.0:18085->8085/tcp, :::18085->8085/tcp, 0.0.0.0:19090->9090/tcp, :::19090->9090/tcp, 0.0.0.0:19095->9095/tcp, :::19095->9095/tcp   hbase
15f53dfdb71f   postgres                                               "docker-entrypoint.s…"   7 months ago   Up 7 months   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   postgres
10401aff699c   sonatype/nexus3:3.31.1                                 "sh -c ${SONATYPE_DI…"   8 months ago   Up 7 months   0.0.0.0:18081->8081/tcp, :::18081->8081/tcp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 nexus3
ad3fbff40429   redis                                                  "docker-entrypoint.s…"   8 months ago   Up 2 months   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   redis
d5946ff9bfcc   registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g   "/bin/sh -c '/home/o…"   8 months ago   Up 2 months   0.0.0.0:1521->1521/tcp, :::1521->1521/tcp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   oracle11g
[root@localhost ~]# docker exec -it oracle11g /bin/bash
[oracle@d5946ff9bfcc /]$ source /etc/profile
[oracle@d5946ff9bfcc /]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Mar 28 15:08:38 2022

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> conn /as sysdba
Connected.
SQL> alter user dbname identified by new_password;

User altered.

SQL>

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐