L
L
Light7772017-03-18 10:52:46
Oracle
Light777, 2017-03-18 10:52:46

How to create an exact copy of a table?

How to create an exact copy of a table with all keys and indexes? You need a code/script/procedure, but not a utility.
Tried through dbms_metadata. get _ddl, but there are errors with renaming indexes and keys. How to be? Who faced?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Draconian, 2017-03-20
@Draconian

How do you want to create an exact copy without changing the names of the table\indexes\keys?
Here we can only advise you to follow some rules for naming objects in the database, so that after receiving all the scripts, replace the names in them.

S
Smithson, 2017-03-20
@Smithson

Well, the first thing that comes to mind is import/export.
That is, you upload the table in the form of sql code to a file and create it with this code on another server / in another schema.
Second, there is such a COPY command . But I don't remember if it carries keys/triggers.

A
Anton, 2017-04-01
@Oraclist

You can try fitting DBMS_REDEFINITION. But somehow it's crooked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question