| vikhardba |
Posted: Feb 06, 2008 05:04:17 AM |
Total Post: 86
Joined: Apr, 2007
|
| How do i copy the object structure? For example: having emp table with 8 columns and 14 rows . . So, i need to have replica of emp structure but not the 14 rows. How should i do it? Can anybody help me? |
|
|
vikhardba |
| Posted: Feb 06, 2008 05:11:32 AM | |
|
Total Post: 86
Joined: Apr, 2007
|
To copy tables without rows i.e. to just copy the structure following is the command:
create table emp1 as select * from emp where 1=2;
Is there any way to copy indexes, and triggers from emp to emp1 in similar fashion?
Thanks in Advance,
|
|
|
|
|
Murtuja |
| Posted: Feb 06, 2008 07:24:34 AM | |
|
Total Post: 814
Joined: Jan, 2006
|
Simplest way to achive your requirement is export only index and triggers for that table.Then make necessary changes in dump file.
Export Parameter file.
FILE="C:\Documents and Settings\mkhokhar\Desktop\index_trigger.DMP"
LOG="C:\Documents and Settings\mkhokhar\Desktop\index_trigger.log"
TABLES=('COWNER.TABLE_NAME')
ROWS=N
CONSTRAINTS=N
GRANTS=N
STATISTICS=None
FEEDBACK=1000
|
|
|
|
|
Murtuja |
| Posted: Feb 07, 2008 11:17:47 PM | |
|
Total Post: 814
Joined: Jan, 2006
|
Hi,
You can get code of index and trigeer by this way also.
set long 20000
SELECT dbms_metadata.get_ddl('INDEX', 'PK_EMP')
FROM dual
SELECT dbms_metadata.get_ddl('TRIGGER', 'TRIGGER_NAME')
FROM dual
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |