Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

For it, I'm using docker-compose file I used to create in other PCs.

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.

ORA-01017: invalid username/password; logon denied
like image 249
Marcio Koji Carvalho Avatar asked Nov 21 '25 14:11

Marcio Koji Carvalho


1 Answers

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
like image 191
Bilal Demir Avatar answered Nov 24 '25 05:11

Bilal Demir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!