I’m pretty fan of SQLcl and lately, I’m using it for creating tables in development from production.

I query the table in production:

SYS@172.20.0.64/DBPRO>select owner,object_name,object_type from dba_objects where object_name like '%TLOCATIONID%' and owner='USER';

OWNER         OBJECT_NAME                 OBJECT_TYPE       
------------- --------------------------- -------------------
USER          TLOCATIONID_EXPORT          TABLE             
USER          IDX_TLOCATIONID1            INDEX             

After that, while I’m connected to development, I use the bridge command for creating the table (like CTAS in sqlplus):

USER@172.20.0.45/DBPRE>bridge TLOCATIONID_EXPORT as "jdbc:oracle:thin:USER/USER@172.20.0.64:1521/DBPRO"(select * from TLOCATIONID_EXPORT);

Se ha creado la tabla TLOCATIONID_EXPORT y se han insertado 246.872 filas

At the end, I query the new table:

USER@172.20.0.45/DBPRE>select count(*) from TLOCATIONID_EXPORT;

  COUNT(*)
----------
    246872