Sometimes is useful to get a table sql definition without including any data.
Even if you can use the Oracle exp utility (link) by using the option rows = n, you can also use the DBMS_METADATA package, by executing the function GET_DDL as shown below:
SQL> set heading off;
SQL> set echo off;
SQL> Set pages 10;
SQL> set long 1000;
SQL> select dbms_metadata.get_ddl('TABLE','MY_TABLE') from dual;
CREATE TABLE "MY_SCHEMA"."MY_TABLE"
( "COL_1" NUMBER,
"COL_2" VARCHAR2(8)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DE
FAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"
Depending on your needs, you can get the DDL of many object types (not only tables, but also views, synonyms…); you just have to specify the object type in the first argument of the function, by referring to the official documentation.






