整理部分DBA操作语句

来源:互联网 发布:java htmldecode 用法 编辑:程序博客网 时间:2024/05/23 14:58
 -- 查询当前用户下的所有索引
select 'alter index '|| index_name ||' rebuild tablespace tablespacename;' from user_indexes;


 -- 查询索引状态代码
select index_name,index_type,tablespace_name,status from user_indexes;


select index_name,index_type,tablespace_name,status from user_indexes where status = 'unusable';


 -- 修改失效的索引   *** 为索引 名称
alter index *** rebuild ;


 -- 查询当前用户下的所有表
select 'alter table  '|| table_name ||'  move tablespace tablespacename;'  from user_all_tables;


spool d:\\output.txt;


 --  查询存储过程
select * from user_procedures where object_name='P_PARTITIONS_MAINTAIN_JOB';