Home  >  Article  >  Database  >  How to release deleted table space in oracle

How to release deleted table space in oracle

WBOY
WBOYOriginal
2022-06-17 17:23:0417090browse

Oracle method to release and delete table space: 1. Use the "alter table your table name enable row movement;" statement to enable row movement, which allows rowid changes; 2. Use "alter table your table name enable row movement;" The statement "shrink space;" can be used to reclaim space.

How to release deleted table space in oracle

The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.

How does oracle release the deleted table space

After using the ORACLE database for a period of time, it will inevitably face a reduction in space until it is not enough. At this time, you have two choices.

1. Increase hard drive space and purchase new storage. This involves the funds and the machine itself and whether there is an interface.

2. Delete some historical data to free up space.

If it is handled according to the second situation, there are two situations.

1. Directly delete the data of the entire table and use the TRUNCATE command. This is relatively simple and can release space immediately.

If you cannot delete the entire table data and can only delete part of the historical data, you need to use the second method.

2. Use the DELETE method and add the WHERE condition to delete some data. Part of the table space deleted by this method will not be released.

If you want to release this part of the space, you need to manually execute the following statement. It is also done in two steps.

1. Enable row movement. After this operation, rowid changes are allowed.

Execute statement: alter table your table name enable row movement;

2. Reclaim space.

Execute statement: alter table your table name shrink space;

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to release deleted table space in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn