Oracle连接无法与定义的SID连接

时间:2015-10-15 09:28:48

标签: oracle oracle11g tnsnames

我有一个数据库实例,我只需使用用户和密码即可连接到它: sqlplus系统/密码

但是,如果我尝试向连接添加SID,则会收到以下错误:

sqlplus system@db1/password

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

我尝试输入一个不同的错误SID来检查我是否收到同样的错误,但是我收到了另一个错误:

sqlplus system@wrongdb/password

ORA-12514: TNS:could not resolve the connect identifier specified

我已使用netcfa创建侦听器,并且服务条目存在于TNSNAMES.ora文件中。是什么阻止了与SID的连接?

编辑:我也能够提供服务:

tnsping SCDEMO
Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhos t)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SCDEMO))) 
OK (0 msec)

1 个答案:

答案 0 :(得分:0)

语法错误,必须是

sqlplus system/password@db1