The Oracle Database modifies the index tablespace, including modifying the table tablespace, modifying the index tablespace, and modifying the tablespace with the CLOB field.
Alter table space syntax
1. Modify the table tablespace.
- Alter table TABLENAME move tablespace TABLESPACENAME;
2. Modify the index tablespace.
- Alter IndexINDEXNAME rebuild tablespace TABLESPACENAME;
3. Modify the tablespace with the CLOB Field
- Alter TableTABLENAMEMoveTablespace TABLESPACENAME lob (COLUMNNAME) storeAs(Tablespace TABLESPACENAME );
Example of modifying a tablespace
Modify Table
- Select 'Alter table'| A. table_name |'Move tablespace workflow ;',
- A. owner, a. table_name, a. tablespace_name, .*FromDba_tables
- WhereA. Owner ='Ermis _ shansi'
- Order ByA. owner, a. table_name;
Modify Index
- Select 'Alter Index'| A. index_name |'Rebuild tablespace workflow ;',
- A. owner, a. index_name, a. tablespace_name, .*FromDba_indexes
- WhereA. Owner ='Ermis _ shansi'
- Order ByA. owner, a. table_name;
Modify a clob Index
- ALTER TABLEWF_H_PROCESSINSTATTRMOVETABLESPACE WORKFLOW
- LOB (ATTRIBUTE) STOREAS(Tablespace workflow );
If you encounter a large field, add an attribute:
- Select 'Alter Index'| A. index_name |'Rebuild tablespace VASD ;',
- A. owner, a. index_name, a. tablespace_name, .*FromDba_indexes
- WhereA. Owner ='Ms200bj1'
- AndIndex_type ='Normal'
- Order ByA. owner, a. table_name;
- Select 'Alter Index'| A. index_name |'Rebuild tablespace VASD ;',
- A. owner, a. index_name, a. tablespace_name, .*FromDba_indexes
- WhereA. Owner ='Ms200bj1'
- AndIndex_type ='Lob'
- Order ByA. owner, a. table_name;
First, query all tables involving large fields.
- SELECT DISTINCTA. table_name
- FROMDba_indexes
- WHEREA. owner ='Ms200bj1' ANDIndex_type ='Lob'
One by one