Can we recreate DDL of a table using command line SQL tools such as SQL*PLUS ?
meda Changed status to publish 07/03/2022
Yes, there are many Oracle utilities and packages that enables us to recreate an oracle tables source code manually.
Some of the packages and utilities include but not limited to:
- Oracle data pump
- DBMS_METADATA package
- IMP and EXP utilities
For example:
SQL> conn mereba/mereba@orcl Connected. SQL> create table mereba ( id number, name varchar2(30)); Table created. SQL> select dbms_metadata.get_ddl('TABLE','MEREBA') from dual; DBMS_METADATA.GET_DDL('TABLE','MEREBA') -------------------------------------------------------------------------------- CREATE TABLE "MEREBA"."MEREBA" ( "ID" NUMBER, "NAME" VARCHAR2(30) )
meda Edited answer 21/02/2022