I know I can copy a tale structure and data by
create table testtable1 as select * from sourcetable
Is there any way to actually clone everything, triggers, constraints, grants etc?
Thanks in advance. We are running 10G.
I know I can copy a tale structure and data by
create table testtable1 as select * from sourcetable
Is there any way to actually clone everything, triggers, constraints, grants etc?
Thanks in advance. We are running 10G.
The following query returns an error:
Error:
The query below returns a creation code for "SOURCETABLE" as expected.
Take a look into
dbms_metadata
, especially its proceduredbms_metadata.get_ddl
function (see this tahiti link).So, in your case, you would first do a
As per be here now's comment: dont forget the
dbms_metadata.get_dependent_ddl
:And then work from the given output.