Forrest:
I built a new 64-bit Windows 2012 Server server with ArcGIS Desktop 10.5.1 that will perform all of my organization's GIS scheduled tasks. I initially installed a 32-bit Oracle 11g Client on the machine to see if tasks copied over from a server with ArcGIS Desktop 10.3.1 would still work if I updated necessary items to point to 10.5.1 objects (python reference) and the scheduled tasks still ran successfully against an Oracle 11g SDE database. I used the same tnsadmin file that was on the current 64-bit Windows 2008 Server with ArcGIS Desktop 10.3.1.
The SDE database was upgraded to Oracle 12c, so I added a 32-bit Oracle 12c Client on the machine making sure that the 12c client was specified first in the PATH environmental variable. I updated the tnsadmin file on the new 64-bit Windows 2012 Server with ArcGIS Desktop 10.5.1 to point to the Oracle 12c SDE database. When I created a new database connection I only added the database instance name (e.g. Dev) to the Instance portion of the Database Connection dialog box. After the connection file was successfully created, I opened up the Database Connection dialog box and sde:oracle11g was added to the Instance so it looked like sde:oracle11g:Dev even though the Oracle 12c Client was referenced first in the PATH environmental variable.
I then tried to explicitly create a new SDE connection with the Instance being sde:oracle12c:Dev, but I received the following error:
"Failed to connect to the specified server. Do you want to continue? Underlying DBMS error[ORA-12154: TNS: could not resolve the connect identifier specifiedNo extended error.]"
I then removed the reference to the Oracle 11g SDE database in the tnsadmin file. When I created a SDE connection with Instance = Dev it still added the sde:oracle11g: to the Instance name and I was able to connect to the database even though only the Oracle 12c SDE database. If I added the sde:oracle12c explicitly to the Instance Name of a SDE connection file, the connection still failed.
So why is ArcCatalog/Desktop holding onto sde:oracle11g and won't even let me add sde:oracle12c explicitly to the Instance Name of a SDE connection file?