在客户端开发了一个使用ODP.NET访问oracle 12c数据库服务器的应用程序。我在客户端和服务器上都有2个网络适配器。服务器正在侦听不同端口上的两个网络轨道。
如果我从服务器端拔出网络电缆,客户端大约需要21秒才能故障转移到另一个网络轨道以便与数据库通信。我如何加快速度?我已经使用了TCP.CONNECT_TIMEOUT,TRANSPORT_CONNECT_TIMEOUT和CONNECTION_TIMEOUT,但似乎没有什么适用。我在sqlnet.ora和应用程序级别都应用了TCP.CONNECT_TIMEOUT,但没有任何作用。 TNSPING和sqlplus工作正常,并根据指定的超时进行故障转移。
看起来OPD.NET似乎并没有在Description部分中表达很多内容。出于好奇,我测试了其他的东西,比如把FAILOVER =关闭,它仍然会失败。我还将描述部分放在“数据源”标签下的连接字符串中。依然没有。 ODP.NET中是否有错误?
请帮忙。 -David
客户端:
DBSVR =
(DESCRIPTION =
(RETRY_COUNT = 0)
(LOAD_BALANCE = off)
(FAILOVER = on)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.11)(PORT = 1526))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DBSVR)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = basic)
)
)
)
sqlnet.ora和app.config中的设置:
TCP.CONNECT_TIMEOUT = 3
TRANSPORT_CONNECT_TIMEOUT = 3
CONNECTION TIMEOUT = 60
摘自跟踪文件:
2017-02-26 16:21:27.818678 TID:1 (CFG) (SQLNET) SQLNET.AUTHENTICATION_SERVICES : (none)
2017-02-26 16:21:27.820678 TID:1 (CFG) (SQLNET) TRACE_LEVEL_CLIENT : SUPPORT
2017-02-26 16:21:27.820678 TID:1 (CFG) (SQLNET) TRACE_DIRECTORY_CLIENT : C:\OracleTrace
2017-02-26 16:21:27.820678 TID:1 (CFG) (SQLNET) TRACE_FILE_CLIENT : client_trace.log
2017-02-26 16:21:27.820678 TID:1 (CFG) (SQLNET) DIAG_ADR_ENABLED : OFF
2017-02-26 16:21:27.822678 TID:1 (CFG) (ENV) Machine Name : CASGUI2
2017-02-26 16:21:27.822678 TID:1 (CFG) (ENV) User Name : aimscsadmin
2017-02-26 16:21:27.822678 TID:1 (CFG) (ENV) OS Version : Microsoft Windows NT 6.1.7601 Service Pack 1
2017-02-26 16:21:27.822678 TID:1 (CFG) (ENV) 64-bit OS : True
2017-02-26 16:21:27.822678 TID:1 (CFG) (ENV) 64-bit Process : False
2017-02-26 16:21:27.822678 TID:1 (CFG) (ENV) .NET Runtime Version : 4.0.30319.42000
2017-02-26 16:21:27.822678 TID:1 (CFG) (VER) Oracle Data Provider for .NET, Managed Driver Version : 4.121.2.0
2017-02-26 16:21:27.822678 TID:1 (CFG) (VER) Oracle Data Provider for .NET, Managed Driver Informational Version : 4.121.2.20141216 ODAC RELEASE 3
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) TraceLevel : 7
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) TRANSPORT_CONNECT_TIMEOUT : 6
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) TRACE_FILE_CLIENT : client_trace.log
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) DIAG_ADR_ENABLED : OFF
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) TCP.CONNECT_TIMEOUT : 3
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) TRACE_DIRECTORY_CLIENT : C:\OracleTrace
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) TRACE_LEVEL_CLIENT : SUPPORT
2017-02-26 16:21:27.822678 TID:1 (CFG) (.NET) SQLNET.AUTHENTICATION_SERVICES : (none)
2017-02-26 16:21:27.823679 TID:1 (CFG) (TNSNAMES) DBSVR : (DESCRIPTION =(RETRY_COUNT = 0)(LOAD_BALANCE = off)(FAILOVER = on)(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.11)(PORT = 1526)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = DBSVR)(FAILOVER_MODE =(TYPE = select)(METHOD = basic))))
2017-02-26 16:21:27.826679 TID:1 (CFG) (SQLNET) FilePath : C:\oracle\product\12.1.0\client_1\network\admin\sqlnet.ora
2017-02-26 16:21:27.826679 TID:1 (CFG) (TNSNAMES) FilePath : C:\oracle\product\12.1.0\client_1\network\admin\tnsnames.ora
2017-02-26 16:21:27.826679 TID:1 (PUB) (ENT) OracleConnection.ctor()
2017-02-26 16:21:27.829679 TID:1 (PRI) (ENT) (CP) ConnectionString.GetCS()
2017-02-26 16:21:27.831679 TID:1 (PRI) (ENT) (CP) ConnectionString.ctor()
2017-02-26 16:21:27.834679 TID:1 (PRI) (ENT) (CP) ConnectionString.Parse()
2017-02-26 16:21:27.837679 TID:1 (PRI) (ENT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (EXT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (ENT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (EXT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (ENT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (EXT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (ENT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (EXT) (CP) ConnectionString.SetProperty()
2017-02-26 16:21:27.837679 TID:1 (PRI) (EXT) (CP) ConnectionString.Parse()
2017-02-26 16:21:27.837679 TID:1 (PRI) (EXT) (CP) ConnectionString.ctor()
2017-02-26 16:21:27.837679 TID:1 (PRI) (EXT) (CP) ConnectionString.GetCS()
2017-02-26 16:21:27.838679 TID:1 (PUB) (EXT) OracleConnection.ctor()
2017-02-26 16:21:27.873681 TID:1 (PUB) (ENT) OracleConnection.Open() (conid=45028263) (state=Closed) (sessid=0) (implid=0) (pooling=T) (txnid=n/a)
2017-02-26 16:21:27.874681 TID:1 (PRI) (ENT) (CP) OracleConnectionDispenser`3..cctor()
2017-02-26 16:21:27.875681 TID:1 (PRI) (EXT) (CP) OracleConnectionDispenser`3..cctor()
2017-02-26 16:21:27.875681 TID:1 (PRI) (ENT) (CP) OracleConnectionDispenser`3.Get()
2017-02-26 16:21:27.876682 TID:1 (PRI) (ENT) (CP) PoolManager`3.ctor()
2017-02-26 16:21:27.877682 TID:1 (PRI) (EXT) (CP) PoolManager`3.ctor()
2017-02-26 16:21:27.878682 TID:1 (PRI) (ENT) (CP) PoolManager`3.Initialize() (constr=data source=dbsvr;user id=USR1;Connection Timeout=60;)
2017-02-26 16:21:27.878682 TID:1 (PRI) (ENT) (CP) ConnectionString.Secure()
2017-02-26 16:21:27.879682 TID:1 (PRI) (EXT) (CP) ConnectionString.Secure()
2017-02-26 16:21:27.882682 TID:1 (PRI) (EXT) (CP) PoolManager`3.Initialize() (pmid=56648283) (constr=data source=dbsvr;user id=USR1;Connection Timeout=60;)
2017-02-26 16:21:27.882682 TID:1 (PRI) (BUF) (OBP.CTOR) (poolid:40072506) (OracleConnectionDispenser`3.GetPM)
2017-02-26 16:21:27.884682 TID:1 (PRI) (ENT) (CP) OraclePoolManager.Get()
2017-02-26 16:21:27.887682 TID:1 (PRI) (ENT) (CP) PoolManager`3.Get() (txnid=n/a) (bForceMatch=F)
2017-02-26 16:21:27.889682 TID:1 (PRI) (ENT) (CP) PoolManager`3.CreateNewPR() (txnid=n/a)
2017-02-26 16:21:28.027690 TID:1 (PRI) (ENT) TimeStamp.GetLocalTZOffset()
2017-02-26 16:21:28.027690 TID:1 (PRI) (EXT) TimeStamp.GetLocalTZOffset()
2017-02-26 16:21:28.029690 TID:1 (PRI) (ENT) (CP) ConnectionString.GetStringFromSecureString()
2017-02-26 16:21:28.029690 TID:1 (PRI) (EXT) (CP) ConnectionString.GetStringFromSecureString()
2017-02-26 16:21:28.031690 TID:6 (PRI) (ENT) (CP) PoolManager`3.CreateNewPRThreadFunc()
2017-02-26 16:21:28.033691 TID:6 (PRI) (SVC) (ENT) OracleConnectionImpl.Connect() (oper=open) (aff=n/a) (inst=) (affmatch=n/a) (sessid=-1:-1) (F;F;F;;N) (pmid=56648283)
2017-02-26 16:21:28.034691 TID:6 (PRI) (BUF) (COBP.CTOR) (poolid:1) (parentpoolid:40072506) (OracleConnectionImpl.Connect)
2017-02-26 16:21:49.046892 TID:6 (PRI) (BUF) (ALLOCATION) (bufid:1)
答案 0 :(得分:0)
您提供了主池线程的跟踪。您是否还可以提供连接建立线程的跟踪文件,以便我们可以看到它挂在哪里?
对不起,我想把它作为评论而不是答案,但是不会让我这么做。
注意,你是对的。 ODP.Managed不支持(failover =)。 ODP.Managed仅支持故障转移(不支持address_list负载平衡),因此address_list的唯一目的是故障转移。
此外,ODP.Managed不支持重试(retry_count和retry_delay)。