第一步:
在数据库中查询数据库服务名称
select value from v$parameter where name='service_names'
第二步:
port后为查询到的服务名称
sqlplus username/passwd@IP:port/servicename
或者修改tnsnames.ora中的SERVICE_NAME
TEST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = *<validhost>*)(PORT = *<validport>*)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = *<servicenamefromDB>*) ) )