Some handy scripts
四川5.12地震遇难人数官方统计突破6万人。那些破碎的家庭。祝福你们。

1)察看分区表和分区索引的默认表空间
col owner format a15
col object_name format a35
col object_type format a10
set linesize 150
select owner,object_name,object_type from dba_objects where object_id in (
select obj# from partobj$ where DEFTS# in (
select ts# from v$tablespace where name=’MD_INDEX’) );
2)flou的并行索引必需的PL/SQL
alter index …… rebuild … parallel … ONLINE;
declare
resource_busy exception;
pragma exception_init (resource_busy,-54);
begin
loop
begin
execute immediate ‘alter index …… noparallel’;
exit;
exception
when resource_busy then
dbms_lock.sleep(1);
end;
end loop;
end;
/
3)Unxi下exp的query写法
exp … query=\”where SALE_START \<=sysdate and SALE_START \>= to_date\(\’2008-05-24 20:00:00\’,\’yyyy-mm-dd hh24:mi:ss\’\) \”
很多OS保留符号需要使用”\”转义


















