Batch operation records of movetable and rebuildindex
Batch operation records of moving table and rebuild index
Homepage → Database Technology
Background:
Read News
Batch operation records of moving table and rebuild index
[Date:] Source: Linux community Author: Jing yizhiyuan √ group [Font:]
Batch move tables in the oldtablespace tablespace to newtablespace. query and execute the query results.
Select 'alter table' | table_name | 'move tablespace newtablespace'
From user_all_tables
Where table_space = 'oldtablespace ';
Rebuild indexes in the oldtablespace tablespace to newtablespace in batches. query and execute the query results.
Select 'alter Index' | index_name | 'rebuild tablespace newtablespace ;'
From user_indexes
Where tablespace_name = 'oldtablespace ';
When the table with the lob field is moved, the lob field needs to be moved separately.
Alter table AUDIT_RECORD move lob (lobrow1) store as (TABLESPACE newtablespace );
Alter table AUDIT_RECORD move lob (lobrow2) store as (TABLESPACE newtablespace );
Alter table AUDIT_RECORD move tablespace newtablespace;
Or
Alter table test2 MOVE
TABLESPACE users
LOB (lobrow1) store as lobsegment
(TABLESPACE newtablespace );
In addition, when executing imp for exp/IMP Migration with a lob field, you need to create and import the tablespace where the original lob field is located, and then consider moving it to other tablespaces.
You can use the remap_tablespace parameter to import data to the specified tablespace.
This article permanently updates the link address:
0
MySQL Master/Slave database switch records
MySQL Operation Specifications (Summary)
Related information move table rebuild index
Image Information
View All comments in this article (0)
Comments
Latest Information
Popular this week
Introduction to Linux community-advertisement service-website map-help Info-contact us
The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.
Copyright©2006-2015 Linux community All rights reserved Shanghai ICP filing no. 15008072-1