Print Thread
Duplicate a Oracle Table
#2725 11/08/01 02:30 PM
Joined: Nov 2001
Posts: 1
A
a.bodi Offline OP
Member
OP Offline
Member
A
Joined: Nov 2001
Posts: 1
I would know what is the best kind to do a copy of a table (Data, Indexes, Checks, ...)
I copy Field by Field and Record by Record but it's long !!

Thanks for your help

Re: Duplicate a Oracle Table
#2726 11/08/01 05:15 PM
Joined: Aug 1999
Posts: 22,207
Member
Offline
Member
Joined: Aug 1999
Posts: 22,207
The easiest way to copy a table is like this:

create table emp_copy as select * from emp

Now your table does not have any indexes or constraints (except not null constraints), so you will have to recreate them. Also note that the new table will be located in the default tablespace with the default storage options from that tablespace. You may wish to override this as well in the "create table" statement.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.028s Queries: 13 (0.007s) Memory: 2.4956 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-01 17:19:46 UTC
Valid HTML 5 and Valid CSS