create table TBS_NUBIA1 as select * from hr.employees;
Hello everyone
I copied the table to another tablespace but the primary and secondary keys are not copied, I also need to copy the indexes.
Could you help me please?
create table TBS_NUBIA1 as select * from hr.employees;
Hello everyone
I copied the table to another tablespace but the primary and secondary keys are not copied, I also need to copy the indexes.
Could you help me please?
The create table ... as select ... command only creates a new table. It does not create any constraints, indexes etc.
If you want to create an exact replica of the table in another schema, then you have a couple of choices in Toad:
Alternatively:
HTH
Cheers,
Norm. [TeamT]
What Norm said.
The only thing that I have to add is that Norm's first set of steps doesn't include table data. So I would do add this in the editor at the end of his steps:
insert into TBS_NUBIA1 select * from hr.employees;
commit;
The 2nd set of steps is good too but doesn't include indexes except the ones that come automatically with constraints.
Ah, yes, copying the data! Silly me.
Thanks John.
Happy new Year.
Cheers,
Norm. [TeamT]