The execution of the SQL statement is primarily done by the user process and the server process, and some other processes may have to assist in completing the process.
Query statements differ from other SQL statements, and if a query statement succeeds, it returns the results of the query, while the other SQL statements simply return information about the success or failure of the execution.
Query statements are primarily
The execution of the SQL statement is primarily done by the user process and the server process, and some other processes may have to assist with this process.
Query statements differ from other SQL statements, and if a query statement succeeds, it returns the query results, while the other SQL statements simply return information about the success or failure of the execution.
The processing of query statements mainly consists of the following 3 stages: compiling, executing and extracting data.
Compile: At compile time, the server process puts the body of the SQL statement into the library cache of the shared pool and completes the following processing.
1. First search in the shared pool for the same SQL statement, and if not, follow-up processing.
2. check that the syntax of the SQL statement is correct
3. Check the definition of tables and columns by looking at the data dictionary
4. Compile locks on the objects being manipulated so that the definitions of these objects cannot be changed during the compilation of the statements
5. Check the permissions of the lock reference object
6. Generate the optimization execution conditions required to execute the SQL statement
7. Load the execution plan of the SQL statement into the shared SQL area
Execution: The Oracle server process begins executing the SQL statement because it has obtained all the resources and information needed to execute the SQL statement.
Extract data: The data rows that are required by the Oracle server process are selected and sorted when needed, and the results are returned to the user
Steps for Oracle to execute SQL query statements