Analysis of temporary tables and truncate errors in Oracle

Source: Internet
Author: User

There was a problem with the system last night, a stored procedure was performing an exception, and observation only found that the higher the logic read. When the situation was more urgent, I had to change the original into the old way.

In fact, the changes are very simple, the new is as follows:

EXECUTE IMMEDIATE 'TRUNCATE TABLE temp_test REUSE STORAGE ‘ ;

The old ones are as follows:

delete from TEMP_TEST ;

Temp_test is a temporary table.

This morning the test found that the temporary table was different from the normal table when truncate.

The test experiment is as follows:

sleect * from v$version
BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
CREATE GLOBAL TEMPORARY TABLE TEMP_TEST
(
TEST_ID VARCHAR2(30 BYTE) NOT NULL,
TEST_COUNT NUMBER(10)
)
ON COMMIT PRESERVE ROWS
NOCACHE;

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.