Forum Discussion
Kris__109062
Sep 09, 2013Nimbostratus
Replace SID to SERVICE_NAME in Oracle connnection string
Hi,
I am trying to replace SID with SERVICE_NAME in an Oracle connection string using an irule on an F5 Oracle VS. I have used as a starting point the irule documented here - https://devcentral.f5....
Kris__109062
Sep 11, 2013Nimbostratus
I'm getting closer in that the payload is succesfully updated and the correct pool is chosen and when I run a tcpdump on the pool member from "other_pool" I can see the updated payload is being received and it replies but for some reason I'm getting a connection closed error from the client (sqlplus) when testing. I can also see from a tcpdump on the client that replies are coming in correctly so it's not a route/SNAT issue.
ERROR: ORA-12537: TNS:connection closed
when CLIENT_ACCEPTED {
log local0. "in client_accepted event"
TCP::collect
}
when CLIENT_DATA {
log local0. "in client_data event"
set sid_match 0
log local0. "orig payload length = [TCP::payload length]"
if { [TCP::payload] contains "CONNECT_DATA=" } {
log local0. "original payload = [TCP::payload]"
set service_name "SERVICE_NAME=MY_SERVICE_NAME"
if { [regsub -all -nocase "SID=MYSID" [TCP::payload] "$service_name" newdata] } {
log local0. "found a SID match in tcp payload - replacing with $service_name"
TCP::payload replace 0 [TCP::payload length] ""
TCP::payload replace 0 0 $newdata
log local0. "replaced payload = $newdata"
set sid_match 1
}
log local0. "new payload length = [TCP::payload length]"
if { $sid_match != 0 } {
log local0. "sending to pool other_pool"
LB::detach
pool other_pool
TCP::release
} else {
do nothing further - found no SID match - use the VS default_pool
log local0. "No SID match - use the VS default_pool"
TCP::release
}
}
TCP::release
TCP::collect
}
when LB_SELECTED {
log local0. "selected pool member [LB::server addr]"
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects