把oracle某用户下的索引重建的脚本,已经测试过,欢迎大家提意见
SET ECHO OFF; SET FEEDBACK OFF; SET VERIFY OFF; SET PAGESIZE 0; SET TERMOUT ON; SET HEADING OFF; ACCEPT username CHAR PROMPT 'Enter the index username: '; spool c:\rebuild_&username.sql; SELECT 'PROMPT REBUILT INDEX NAME : ' || owner || '.' || segment_name ||';'|| chr(10) || 'ALTER INDEX ' || owner || '.' || segment_name ||' REBUILD '||'ONLINE ' || 'TABLESPACE ' || tablespace_name ||';' || chr(10) || chr(10) FROM dba_segments WHERE segment_type = 'INDEX' AND owner=upper('&username') ORDER BY owner, bytes DESC; spool off;
|
阅读(1469) | 评论(0) | 转发(0) |