Docker-images: Failing to login using "SYS as SYSDBA" remotely to 12.2.0.1 single instance. No rows in v$pwfile_users.

Created on 13 Jan 2019  路  6Comments  路  Source: oracle/docker-images

After building and running a single instance database version 12.2.0.1I am unable to connect using SYS as SYSDBA remotely.

SQL> show parameter password

NAME | TYPE | VALUE
-------|-------|--------
remote_login_passwordfile | string | EXCLUSIVE

SQL> select * from v$pwfile_users;

no rows selected

After manually removing the current file (link) and creating a new password file I am able to login and see SYS defined in the password file:

SQL> select username from v$pwfile_users;

USERNAME|
------------|
SYS|

I can see the password file being moved and linked in runOracle.sh, but I not able to follow where/when it's generated or why it ends up missing the SYS user which I believe should be there by default.

database

Most helpful comment

Can you please share the command(s) you are executing?

I can connect without any issues:

[oracle@ol7 dockerfiles]$ docker exec -ti 12.2.0.1-ee sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 8 09:40:33 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@ol7 dockerfiles]$ docker exec -ti 12.2.0.1-ee sqlplus sys/vNdB+yzCTKs=1 as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 8 09:40:54 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter password

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile        string  EXCLUSIVE
SQL> 

All 6 comments

Hello, I cannot connect as well to the db with user SYS and when I try to use sqlplus via docker exec the sql console says : Not connected

SQL> show parameter password
SP2-0640: Not connected

Can you please share the command(s) you are executing?

I can connect without any issues:

[oracle@ol7 dockerfiles]$ docker exec -ti 12.2.0.1-ee sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 8 09:40:33 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@ol7 dockerfiles]$ docker exec -ti 12.2.0.1-ee sqlplus sys/vNdB+yzCTKs=1 as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 8 09:40:54 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter password

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile        string  EXCLUSIVE
SQL> 

Hello, I was doing it as: docker exec -it oracleXE-12e bash -c "source /home/oracle/.bashrc; sqlplus /nolog"
Now I tried with your example and it worked just fine.

Being here I'll mentions as well that in order to make it work in Intellij Idea, I had to set these params:
SID: ORCLCDB
User: sys as sysdba

If you want to connect via IntelliJ you should connect via the port and service name.

"sys/@//localhost:1521/ORCLCDB as sysdba" or "sys/@//localhost:1521/ORCLPDB1 as sysdba"

Connecting without password is discouraged as it only ever allows you to connect as SYS to the CDB directly but not how regular users would connect to the database.

Hello, sure, I did used the password, is just the fact that in the User: field I had to use a text expression rather than a single value, e.g. sys as sysdba instead of sys with a separated option that would define the role.

In my particular case, I was using the dockerized db instance just to test some liquibase migrations before pushing into a protected environment.

Great! Closing issue.

Was this page helpful?
0 / 5 - 0 ratings