You wont get data loss, eg
--
-- session 1
--
SQL> create sequence sq_tst1 cache 1000;
Sequence created.
SQL>
SQL> CREATE TABLE a
2 (
3 id NUMBER,
4 dt DATE,
5 val VARCHAR2(10))
6 PARTITION BY RANGE(dt) (
7 partition e1 values less than (MAXVALUE)
8 );
Table created.
SQL>
SQL> create table b as select * from a where 1=2;
Table created.
SQL>
SQL> BEGIN
2 for i in 1 .. 100000
3 loop
4 INSERT INTO a VALUES (sq_tst1.NEXTVAL, SYSDATE - (1000000 + i)/3600, 'Test');
5 COMMIT;
6 end loop;
7 end;
8 /
--
-- whilst running, in session 2
--
SQL> alter session set ddl_lock_timeout = 5;
Session altered.
SQL> alter table a exchange partition e1 with table b;
Table altered.
--
-- Session 1
--
PL/SQL procedure successfully completed.
SQL> select count(*) from a;
COUNT(*)
----------
66462
1 row selected.
SQL> select count(*) from b;
COUNT(*)
----------
33538
1 row selected.
So we still have our 100,000 rows exactly. Note that (as always) we never guarantee you wont drop a sequence value
SQL> select min(id), max(id) from b;
MIN(ID) MAX(ID)
---------- ----------
1 33538
SQL> select min(id), max(id) from a;
MIN(ID) MAX(ID)
---------- ----------
33540 100001