-- 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;