Friday, May 4, 2007

Cursor Defined

When a SQL statement is issued against Oracle RDBMS then Oracle checks whether it is a valid SQL statement and also whether the user who has issued it has the appropriate permissions. If these two conditions are satisfied then a private SQL area is assigned to the statement. If this is the first time this statement is issued then it is parsed and its parsed copy is saved in the Shared SQL area for further use. Next time when this statement is issued then it is not parsed again but instead already parsed version residing in the Shared SQL area is used.

Both the Private and Shared SQL areas are part of Library Cache which in turn is part of Shared Pool. Private SQL area further consists of two more areas. One is called Persistent area which has static size and stores all the constants values used in the statement. The other is called runtime area and it is used to store all dynamic contents of the statement; for example Binding information. The cursor is nothing but a symbolic name or handle of the Private SQL area of a statement.

No comments:

Post a Comment