This error “ORA-12560: TNS:protocol adapter error” usually means the TNS name look up error while client is trying to look up the tnsnames.ora.
In below screenshot, I use the IP address and port number to identify the Oracle host. I didn’t use the tnsnames.ora for the server identifier.
If I try to use “connect USERNAME/PASSWORD” to switch user. I will get the ORA-12560 error.
This is because, even I already connect to the database but just want to switch the user, the sqlplus would use the tnsnames.ora to make the new connection by default. Therefore, if there is no tnsnames.ora, we still have to use hostname and port number.
This also means the sqlplus connect command allow us not just change the user context but also the database server as well. Below screenshot, we switch from PODB to Orcl database.
Below screenshot shows the connect command works with tnsnames.ora