查找重复值

select 键列 from 表  group by 键列 having count(键列) > 1;

删除重复值

DELETE from 表 WHERE (键) IN ( SELECT 键 FROM 表 GROUP BY 键 HAVING COUNT(键) > 1) AND ROWID NOT IN (SELECT MIN(ROWID) FROM 表 GROUP BY 键 HAVING COUNT(*) > 1);   

批量删除现在用户名下的表

select 'drop table '||table_name ||';' from USER_TABLES; # 
select 'truncate table '||table_name ||' DROP STORAGE;' from USER_TABLES;

select 'drop table '||table_name ||';' from dba_TABLES  where onwer='aa'; # 批量指定用户名下的表

禁用所有check 类约束

select 'ALTER TABLE  '||table_name ||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='C'    

删除所有check 类约束

select 'ALTER TABLE  '||table_name ||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='C'    

删除序列

 select 'drop sequence ' ||SEQUENCE_NAME ||' ;' from user_sequences  

清除回收站

 purge recyclebin ;