我已经整天尝试使用网络上建议的解决方案解决此问题,但这些解决方案都没有奏效。
我正在尝试在我的PC上设置Oracle数据库以进行远程连接。它适用于本地连接,但我试图让它适用于所有连接。
我的连接字符串是:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = F:\Programs\Oracle\oracledatabasexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = F:\Programs\Oracle\oracledatabasexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
我的听众已启动,其内容为:
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Produ
ction
Start Date 22-JANV.-2017 12:11:28
Uptime 0 days 11 hr. 30 min. 18 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File F:\Programs\Oracle\oracledatabasexe\app\oracle\product
\11.2.0\server\network\admin\listener.ora
Listener Log File F:\Programs\Oracle\oracledatabasexe\app\oracle\diag\tn
slsnr\Jean-Simon-PC\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Jean-Simon-PC)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Jean-Simon-PC)(PORT=8080))(Presentat
ion=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
我使用的是Oracle Database Express Edition 11g。
我尝试从数据库服务器所在的同一台PC连接,并从另一台PC连接,但是在同一网络上。我得到了" TNS:没有听众"两台计算机上的错误。
得到一些帮助会非常好,因为我现在有点绝望了。
编辑: 这是我获得的lsnrctl status命令:
Sub ColorMeBlue()
Dim iStart, iEnd As Long
Dim i As Integer
Dim b As Boolean
iStart = 1: iEnd = 10
b = False
'~~> We will set b to true if all cells in A1:A10 conatins 100
For i = iStart To iEnd
If Cells(i, 1) = 100 Then
b = True
End If
Next
'~~> We will paint Blue if b is true
If b Then
Rows("1:10").Interior.Color = vbBlue
End If
End Sub
非常感谢!
答案 0 :(得分:0)
您是否检查了听众状态?本地连接不使用侦听器来连接数据库。但远程使用它。使用 lsnrctl status 检查它。如果获取TNS:没有听众使用 lsnrctl start 来启动它。