Home » SQL & PL/SQL » SQL & PL/SQL » Add Check Constraints to table (10.2.0.4.0 ,windows)
Add Check Constraints to table [message #423681] Sat, 26 September 2009 08:05 Go to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member

Hi All,

I dropped following check constraints for table rebuild.Can anyone let me know
how to add again these check constraints to columns?


Alter table test_2 drop constraint SYS_D006190;
Alter table test_2 drop constraint SYS_D006190;


Regards,
Re: Add Check Constraints to table [message #423685 is a reply to message #423681] Sat, 26 September 2009 08:53 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
Flashback Recovery, Recycle Bin, or LOGMINER might be able to save you.
The problem is nobody know what the Constraints really were & on which columns they existed.

Ready, Fire, Aim!

[Updated on: Sat, 26 September 2009 08:54]

Report message to a moderator

Re: Add Check Constraints to table [message #423688 is a reply to message #423681] Sat, 26 September 2009 08:59 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
ALTER TABLE <table_name> ADD (CHECK (<column_name> <condition>);
Re: Add Check Constraints to table [message #423694 is a reply to message #423688] Sat, 26 September 2009 10:26 Go to previous messageGo to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member



Thanks for your response and was useful.


Regards,
Re: Add Check Constraints to table [message #423698 is a reply to message #423694] Sat, 26 September 2009 12:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Mohan10g wrote on Sat, 26 September 2009 17:26
Thanks for your response and was useful.
Regards,

So maybe a link to Database SQL Reference would also be.
To read before your next question.

Regards
Michel

Re: Add Check Constraints to table [message #423700 is a reply to message #423698] Sat, 26 September 2009 14:17 Go to previous messageGo to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member


Thanks michel....
Re: Add Check Constraints to table [message #424146 is a reply to message #423694] Wed, 30 September 2009 06:00 Go to previous messageGo to next message
lakshmi veena
Messages: 4
Registered: March 2009
Location: Bangalore
Junior Member
Can you please let us know how you recovered the deleted constraints. So it will be useful for the learners.

[Updated on: Wed, 30 September 2009 06:05]

Report message to a moderator

Re: Add Check Constraints to table [message #424151 is a reply to message #424146] Wed, 30 September 2009 06:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You cannot recover a dropped constraint, you can just recreate it (unless you want to recover the whole database up to before drop).

Regards
Michel
Re: Add Check Constraints to table [message #424155 is a reply to message #424151] Wed, 30 September 2009 06:19 Go to previous messageGo to next message
lakshmi veena
Messages: 4
Registered: March 2009
Location: Bangalore
Junior Member
Thanks Michel,

I have one more question,
If we drop a table from the database, it will drop all the (say dependent objects like views,constraints,Indexes) on that table also. I hope we can recover a dropped table by using 10g. If so, will it recovers the dependent objects also.


Please correct me If I am wrong

[Updated on: Wed, 30 September 2009 06:24]

Report message to a moderator

Re: Add Check Constraints to table [message #424160 is a reply to message #424155] Wed, 30 September 2009 06:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, if you drop a table then you drop the constraint and can recover both of them using recycle bin (if it is active).

Regards
Michel
Re: Add Check Constraints to table [message #424161 is a reply to message #424160] Wed, 30 September 2009 06:28 Go to previous message
lakshmi veena
Messages: 4
Registered: March 2009
Location: Bangalore
Junior Member
Thanks Michel....
Previous Topic: ora 00600 internal error
Next Topic: Extract a Specific Pattern From Random Data
Goto Forum:
  


Current Time: Wed Dec 07 03:20:47 CST 2016

Total time taken to generate the page: 0.09255 seconds