If the whole row is a duplicate what is the point of saving the duplicates? Why not keep the distinct rows and just zap the clones?
create table tmp_sample as select distinct name, sal from sample
rename sample to old_sample
rename tmp_sample to sample
Obviously you'll need to transfer grants, constraints, etc but that will probably take way less time than any other approach. Although, as you have duplicate rows you obviously haven't got many integrity constraints to worry about. But now is a good time to put some on the cleaned table.
Now, if your rows aren't complete duplicates but differ in certain respects, e.g. a timestamp, you'll need to use a sub-query to select the right rows on the basis of the relevant columns. But you'll need to post more details if you can't figure that out.
This sounds like a Top-N Query.
Use the analytic ROW_NUMBER fucnton to assign numbers 1, 2, 3, ... to all rows, with a separate set of numebrs for each group
Use a multi-table INSERT to put all the rows numbered 1 into one table, and all the other rows into the other table, like this:
WHEN r_num = 1
THEN INTO union_a VALUES (name, sal)
ELSE INTO dup_b VALUES (name, sal)
SELECT name, sal
, ROW_NUMBER () OVER ( PARTITION BY name, sal
ORDER BY NULL -- or whatever
) AS r_num
You must use an OREDER BY clause with ROW_NUMBER, even if you don;'t care which row is assigned 1.