10.5.x Enterprise Manager (EM) installer fails to connect to Oracle 12.2 database with message:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
To be compatible with both Oracle 11g and 12c the EM installer and the EM itself use the Oracle 11g JDBC driver file ojdbc6.jar. That driver is using an Oracle 11 auth type connection to the Oracle database.
Adding this line to the Oracle Database Server sqlnet.ora file will allow the Oracle 11 auth type connection to the Oracle 12c database:
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11
For 10.5.x the above should resolve the error for these 2 scenarios:
However when trying to create a new schema an additional problem maybe encountered where the ORA-12505 error still persists after the sqlnet.ora change. With latest in-house tests this problem has not been recreated but if encountered a workaround can be used to manually create the schema using the script EM_HOME/install/database-scripts/unix/createschema.sh or EM_HOME\database-scripts\windows\createschema.bat. Some example syntax for both scripts for 10.5.2 is shown below with the output redirected to a file for easy reference:
./createschema.sh -databaseName SERVICE_NAME -databaseType oracle -host HOSTNAME -port 1521 -releaseVersion 10.5.2 -scriptsDir EM_HOME/install/oracle/database-scripts -user USERID -password PASSWORD > createschema.out 2>&1
.\createschema.bat -databaseName SERVICE_NAME -databaseType oracle -host HOSTNAME -port 1521 -releaseVersion 10.5.2 -scriptsDir "EM_HOME\install\oracle\database-scripts" -user USERID -password PASSWORD > createschema.out 2>&1