-- 0
select sum(ESTsizeGB) from
(select owner, table_name,
round(num_rows*avg_row_len/1024/1024/1024, 2) ESTsizeGB
from all_tables where lower(owner) in ('pdrtestingschema1','pdrtestingschema2')
order by owner, table_name)

-- 1
begin
  prdare.pdrc__settings_modify('batch_executed_sqls', '0');
  prdare.pdrc__settings_modify('get_all_rows','n');
  prdare.pdrc__settings_modify('get_random_rows','0');
  prdare.pdrc__settings_modify('prod_env','y');
  prdare.pdrc__settings_modify('exp_imp_dir','pdrdir');
  prdare.pdrc__settings_modify('pfk_max_fields','0');
  prdare.pdrc__settings_modify('strong_afk_reference_bw','y');
end;

-- 2
-- select * from prdare.pdrc__settings_slct_all order by 1

-- 3
begin prdare.pdrrunner('clean'); end;

-- 4
begin prdare.pdrc__schemas_remove_all(); end;

-- 5
begin prdare.pdrc__schemas_add('pdrtestingschema1'); end;

-- 6
begin prdare.pdrc__schemas_add('pdrtestingschema2'); end;

-- 7
-- select * from prdare.pdrc__schemas_slct_all order by 1

-- 8
begin prdare.pdrrunner('initbl'); end;

-- 9
-- select * from prdare.pdrc__tables_slct_all order by 1

-- 10 (new procedure to specify table conditions since v1.03.001)
begin
  prdare . pdrc__tableconds_add ( 'pdrtestingschema1', 't2', 0, 'pdrtestingschema1.t2.id1 > 800000 or pdrtestingschema1.t2.id3_other < 100000' ) ;
  prdare . pdrc__tableconds_add ( 'pdrtestingschema2', 't1', 0, 'pdrtestingschema2.t1.dt > to_date(''2015-06-04'', ''yyyy-mm-dd'')' ) ;
  prdare . pdrc__tableconds_add ( 'pdrtestingschema2', 't2', 0, 'pdrtestingschema2.t2.id1 / 10000 < 100' ) ;
  prdare . pdrc__tableconds_add ( 'pdrtestingschema1', 't12', 0, 'pdrtestingschema1.t12.id = 500000' ) ;
  prdare . pdrc__tableconds_add ( 'pdrtestingschema1', 't6', 0, 'pdrtestingschema1.t6.id5 < 70000' ) ;
  prdare . pdrc__tableconds_add ( 'pdrtestingschema1', 't4_alone', 0, 'pdrtestingschema1.t4_alone.id < 600000' ) ;
  prdare . pdrc__tableconds_add ( 'pdrtestingschema2', 't6mkfs', 0, 'pdrtestingschema2.t6mkfs.id1p = 400000 or pdrtestingschema2.t6mkfs.id2p = 300000' ) ;
  prdare . pdrc__tableconds_add ( 'pdrtestingschema2', 't5', 0, 'pdrtestingschema2.t5.idddd < 10000' ) ;
end;

-- 11
-- select * from prdare.pdrc__tableconds_slct_all order by 1

-- 12
begin prdare.pdrrunner('inifks'); end;

-- 13
-- select * from prdare.pdrc__afk_slct_all order by 1

-- 13++
begin prdare.pdrrunner('info'); end;
-- 13+++
-- select * from prdare.pdrc__logs_slct_last order by 1

-- 14
begin prdare.pdrrunner('simulate'); end;

-- 15
-- select * from prdare.pdrc__sqls_slct_all order by 1

-- 16
begin prdare.pdrrunner('generate'); end;

-- 17
-- select * from prdare.pdrc__sqls_slct_all order by 1

-- 18
begin prdare.pdrrunner('report'); end;

-- 19
-- select * from prdare.pdrc__logs_slct_last order by 1

-- 20
begin prdare.pdrrunner('export'); end;

-- 21
begin prdare.pdrc__settings_modify('prod_env', 'n'); end;

-- 22
--select count(*) from pdrtestingschema1.t2
--1000000

-- 23
begin prdare.pdrrunner('importcd'); end;

-- 24
begin prdare.pdrrunner('importtd'); end;

-- 25
--select count(*) from pdrtestingschema1.t2
--299999

-- 27
-- select * from prdare.pdrc__logs_slct_all order by 1 where
