How to copy an oaracle table including data, indexes, and constraints
Posted on 2014-08-14
I am new to Oracle. I know how to do this using MS SQL Server.
How is this done in Oracle?
SQL> SET HEADING OFF
SQL> SET PAGESIZE 100
SQL> SET LONG 10000
SQL> spool c:\ddl.sql
SQL> select dbms_metadata.get_ddl(object_type,object_name)
SQL> spool off
OR select DBMS_METADATA.GET_DDL('INDEX','<INDEX NAME>') from DUAL;
CREATE TABLE LETTERS_BAK
AS SELECT * FROM LETTERS;
This gave me the table including data, but not the indexes and constraints.