Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Renaming a field
Indeed, for tables who have referencial integrity constraints, the steps are:
-a) make a script who contain all the deffinition regarding the table
Here is a method (not the only one ): 1)export the table, with the export utility (assuming exp7x ):
>exp7x user/pass_at_connect_string parfile=expfile.txt
where expfile is like :
file=name_of_dumpfile.dmp
tables=your_table
rows=N
log=if_you_want
2)create the script with import utility
>imp7x user/pass_at_connect_string parfile=impfile.txt
where
impfile.txt like:
full=n
file=name_of_dumpfile.dmp
log=this_will_be_your_the_script_file
show=y
[fromuser=owner]
[touser=owner]
tables=your_table
rows=n
Now you must have in [this_will_be_your_the_script_file] all the deffinitions regading your table
b)Disable all the refferential integrity
1)Disable triggers;
2) look for referenced keys ( in all_constraints where r_contraint_name =
constraint_name ,
like Jörn Fieg statement )
3)disable primary key cascade !!
4)disable foreign keys disabling primary keys who reference your foreign
keys ,
with cascade option!
5)drop primary keys, foreign keys
c)follow the steps I showed-you before, for recreating the table with changed columns
d)recreate the objects of this table, based on your script. Don't forget your new columns names !
e)reenable triggers and primary keys, for your table and those who referenced your table (step b)
Regards!
Iosif
Received on Tue Nov 04 1997 - 00:00:00 CST
![]() |
![]() |