oracle修改資料表空間,oracle修改表

來源:互聯網
上載者:User

oracle修改資料表空間,oracle修改表

1、先找到這哪些表的資料表空間不對

select * from dba_tables where tablespace_name='TDB';

2、將資料表空間在 TDB 中的移到資料表空間 TDB2009 中

文法是:alter table table_name move tablespace tablespace_name;alter table tdb2009.ASSOC_INFO move tablespace TDB2009;alter table tdb2009.BGUSERPOPD move tablespace TDB2009;

3、將索引換到另一個資料表空間

alter index PK_WS_ACCESS_LOG_DETAIL rebuild online nologging tablespace rpt03;

將把一個資料表空間的所有索引換到另一個資料表空間呢

select 'alter index ' || index_name || ' move tablespace TDB2009;' from user_indexesselect 'alter index TDB2009.'||index_name||' rebuild online nologging tablespace TDB2009;' from user_indexes

4、將lob欄位的資料表空間移新資料表空間

文法是:ALTER TABLE 表名 MOVE LOB(lob欄位名) STORE AS (TABLESPACE 新資料表空間名);ALTER TABLE ws_access_log MOVE LOB(req_content) STORE AS (TABLESPACE rpt03);ALTER TABLE ws_access_log MOVE LOB(resp_content) STORE AS (TABLESPACE rpt03);

備忘:查詢

select * from dba_data_files;select * from dba_lobs where tablespace_name='USERS';select * from dba_segments where segment_name in('SYS_LOB0000335629C00004$$','SYS_LOB0000335629C00014$$','SYS_LOB0000335635C00006$$','SYS_LOB0000335635C00008$$');select dbms_metadata.get_ddl('TABLE','WS_ACCESS_LOG','USMM') from dual;




ORACLE怎更改表所在的資料表空間

alter table schema.AC01 move tablespace AA;
rebuild AC01表,指定資料表空間AA
expdp後,在執行impdp時指定資料表空間轉換REMAP_TABLESPACE=SYSTEM:AA

 
oracle怎更改使用者預設資料表空間

alter user wy2014 default tablespace mytds01
 

相關文章

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.