ORA-12505表示您的客户端传递了一个SID,服务器端的侦听器根本无法识别。
在10G及更高版本中,您可以使用EZ connect而不用像这样配置服务器端:
sqlplus hr@liverpool:1521/DEMOhr is the user nameliverpool is the server name1521 is the port the listener for the DB is listening onDEMO is the database SID
(要么)
如果仍要使用tnsnames.ora,请尝试从客户端运行tnsping SID。
在LINUX上,您也可以让ORACLE从本地路径读取tnsnames.ora文件-只需将TNS_ADMIN设置为tnsnames.ora文件所在的目录即可。
否则,您需要在客户端上的$ ORACLE_HOME / network / admin中配置tnsnames.ora。
如果您需要知道数据库SID,请使用以下命令:
从双选择sys_context(’userenv’,’db_name’);



