Look at the execution time of an sql statement and the SP2 0027 error in the oracle database

  • 2020-11-03 22:37:56
  • OfStack

Enter the sqlplus
SQL > set timing on
SQL >
SQL > select count(*) from comm_human_role;
COUNT(*)
----------
866
Elapsed: 00:00:00.05
The above digital output are respectively: Hours: Minutes: Seconds. Milliseconds
That takes 0.05 seconds to execute, equivalent to 50 milliseconds.
If the time is expressed like this: 00: 03: 235.78
The total time spent is 235.78 seconds, less than 4 minutes, so the display is 3 minutes (235.78 seconds is about 3 minutes, 55.78 seconds)
# Set the screen line width
SQL > set linesize 190
# Set up sqlplus to print execution plans and statistics
SQL > set autotrace on
# Set the sqlplus print execution time
SQL > set timing on
If the following error occurs in sqlplus:
SP2-0027: Input is too long ( > 2499 characters) - line ignored
The statement that indicates line sql1 has exceeded 2,499 characters.
Solution:
Add "Enter" in paragraph 1 of sql,
Make sure that each line is no more than 2,499 characters long. Just re-execute the sql statement.

Related articles: