Oracle Releases undo tablespace

Source: Internet
Author: User
-- Delete the original UNDO tablespace; droptablespaceundotbs1includingcontents; -- confirm whether the deletion is successful; selectnamefro

-- Delete the original UNDO tablespace; drop tablespace undotbs1 including contents; -- confirm whether the deletion is successful; select name fro

In daily database maintenance and database programming, we often hesitate to perform DML operations on large data volumes, so that Oracle's undo tablespace can be extended to dozens of GB or dozens of GB. the physical space occupied by the disk will not be released by Oracle, if you are using a PC, you may encounter insufficient disk space. After completing the following operations, you can reconstruct the undo tablespace, similarly, the temp tablespace may be infinitely expanded when you query big data or create an index, resulting in insufficient disk space. You can also solve this problem using the following methods:

-- View table space names

Select name from v $ tablespace

-- View information about a tablespace

Select file_name, bytes/1024/1024 from dba_data_files where tablespace_name like 'undotbs1 ';

-- Check the usage of the rollback segment, which user is using the resources of the rollback segment, and if there is a user, it is best to change the time (especially in the production environment ).

Select s. username, u. name from v $ transaction t, v $ rollstat r, v $ rollname u, v $ session s

Where s. taddr = t. addr and t. xidusn = r. usn and r. usn = u. usn order by s. username;

-- Check the UNDO Segment status

Select usn, xacts, rssize/1024/1024/1024, hwmsize/1024/1024/1024, shrinks from v $ rollstat order by rssize;

-- Create a new UNDO tablespace and set automatic expansion parameters;

Create undo tablespace undotbs2 datafile 'd: \ Oracle \ PRODUCT \ 10.1.0 \ ORADATA \ ORCL \ UNDOTBS02.DBF 'size 10 m reuse autoextend on next 100 m maxsize unlimited;

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.