sqlplus as sysdba keeps asking me for a password

1,545 views
Skip to first unread message

rob....@gmail.com

unread,
Oct 11, 2016, 3:23:55 PM10/11/16
to Beginning Oracle Database 12c Administration
Hi Iggy,
   Love the book so far, by the way.  I am having issue with connecting to 'sqlplus "/ as sysdba" '.  It keeps asking me for a user and password.  I have tried system and sys with the password I used ( Oracle123 ) with no luck.  I am running the latest oracle VM 12.1.0.2. 


Do you or anyone else on this thread have any ideas why I am getting the following error:



[oracle@vbgeneric tmp]$
[oracle@vbgeneric tmp]$ sqlplus "/ as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Mon Oct 10 16:18:27 2016

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

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Enter user-name: sys
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Enter user-name: system
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@vbgeneric tmp]$

Iggy Fernandez

unread,
Oct 11, 2016, 3:52:20 PM10/11/16
to beginning-oracle-datab...@googlegroups.com
The error message in your question was not password related but "ORA-12154: TNS:could not resolve the connect identifier specified". Please clarify the question.

My diagnosis is that the TWO_TASK environment variable has been defined and that you are therefore attempting a connection to the database specified by that variable. Please show me the output of the command "echo $TWO_TASK".

Also, where did you get the password "Oracle123"? When I wrote the book, all passwords were "oracle".

I might add that you will always need a password when connecting to a pluggable database as SYS. It is only in the case of the container database that you can connect as SYS without a password.

Here is a demonstration of correctly connecting as SYS to a container database and to a pluggable database.

==========================================================================================

All passwords are oracle or noted if otherwise.

The SQL Developer and Data Modeler scripts are in the directory: 
/u01/oracle/Desktop/Database_Track/sqldevdm
and
/u01/oracle/Desktop/Database_Track/sqldev

To Reset the labs: 
XML DB  :      /home/oracle/reset_xmldb
SQL Developer:          /home/oracle/reset_sqldev
Application Express:      /home/oracle/reset_apex

Database Information:
Oracle SID    : orcl
Pluggable DB  : pdb1

ALL PASSWORDS ARE : oracle

*** Please note that this appliace is for testing purposes only, 
as such it is unsupported and should not be used as a production environment.


[oracle@localhost ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 11 15:46:46 2016

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

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
ERROR:
ORA-01017: invalid username/password; logon denied


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

[oracle@localhost ~]$ echo $TWO_TASK
pdb1

[oracle@localhost ~]$ unset TWO_TASK

[oracle@localhost ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 11 15:47:11 2016

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

CDB$ROOT@ORCL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

[oracle@localhost ~]$ sqlplus sys/oracle@pdb1 as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 11 15:47:40 2016

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

PDB1@ORCL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

==========================================================================================

P.S. In the 12.1.0.1 version of the virtual machine which was used to write the book, the container database was called orcl and the pluggable database was called pdb1. It appears that the names have been changed in the 12.1.0.2 version of the virtual machine. The container database is now called cdb1 and the pluggable database is called orcl. For the purposes of the book, you need to connect to the pluggable database. Therefore all references to "pdb1" in the book would have to be replaced by "orcl". Therefore the service name in the instructions on page 5 should be "orcl", not "pdb1". Let me know if that works.
Reply all
Reply to author
Forward
0 new messages