Oracle alter table space, oracle ALTER TABLE

Source: Internet
Author: User

Oracle alter table space, oracle ALTER TABLE

1. Find out which tables have incorrect tablespaces.

select * from dba_tables where tablespace_name='TDB';

2. Move the tablespace in TDB to TDB2009.

Syntax: alter table table_name move tablespace tablespace_name; alter table tdb2009.ASSOC _ INFO move tablespace TDB2009; alter table tdb2009.BGUSERPOPD move tablespace TDB2009;

3. Change the index to another tablespace.

alter index PK_WS_ACCESS_LOG_DETAIL rebuild online nologging tablespace rpt03;

Change all indexes in one tablespace to another.

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. Move the tablespace of the lob field to the new tablespace.

Syntax: alter table name move lob (lob field name) store as (new TABLE space name); 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 );

Remarks: Query

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;




How Does ORACLE Change the tablespace of a table?

Alter table schema. AC01 move tablespace AA;
Rebuild AC01 table, specifying the tablespace AA
After expdp, specify the tablespace conversion REMAP_TABLESPACE = SYSTEM: AA when impdp is executed.


How Does oracle Change the user's default tablespace?

Alter user wy2014 default tablespace mytds01

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.