Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8746

Re: Trigger Manual Delta Merge on all tables

$
0
0

Hi Sander Bleijenbergh,

  Currently there is no dircet option to merge  all tables at a schema Level.

I hvae writtent a small procedure to do this this will work.

In my example Below the DINESH"."MM_TABLE has the list of tables that has to be merged,replace that table with your own table and run this Procedure.

Note: Merge is a costly operation, please be carefull and keep your system admin informed about your action.

 

create procedure DB_OPERATIONS2
as
begin
declare v_count        integer;
declare v_index     integer;
declare v_table  char(40);
declare clm_name varchar (50);
declare vc_sql_merge varchar(4096);
declare vc_sql_part varchar(4096);
declare vc_sql_load varchar(4096);
declare vc_merge_part varchar(4096);
--MM_TABLE is the table which has all the tables  belongs to MM module

DECLARE CURSOR c_cursor1 for select table_name from "DINESH"."MM_TABLE";

--Opening the cursor to acess each table
for cur_row as c_cursor1 DO
v_table := cur_row.TABLE_NAME;

vc_merge_part := ('alter table ' ||:v_table || ' merge PARTITIONS');
exec(:vc_merge_part);

--loading the table from memory

end for;
end;


Viewing all articles
Browse latest Browse all 8746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>