View the execution time and sp2-0027 errors of an SQL statement in an Oracle database _oracle

Source: Internet
Author: User
Tags sqlplus
Enter Sqlplus
Sql> Set Timing on
Sql>
Sql> Select COUNT (*) from Comm_human_role;
COUNT (*)
----------
866
elapsed:00:00:00.05
The above digital output is: Hours:Minutes:Seconds.Milliseconds
It takes 0.05 seconds to execute, equivalent to 50 milliseconds.
Time if this is the expression: 00:03:235.78
The total time is 235.78 seconds, less than 4 minutes, so the display is 3 minutes (235.78 seconds about 3分钟55.78秒)
#设置屏幕行宽度
Sql>set linesize 190
#设置sqlplus打印执行计划和统计信息
Sql>set Autotrace on
#设置sqlplus打印执行时间
Sql>set Timing on
If the following error occurs in Sqlplus:
Sp2-0027:input is too long (> 2499 characters)-line ignored
A statement that represents an SQL row has exceeded 2,499 characters.
Solve:
In a section of SQL, add "enter",
To ensure that each line does not exceed 2,499 characters, it is good to execute the SQL statement again.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.