Oracle (JDBC) / Dynamic Failed XQE-DS-0006 Unable to logon to the data source

Product:
Cognos BI 10.1.1
Windows 2008 R2 server
Oracle 11

Symptom:
Error message when test the connection for the data source.
Oracle / Compatible = Succeeded.
Oracle (JDBC) / Dynamic Failed XQE-DS-0006 Unable to logon to the data source

Error message:
XQE-DS-0006 Unable to logon to the data source
Listener refused the connection with the following error:
ORA-12514 TNS:listener does not currently know of service
requested in connect descriptor

Listener refused the connection with the following error:
ORA-12514 TNS:listener does not currently know of service
requested in connect descriptor

Cause:
When the ORACLE DATABASE have more than one “node” to connect to you may experience similar issues. If you use Service ID in Connection string can give this issue.

Solution:
Change the why you connect to the ORACLE server in JDBC.
In Cognos Connection – Administration – Data Source Connections.
Click on the data link you have issues with.
Click on more (in the right side of Cognos connection)
Click on Set properties
Click on Connection tab
Click on icon right of connection string.
Click on JDBC
Change from Service ID to TNS name alias as Connection type.
Enter TNSname e.g. ORACLENAME.WORLD
Click on Test connection again.
Click TEST button

You should get
Oracle (JDBC) / Dynamic = Succeeded

Click Close