You wrote:
It takes about the same 5 seconds for SQL Plus to connect, but once connected queries
are instant. My problem is apparently that PHP needs to connect each time the page
loads (or does it?)
PHP doesn't hold sessions open across multiple accesses of a user's session. In other words, active database sessions are not be saved in the session environment as can be done with ASP. The data from the connection can be saved in the session, but the active connection object cannot.
OCILogon() establishes a fresh connection each time. OCIPLogon() will attempt to reuse 'persistent' connections. If you are running in CGI mode, then they are equivalent, but if you are running as a module, then OCIPLogon() may be able to reduce your connect times.
what should I be looking for in the tnsnames.ora?
Sometimes people are routing database connections through the network when they should be using an IPC connection instead. Or they refer to excess ports in their tnsnames.ora which the Listener isn't accepting. Both of those can impact connect times.
ALSO, MICHAEL, I WOULD APPRECIATE IT IF YOU DID NOT 'SNIFF' MY PORTS, OR AT LEAST
INFORMED MY OF WHY YOU WERE DOING SO.
No need to yell. I did not 'sniff' your network traffic, what I only did was probe three ports (1521, 1526, 80) on 141.155.35.116. When I am helping someone out, I make sure that their Oracle Listener IS NOT externally accessible to the Internet. The is done for security reasons, and is especially important if the person posts anything that could be interpreted as a weak password protection scheme (example: cst/cst@whatever). If I find anything, I immediately call or e-mail the person about how to improve the security of their system.
By the way... I note that you did sixty-six (66) port probes on one of my servers:
]2001-08-30 04:04:25, HTTP port probe, 141.155.35.116, pool-141-155-35-116.ny5030.east.verizon.net, 66
I guess that proves we are both more security conscious than most people.
Now back to the PHP/Oracle problem at hand.
-- Michael
Darkstreak Computing & Innovations
www.darkstreak.com