Error "ORA-12154: TNS:could not resolve the connect identifier specified" accuring while logging in as "sys as sysdba" with password . But then I read an article saying that,"admin privilages let's a sysdba login without a password." and I tried that and immediately got connected to sql server . Can anyone tell me why this happened ? and why login with password isn't working with this .
When you specify sqlplus sys as sysdba
with the correct ORACLE_SID environment variable set from the DB server, Oracle uses OS-authentication to authenticate sys and BEQ protocol (no network) to connect. That's why it would work without a password.
Connecting to sqlplus sys/password@tnsname as sysdba
connects across a network (your error indicates that your tnsname wasn't resolved) and requires that a separate password file be configured for authentication. See here: https://docs.oracle.com/database/121/ADMIN/dba.htm#ADMIN11056