Bulk change methods for table and indexed table spaces in Oracle1, query the current user of all the tables
Select ' ALTER TABLE ' | | table_name | | ' Move tablespace tablespacename; ' From User_all_tables;
Select ' ALTER TABLE ' | | table_name | | ' Move Tablespace tablespacename, ' from User_tables;
2. Query all indexes under current user
Select ' Alter index ' | | index_name | | ' rebuild tablespace tablespacename; ' From user_indexes;
3, under the current user will query results batch execution can.
View all unusable indexes
SELECT *
From User_indexes
WHERE status isn't in (' VALID ', ' N/A ')
Order BY Index_name;
--Description:displays unusable indexes for the specified schema or all schemas.
--requirements:access to the DBA views.
--Call Syntax: @unusable_indexes (schema-name or All)
SET VERIFY off
SELECT owner,
Index_name
From Dba_indexes
WHERE owner = DECODE (UPPER (' &1 '), ' all ', owner, UPPER (' &1 '))
and status not in (' VALID ', ' N/A ')
Order by owner, Index_name;