I was trying to connect to the database here in my laptop using Oracle Toad but I kept on having this error:
ORA-12170: TNS:Connect timeout occurred
I was getting the same error while connecting my "hr" user of ORCLPDB which is a pluggable database.
First, get hostname and port number by typing a command lsnrctl status
on windows command prompt. In my case, it was 127.0.0.1 with port number as 1521
Second, enter the below command with your hostname and port number:
sqlplus username/password@HostName:Port Number/PluggableDatabaseName.
For example:
sqlplus hr/hr@127.0.0.1:1521/ORCLPDB.
open sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
SQLNET.INBOUND_CONNECT_TIMEOUT=360
SQLNET.RECV_TIMEOUT=10
SQLNET.SEND_TIMEOUT=10
http://docs.oracle.com/cd/B19306_01/network.102/b14213/sqlnet.htm