regress_partition.sql

--ENV --UAT @/test/change/env/env_test_uat.sql

 

set echo on time on timing on set feedback on set pagesize 1000 set linesize 150 col owner for a10 col segment_name for a30 col partition_name for a15 col high_value for a85

conn  &v_system_un/&v_system_pw

show user

select s.segment_name,s.partition_name,s.bytes/1024/1024 Mb, t.high_value from dba_segments s , dba_tab_partitions t where s.partition_name = t.partition_name and s.segment_name =t.table_name and s.owner=t.table_owner order by 1,2 /

connect &V_testDATA_UN/&V_testDATA_PW

show user

select index_name from user_indexes where status='UNUSABLE'; select index_name , partition_name from user_ind_partitions where status !='USABLE';

set echo on termout on feedback 1 set timing on time on

alter session set sort_area_size=300000000; --whenever sqlerror exit;

-------drop added partitions for yearly housekeep

 

-------------------------------------------------

 

------split merged partitions alter table test_1 split partition part143 at (20140801) into ( partition part142 tablespace tsp_l, partition part143 tablespace tsp_l);

alter table test_2split partition part136 at  (TO_DATE(' 2015-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))  into ( partition part135 tablesp ace tsp_l, partition part136 tablespace tsp_l);

alter table test_3 split partition part133 at  (TO_DATE(' 2014-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))  into ( partition part132 table space tsp_l, partition part133 tablespace tsp_l);

alter table test_4 split partition part141 at  (20150401)  into ( partition part140 tablespace tsp_l, partition part141 tablespace tsp_l);

alter table test_5 split partition part133 at  (TO_DATE(' 2014-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))  into ( partition part132 tablespa ce tsp_l, partition part133 tablespace tsp_l);

select index_name , partition_name from user_ind_partitions where status !='USABLE'; select index_name from user_indexes where status='UNUSABLE'; select distinct status from user_indexes; select distinct status from user_ind_partitions;

spool off

posted @ 2016-09-28 15:32  feiyun8616  阅读(139)  评论(0编辑  收藏  举报