简体   繁体   English

无法连接到刚刚在 docker 上的 oracle 上创建的新用户 (ORA-01017)

[英]Cannot connect to new user just created on oracle on docker (ORA-01017)

I'm trying to use Oracle 12c on Ubuntu 18 to study for my work.我正在尝试在 Ubuntu 18 上使用 Oracle 12c 来学习我的工作。

For it, I'm using docker-compose file I used to create in other PCs.为此,我正在使用我曾经在其他 PC 上创建的 docker-compose 文件。

version: '2'
services:
 database:
   image: store/oracle/database-enterprise:12.2.0.1
   volumes:
     - ./data:/ORCL # persistent oracle database data.
   ports:
     - 1529:1521
     - 8082:8080
     - 5500:5500

After install, I can login as sysadmin and I enter those codes below to create a user.安装后,我可以以系统管理员身份登录,然后在下面输入这些代码以创建用户。

ALTER SESSION SET CONTAINER = ORCLPDB1;
CREATE USER BUS IDENTIFIED BY DEMO_PASS;
GRANT CONNECT TO BUS;

and then, I try to connect to it.然后,我尝试连接到它。

sqlplus BUS/DEMO_PASS@localhost:1529/ORCLCDB.localdomain

I want to login as could in other PCs but instead of this, I'm getting this error.我想像在其他 PC 上一样登录,但不是这样,我收到了这个错误。

ORA-01017: invalid username/password; logon denied

You have to create user for connection.您必须为连接创建用户。

Look my sample here:在这里查看我的示例:

docker container run -d -h localdomain --name odbc2 -p 1521:1521 -p 5500:5500 -e DB_SID=ORCLCDB -e DB_PDB=ORCLPDB1 -e DB_DOMAIN=localdomain store/oracle/database-enterprise:12.2.0.1-slim

docker exec -it odbc2 bash -c "source /home/oracle/.bashrc; sqlplus /nolog"


connect sys as sysdba;
-- password  'Oradoc_db1'
alter session set "_ORACLE_SCRIPT"=true;
create user dummy identified by dummy;
GRANT CONNECT, RESOURCE, DBA TO dummy;
create table Docker (id int,name varchar2(20));

Connection info:连接信息:

SID:ORCLCDB
PORT:1521
username: dummy
password: dummy
url: jdbc:oracle:thin:@localhost:1521:ORCLCDB

You're connecting to the wrong database - ORCLDB.localdomain is the service for the CONTAINER database.您连接到错误的数据库 - ORCLDB.localdomain 是 CONTAINER 数据库的服务。

You did a, alter session set container = ORCLPDB1 => that is the database you want to connect to, so try你做了一个,alter session set container = ORCLPDB1 => 那是你想要连接的数据库,所以试试

sqlplus BUS/DEMO_PASS@localhost:1529/ORCLPDB1 

Also if you're looking for a more user friendly CLI for Oracle, we build SQLcl .此外,如果您正在为 Oracle 寻找更用户友好的 CLI,我们会构建SQLcl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法连接到Oracle-ORA-01017 - cant connect to oracle - ora-01017 Sqldeveloper 无法连接 Oracle 数据库(ORA-01017,用户名/密码无效;登录被拒绝) - Cannot connect Oracle database by Sqldeveloper(ORA-01017,invalid username/password;logon denied) ORA-01017在Oracle SQL Developer 4.1中创建新用户或连接时,用户名/密码无效 - ORA-01017 Invalid Username/Password whenever creating a new user or connection in Oracle SQL Developer 4.1 ORA-01017:如何在 Oracle SQL 开发人员中创建新用户 [已解决] - ORA-01017 : How do I create a New User in Oracle SQL Developer [ SOLVED ] 与 Pentaho PDI 连接时的 ORA-01017 - ORA-01017 when connect with Pentaho PDI 尝试从 servlet 连接到 Oracle XE 时出现 ORA-01017 错误 - ORA-01017 error when attempting to connect to Oracle XE from servlet 指定架构时,Oracle SQLPlus ORA-01017无效的凭证 - Oracle SQLPlus ORA-01017 invalid credentials when specifying schema oracle 12.2.0.1上的Ora-01017-无法设置不区分大小写的密码 - Ora-01017 on oracle 12.2.0.1 - Not able to set case insensitive password ORA-01017无效的用户名/密码作为默认角色oracle开发人员 - ORA-01017 invalid username/password as default role oracle developer ETL Oracle连接错误ORA-01017:无效的用户名/密码; - ETL Oracle Connection error ORA-01017: invalid username/password;
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM