Home > Ask the Oracle Experts > Questions & Answers
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Number of open cursors increasing

Brian Peasland EXPERT RESPONSE FROM: Brian Peasland

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site
>
QUESTION POSED ON: 23 September 2002
I am facing a problem on Oracle9i related to open cursors, ie ref cursors. When I am connecting to the database through the connection pool, I find the number of open cursors increasing to about 500, when only two users are working. I took care of the closing of result sets and statements. Can I have useful information on this?

>
EXPERT RESPONSE

There are two types of cursors, implicit and explicit cursors. In PL/SQL, you create an explicit cursor with the CURSOR declaration. In JDBC programs, you create an explicit cursor for any SQL statement you pass to the database.

But sometimes, the database will create cursors for you. Any time the database creates a cursor for you that you have not explicitly stated, this is called an implicit cursor. Why does the system do this? The main reason is to handle all of the recursive SQL statements the system generates on your behalf. When you query a table, the system needs to query the data dictionary to see if that table exists, if you have permissions to view that table, etc.

The bottom line is that you are seeing open cursors for recursive SQL statements. Just enable SQL_TRACE for your session to see all of the recursive SQL being generated for you!

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2003 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts