Oracle 10g 表轉移表空間

2021-08-31 19:24:36 字數 875 閱讀 1568

1.單錶轉移表空間

場景:有表user存放在表空間oldspace下,需把錶user

移動到表空間newspace下

執行語句:

alter table user move tablespace newspace;

commit;

2.使用者scott下的所有表都轉移至表空間newspace下

select 'alter table'||table_name||'move tablespace newspace;commit;'

from user_tables where owner='scott'

for x in (select u.table_name,u.compression,u.tablespace_name,u.owner from all_tables u where u.owner = 'scott' ) loop execute immediate 'alter table '|| x.table_name ||' move tablespace newspace'; end loop;

但是表user被移動到表空間newspace後,表user上的索引是不是自動轉移到表空間newspace

3.索引轉移表空間,例如,user表上的索引idx_user

alter index idx_user rebuild tablespace newspace

4.使用者scott下的所有索引都轉移至表空間newspace下

select 'alter index'||index_name||'rebuild tablespace newspace;commit;'

from user_indexes where owner='scott'

Oracle 10g表轉移表空間

1.單錶轉移表空間 場景 有表user存放在表空間oldspace下,需把錶user移動到表空間newspace下 執行語句 alter table user move tablespace newspace commit 2.使用者scott下的所有表都轉移至表空間newspace下 select...

oracle10g 釋放表空間

我們都知道資料表的龐大導而致其查詢速度的降低是水到渠成的,所以我們只有將相關的資料表的資料相應的移走,但是如果使用oracle delete之後,相關的資料刪除了,但是速度沒有多大改善,憂悶了。使用備份表再drop掉原表。的確可以解決問題。但是較麻煩,今天請教了乙個oracle高手,解決了問題。由於...

Oracle 10g臨時表空間組

oracle 10g引進了臨時表空間組 temporary tablespace group 的概念,它允許使用者在不同的會話中同時利用多個臨時表空間。1.臨時表空間組的主要特徵 n 乙個臨時表空間組必須由至少乙個臨時表空間組成,並且無明確的最大數量限制。n 如果刪除了乙個臨時表空間組的所有成員,該...