Skip to main content

Posts

Showing posts from January 8, 2015

Dropping many tables at a time using pl/sql script

Hello all, Here i'm going to give you the script to drop more number of  tables at one go. The below script is being used in our environment to drop more number of tables at the same time whenever we receive a mail from our client. This may help you also if you are in a situation. It's a best option to save time instead of dropping tables one by one. Tomorrow also we will have an activity to drop 111 tables which occupied 105 GB of space & reclaiming physical disk space activity followed by table drop. set timing on SET SERVEROUTPUT ON begin      for X in ( select OWNER,SEGMENT_NAME from dba_segments where SEGMENT_NAME in ( 'BKP_31MAY14', 'BKP_26MAY14', 'BKP_27MAY14', 'BKP_03JUN14', 'BKP_29MAY14', 'BKP_25MAY14', 'BKP_28MAY14', 'BKP_22MAY14', 'BKP_30MAY14', 'BKP_23MAY14', 'BKP_24MAY14', 'BKP_19MAY14', 'BKP_21MAY14', 'BKP_20MAY14', 'BKP_1