Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle table moves tablespace

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

In oracle, you sometimes need to move tables to other tablespaces. Here are the steps to move them.

First, use the following command to move:

Alter table table_name move tablespace tablespace_name

Then, if there is an index, you must rebuild the index:

Alter index index_name rebuild tablespace tablespace_name

The points to be noted are:

1. If you need to move the data of lob-related fields in the table at the same time, you must use the following statement containing special parameter data.

Alter table tb_name move tablespace tbs_name lob (col_lob1,col_lob2) store as (tablesapce tbs_name)

If you have a large number of tables, you can produce an executed script.

Select 'alter index' | | OWNER | |'. | | index_NAME | | 'rebuild tablespace tablespace_name;' from dba_indexes where OWNER='USERS'

Select 'alter table' | | OWNER | |'. | | TABLE_NAME | | 'move tablespace tablespace_name;' from dba_tables where OWNER='USERS'

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report