HiveBrain v1.2.0
Get Started
← Back to all entries
debugMinor

Cannot connect database as sys as sysdba using sqlplus

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
cannotconnectdatabasesysusingsysdbasqlplus

Problem

I am new to oracle server 18c (currently taking online course). My problem is sql*plus where I tried to use sqlplus then sys as sysdba (it did not work) and the error appeared below.

However, if I use sqlplus / as sysdba (it worked, and I don't know why)

I have tried this command: lsnrctl start, but again not working. In addition, I have checked my listener.ora and tnsnames.oraca

I have attached my environment set up in .bash_profile

Please help me this. Thank you

Solution

If the password contains special characters such as @, enter the password between double quotes:

$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 11 15:41:40 2019
Version 19.5.0.0.0

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

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.5.0.0.0

SQL> connect sys/a@abcd as sysdba
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

Warning: You are no longer connected to ORACLE.
SQL> connect sys/"a@abcd" as sysdba
Connected.
SQL>

Code Snippets

$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 11 15:41:40 2019
Version 19.5.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.5.0.0.0

SQL> connect sys/a@abcd as sysdba
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Warning: You are no longer connected to ORACLE.
SQL> connect sys/"a@abcd" as sysdba
Connected.
SQL>

Context

StackExchange Database Administrators Q#252971, answer score: 9

Revisions (0)

No revisions yet.