gpt4 book ai didi

oracle - SQLPLUS错误:ORA-12504:在CONNECT_DATA中未为TNS:listener提供SERVICE_NAME

转载 作者:行者123 更新时间:2023-12-03 13:24:28 33 4
gpt4 key购买 nike

我从Oracle下载了SQLPLUS:

http://www.oracle.com/technetwork/topics/winx64soft-089540.html

Basic Lite和SQL * Plus

然后,我启动了SQL * Plus:

c:\Program Files\Oracle\instantclient_12_1>sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Wed Apr 15 15:25:36 2015

Copyright (c) 1982, 2014, Oracle. All rights reserved.

并尝试连接到数据库:
connect user\password@hostname

并收到错误消息:
ERROR:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

我想念什么?

我运行了雅库布(Jakub)建议的查询,
SQL> select sys_context('USERENV','SERVICE_NAME') from dual;

SYS_CONTEXT('USERENV','SERVICE_NAME')
--------------------------------------------------------------------------------

SYS$USERS

SQL> select sys_context('USERENV','SID') from dual;

SYS_CONTEXT('USERENV','SID')
--------------------------------------------------------------------------------

877

SQL>

最佳答案

您缺少服务名称:

 SQL> connect username/password@hostname:port/SERVICENAME

编辑

如果可以从其他计算机连接到数据库,请尝试在该计算机上运行:
select sys_context('USERENV','SERVICE_NAME') from dual


select sys_context('USERENV','SID') from dual

关于oracle - SQLPLUS错误:ORA-12504:在CONNECT_DATA中未为TNS:listener提供SERVICE_NAME,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29659264/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com