PL/SQL Script for cleaning up global temporary tables in Oracle:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
begin for cur_cleanup in ( select object_name, object_type from user_objects where object_type = 'TABLE' and temporary = 'Y' ) loop begin execute immediate 'truncate '|| cur_cleanup.object_type|| ' "'|| cur_cleanup.object_name|| '" drop storage'; execute immediate 'drop '|| cur_cleanup.object_type|| ' "'|| cur_cleanup.object_name|| '" cascade constraints'; dbms_output.put_line('dropped ' || cur_cleanup.object_type || ' ' || cur_cleanup.object_name); end; end loop; end; |
Leave Your Response