1. Get the Build Table statement:
Select T.owner,t.column_id,t.column_name, ', ' STRING ', ', concat (concat (' COMMENT ', T2. COMMENTS), ', ') as Commentname from
all_tab_columns T-left
join all_tab_comments t1 on
t.owner=t1. OWNER and
t.table_name=t1. table_name left
join All_col_comments T2 on
t.owner=t2. OWNER and
t.table_name=t2. TABLE_NAME and
T.column_name=t2. column_name
where t.table_name= ' table name ' ORDER by
t.owner,t.table_name,column_id;
2. Get the middle of the field separated by commas
Select Wm_concat (column_name) from (
select T.column_name from All_tab_columns t where t.table_name= ' table name ' and
t . Owner= ' owner ' ORDER by t.owner,t.table_name,column_id)
3. Query the size of the table (based on the size of the table to determine whether incremental or full migration data 1G a full amount, 1G above increment)
Select segment_name, To_char (Sum (bytes)/1024/1024/1024, ' FM999999.99 ') from
dba_segments T
where t.segment _name= ' table name '
Group by segment_name
You can use Java code to cobble together the results of the above SQL into a hive statement, and a conf that needs to be configured