Friday, December 4, 2015

How to drop or truncade all partitions Oracle Database

[oracle@PTUD-VM02-2 oradata]$ more drop_partition_table.sql 

SET LINESIZE 32000;
SET PAGESIZE 40000;
SET LONG 50000;

select 'ALTER TABLE '||TABLE_OWNER||'.'||table_name||' DROP PARTITION '||partition_name||';' from dba_tab_partitions;

[oracle@PTUD-VM02-2 oradata]$ sqlplus / as sysdba @drop_partition_table.sql >> a.sql &

[oracle@PTUD-VM02-2 oradata]$ cat a.sql | grep 'DROP PARTITION' >> b.sql
[oracle@PTUD-VM02-2 oradata]$ sqlplus / as sysdba @b.sql

Share this

0 Comment to "How to drop or truncade all partitions Oracle Database"

Post a Comment