I installed Oracle 12c Data Guard, everything was okey. But, I got an error like below when I wanted to connect data guard database with Toad or SQL Developer. tnsping was okey.
SQL Developer :
Status : Failure -Test failed: IO Error: Got minus one from a read call
10-OCT-2017 15:01:16 * (CONNECT_DATA=(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=testuser))(SERVICE_NAME=TDG)(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=testuser))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.24)(PORT=49834)) * establish * TDG * 12518
TNS-12518: TNS:listener could not hand off client connection
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
Linux Error: 32: Broken pipe
If you have grid user to manage listener, you have to give permission on $ORACLE_HOME/bin/oracle executable file. You have to give chmod 6751 permission. This provides that grid user can execute oracle file like oracle user. Oracle open process on OS when you connect to database. If you connect from remote with using listener, listener owner (grid) will want to open new process on OS but grid user cannot open process with using $ORACLE_HOME/bin/oracle file due to do not have permission. So you have to give 6751 permission to use $ORACLE_HOME/bin/oracle file.
[root@tdg bin] chmod 6751 oracle
You can see the same problem at 11g and 12c version of Oracle Data Guard. When oracle rac installation or single instance installation with grid, oracle automatically change permission of $ORACLE_HOME/bin/oracle file to 6751.