Reputation: 1071
In Microsoft SQL Server I get TCP Port with this statment:
select CONNECTIONPROPERTY('local_tcp_port') AS local_tcp_port;
1433
How to get TCP PORT with SQL statment in Oracle Server?
Upvotes: 1
Views: 1470
Reputation: 142710
As far as I can tell, you can't. There's no select statement you could run which would reveal that information.
From the command prompt, you could try with tnsping
, e.g.
c:\Temp>tnsping xe
TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 06-STU-2
020 21:38:22
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
C:\Users\lf\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = lflaptop)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
OK (20 msec) ----
here it is
c:\Temp>
Or, you could ask your DBA, they know.
Upvotes: 2