Does Oracle re-enable an already enabled constraint

Hi All,
If my constraints are already enabled and I issue the following enable command:
alter table <table_name> enable constraint <constraint_name>;
Will oracle re-enable this already enabled constraint - i.e go through the table data validating each column/columns(as teh case may be) againist the constraint rules, or it will simply do nothing since the constraint is ok?
Thanks.

At leats if they previsouly were enabled with novalidate Oracle WILL DEFINTELY CHECK THEM. Example:
Connected to Oracle Database 11g Release 11.2.0.1.0
Connected as gints
SQL> create table t(a number);
Table created
SQL> insert into t values (null);
1 row inserted
SQL> alter table t add constraint a_nn check(a IS NOT NULL) enable novalidate;
Table altered
SQL> alter table t enable constraint a_nn;
alter table t enable constraint a_nn
ORA-02293: cannot validate (GINTS.A_NN) - check constraint violated
SQL> Gints Plivna
http://www.gplivna.eu

Similar Messages

  • I've found two bugs in iOS 7. 1) declined calls does not appear as missed calls on the lock screen/notification centre. 2) when bluetooth is enabled from control center, it does not connect to an already paired bluetooth device

    I've found two bugs in iOS 7:
    1) declined calls does not appear as missed calls on the lock screen/notification centre - iOS 7.0.2.
    2) when bluetooth is enabled from control center, it does not connect to an already paired bluetooth device automatically - iOS 7.0.

    We are all users here, just like you, but you can tell Apple about it by using this link:
    Apple - iPhone - Feedback

  • Can Oracle 9i enable schema/table creation to be transacted?

    If anyone can help with this, that would be much appreciated.
    So - the server has disabled autocommit and commits/rollbacks are handled by the application. Even though this is the case, Oracle 9i is not rolling back changes that have (i) created schemas/users and/or (ii) tables.
    Worse still, it seems to be performing a partial rollback - some tables in a schema are left with data and others are not.
    Now, this may be caused by our server creating tables for indexing while adding data to some existing tables - that is the table definitions have auto-committed the transaction to date, also committing the table insertions/updates.
    After some delving, the JDBC driver has the following method: dataDefinitionCausesTransactionCommit - for Pointbase and other databases, this returns false - for Oracle it returns true.
    The questions are therefore:
    1) Is there a solution with Oracle 9i that enables schema and table creation to be transacted?
    2) Does Oracle 10g allow definition clauses to be transacted?

    Actually I believe there is a limited way to make DDL statements transaction based via the CREATE SCHEMA command.
    From the 9.2 SQL manaul >>
    Use the CREATE SCHEMA to create multiple tables and views and perform multiple grants in a single transaction.
    To execute a CREATE SCHEMA statement, Oracle executes each included statement. If all statements execute successfully, Oracle commits the transaction. If any statement results in an error, Oracle rolls back all the statements.
    <<
    This may be of some limited use to you, but your process should probably be changed to track of the DDL and to undo (drop) any created objects if a rollback is issued.
    HTH -- Mark D Powel --

  • Problem in enabling constraint - after disabling and truncation of table .

    Hello Friends,
    I have a table called DRR_TABLES that has list of table names . The requirement is to truncate the tables present in DRR_TABLES except KEY_IDS table and table_name like '%TYPE%' table.
    written a procedure . successfullly truncating the tables from DRR_TABLES but while enabling constraints after truncation , I am getting problem in enabling constraints .
    ERROR at line 1:
    ORA-02270: no matching unique or primary key for this column-list
    ORA-06512: at "schema123.TRUNCATE_DRR_TABLES ", line 49
    ORA-06512: at line 1
    Heres is the code .
    PROCEDURE TRUNCATE_DRR_TABLES is
    x varchar2(200);
    v_tablecount number := 0;
    cursor c is select TABLE_NAME from DRR_TABLES where population_source='PUBLISHING' and TABLE_NAME != 'KEY_IDS' and TABLE_NAME NOT LIKE '%TYPE%';
    BEGIN
    DBMS_OUTPUT.PUT_LINE (' TRUNCATING DRR TABLES ...........');
    OPEN c ;
    LOOP
    FETCH c INTO x ;
    EXIT WHEN c%NOTFOUND;
    for c1 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status ='ENABLED' ORDER BY CONSTRAINT_TYPE DESC )
    loop
    begin
    execute immediate ('alter table '||c1.table_name||' disable constraint '||c1.constraint_name|| ' cascade');
    NULL;
    end;
    end loop;
    EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || x ;
    v_tablecount := v_tablecount + 1 ;
    DBMS_OUTPUT.PUT_LINE('TABLE TRUNCATED :'|| x );
    END LOOP ;
    DBMS_OUTPUT.PUT_LINE (' TOTAL TABLES TRUNCATED ' || v_tablecount );
    CLOSE c;
    OPEN c ;
    LOOP
    FETCH c INTO x ;
    EXIT WHEN c%NOTFOUND;
    for c2 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status = 'DISABLED' ORDER BY CONSTRAINT_TYPE)
    loop
    begin
    execute immediate ('alter table '||c2.table_name||' enable constraint '||c2.constraint_name);
    NULL;
    end;
    end loop;
    END LOOP ;
    CLOSE c ;
    END TRUNCATE_DRR_TABLES ;
    LINE 49 is the line corresponding to enable constraint statement.
    Edited by: kumar73 on 3 Sep, 2012 11:44 PM

    It is such a pity that a user having 321 posts till date is unaware of basics of Posting a Question.
    1. You need to provide us with your Oracle version
    select * from v$version;2. You need to understand and get accustomed to using tags before and after Code or SQL's for better readability.
    3. You need to provide us with the Table Structure and the Constraints Definition.
    There are many things that looks like Bad Coding practices:
    <font face="Times New Roman" size=2>
    1. Avoid RBAR (Loops).
    2. Implement Bulk Collect.
    3. Why do you need to disable the constraints before truncating? Are you kind of handling the Referential Integrity Constraints?
    4. Duplicate checking of Disabled Constraints.
    5. When the procedure is being executed at Production Environment, are you going to Monitor the DBMS_OUTPUT? Why not Log the Statements into a LOG Table?
    6. Why use a TableCount variable? Would the TableCount Variable be not equal to the Number of Records returned by Cursor C?
    7. What is the need to use a NULL statement after every Execute Immediate?
    8. What is the Need to surround each execute Immediate with Begin .. End block?
    9. Where is your Exception handling Block? Forgot to write?
    </font>
    What has been your effort in finding which Constraint/Table is causing you the trouble?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • ENABLE CONSTRAINT

    Hello All,
    version details :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
    OS :
    SunOS 107 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V890
    Issue :
    I have executed a PLSQL which enables all the disabled constraints in a schema....
    Enabling one constraint is taking 15 hours...this step has not take this much time previously...
    There is no blocking session in V$lock....
    The object is locked by only the current session in v$locked_object...
    I know killing and reexecuting the step might solve the issue but i want to know for sure what is blocking it before killing it......'
    Alert log shows no sign execute for redo switch.......
    the hanging statement is below,
    ALTER TABLE UC_ADDRESS_INFO_TX ENABLE CONSTRAINT FK_ADDR_INFO_ROLE_MAP_CD
    Thanks in advance
    Vijay G

    No it`s not because the same table .. the process is below,
    i take an export of production DB, I do structure import ,then i disable the constraints ,then import few required tables alone for the application then i enable the constraints and then i do an analyze . The whole process takes 5 hours now it`s been fifteen hours.
    I have done individual enable before but why is this taking time... i am going to change this into enable novalidate sort but i wnated to know why it is hanging before i do any changes.......
    Regret for the inconvenience,
    Thanks ,
    Vijay G

  • Stuck at "about to enable constraints..."

    Hi, I am new to Oracle,pls help me:
    I am importing a dump file into the dbs using IMP on oracle 10g. The import process stopped at
    about to enable constraints...
    for the whole day. would u pls tell me what is the reason...
    thanks in advance

    Hi all,
    it stucks again. "about to enable constraints...".
    the log file looks like:
    IMP-00002: failed to open EXPDAT.DMP for read
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    . importing XXX's objects into XXX
    IMP-00008: unrecognized statement in the export file:
    . . importing table "AAAAAA" .. rows imported
    . . importing table "BBBBBB" .. rows imported
    . . . . .

  • ALTER TABLE ENABLE CONSTRAINT FK is very slow

    Hello,
    The following enable constraint command takes around (15min to be completed)
    ALTER TABLE table_name ENABLE CONSTRAINT fk_constraint_name ;table_name: (~133 Millions rows)
    Any idea why it takes long to be completed? and what could be done to improve the performance?
    Thanks in advance

    Enabling a foreign means the database has to check the existence of each value in the child table column against the key in the parent table. Now you say,
    The following enable constraint command takes around (15min to be completed)
    table_name: (~133 Millions rows)In other words, ithe database is validating about ten million rows a minute. That doesn't seem too shabby. So what would you consider to be a reasonable amount of time to accomplish this task?
    Bear in mind the golden rule of tuning: ye cannae break the laws of physics. Acting on large volumes of data must necessarily take some time. You must be realistic.
    Also, why is it a problem? This is the sort of task which ought to be undertaken only occasionally. If you're doing it often enough that fifteen nminutes is unacceptably long perhaps you should reconsider why you're disabling the constraint. See whether there's another way to achieve whatever it is you're doing. After all, the most effective way to reduce something's elapsed time is to avoid doing that thing at all.
    Cheers, APC

  • Enable constraints into exceptions return no matching rowids

    with reference to http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general005.htm
    Whether I'm using
    Method 1 ALTER TABLE country add
    (CONSTRAINT country_pk PRIMARY KEY (country_code)
    USING INDEX STORAGE (initial 5K) EXCEPTIONS INTO exceptions);
    OR
    Method 2
    ALTER TABLE country enable constraint country_pk EXCEPTIONS INTO exceptions;
    select * from country where rowid in (select rowid from exceptions);
    there's still no matching rowid, why is this so?
    My purpose is to find out which records is causing the constraint failure.
    thanks

    You have to careful with your query:
    select * from country where rowid in (select rowid from exceptions);But the corresponding column in the "EXCEPTIONS" table is called "ROW_ID".
    So it probably should be:
    select * from country where rowid in (select row_id from exceptions);Otherwise you're selecting the actual rowid from the exceptions table which is not what you're looking for.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Estinamted time for enabling constraints

    Just curious, does any one know how long it would take for enabling one disabled constraint on a 166gb table? The table has 34 columns and 2 primary keys.
    i did a "alter table <table_name> enable constraint <constraint_name>" and this statement has been running for 50 mins now.
    Thanks

    969224 wrote:
    Just curious, does any one know how long it would take for enabling one disabled constraint on a 166gb table? The table has 34 columns and 2 primary keys.
    i did a "alter table <table_name> enable constraint <constraint_name>" and this statement has been running for 50 mins now.
    Thanksenabling CONSTRAINT will take longer than disabling the same constraint.
    The exact answer is that "It depends".

  • Enabling Constraints

    Hi All,
    Some generic conceptual questions.
    Oracle Database Version: 11.1.0.7
    1) Is there any time difference between enabling constraint on a Non-partitioned table and enabling constraint on a partitioned table, both tables having same no. of records?
    2) Suppose, we have 3 tables A, B and C.
    B and C have FK on Table A. After loading data I want to enable constraints on table B and C. Can I do that in parallel? Or do I have to wait for one table to enable constraint and then start enabling FK constraint for the second table? Is there some locking mechanism, which enables lock on Table A while enabling FK on table B is happening?
    Thanks,
    Ishan
    Edited by: Ishan on May 12, 2012 3:54 PM

    >
    Hi,
    1) Is there any time difference between enabling constraint on a Non-partitioned table and
    enabling constraint on a partitioned table, both tables having same no. of records? http://docs.oracle.com/cd/B10501_01/server.920/a96521/partiti.htm
    =====================
    Partitions and subpartitions of a table or index all share the same logical attributes. For example, all partitions (or subpartitions) in a table share the same column and constraint definitions, and all partitions (or subpartitions) of an index share the same index options. They can, however, have different physical attributes (such as TABLESPACE).
    ======================
    2) Suppose, we have 3 tables A, B and C.
    B and C have FK on Table A. After loading data I want to enable constraints on table B and C.
    Can I do that in parallel? Or do I have to wait for one table to enable constraint and then start
    enabling FK constraint for the second table? Is there some locking mechanism, which enables
    lock on Table A while enabling FK on table B is happening?Why in parallel? AFAICS from the docco above, enabling CONSTRAINTs is a "binary" thing for all partitions - it's
    either enabled or it's not.
    Are you enabling this on a production server while updates are taking place? You might wish to consider
    looking at DEFERRABLE? But, you use the term "loading" so this isn't prod?
    Googling "enable constraint partitioned table" and "constraint deferrable oracle partitioned table" gave several
    interesting pages which may be of interest, but I don't know enough about your case to help further.
    HTH all the same,
    Paul...
    IshanEdited by: Paulie on 12-May-2012 20:42

  • Does 10.6 enable a better way to share an iPhoto Library? (Permissions)

    Apple's official approach to sharing an iPhoto Library between multiple users is to move the library to an external drive or a new disk image with permissions disabled:
    http://tqe.quaker.org/2007/TQE159-EN-War.html or use a
    This is not a terribly elegant solution. The disk image will cause backup problems with a lot of software (single bit change causes 30GB backup) and an external drive is a bit silly.
    The problem is the UNIX permissions model in 10.5. They cause many similar problems with sharing things. Every time a user adds or changes a file they get ownership, and other users lose ownership.
    I believe Windows 7 does not have this particular problem.
    Does 10.6 enable a better solution to the sharing and permissions problem than 10.5?

    For iPhoto 09 (version 8.0.2) and later:
    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
    (You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    This works on 10.5 and 10.6
    Regards
    TD

  • Enable constraint issue

    i want to enable a constraint but got error no such constraint.
    but when i select it from user_constraints it is available for that table.
    thanks
    SQL> select constraint_name from user_constraints where table_name='tbl_RefundCredit';
    CONSTRAINT_NAME
    SYS_C0016751
    SQL> ALTER TABLE tbl_RefundCredit enable CONSTRAINT SYS_C0016751;
    ALTER TABLE tbl_RefundCredit enable CONSTRAINT SYS_C0016751
    ERROR at line 1:
    ORA-02430: cannot enable constraint (SYS_C0016751) - no such constraint

    kindly put the constraint name inside single quote or double quote
    then try
    dont mind i dont have the s/w .. so you have test it...

  • Does photoshop elements enable save for web for a batch of photos?

    does photoshop elements enable save for web or ready for web for a batch of photos ?

    Hi Patonabike,
    You can batch save images as jpeg, png, tiff etc. using Process Multiple Files. This feature will even allow you to batch resize them (as long as they are the same orientation and aspect ratio). However, the resulting images may be larger than what you would get if you individually did 'Save for Web' because 'Save for Web' removes the photo's exif data (and Process Multiple Files won't).
    With that said, it depends how you are editing your images and the results you are looking for, if you just want to rescale them or batch edit them - this is one way.
    Hope it helps!
    Clarice

  • Does IOS 8 enable Ipad Air to send SMS to any phone ?

    Does IOS 8 enable Ipad Air to send SMS to any phone ?

    iOS8 is not released yet (due fall 2014). No one here knows the specifics...this is the overview Apple has released:
    http://www.apple.com/ios/ios8/
    Barry
    P.S. double post, double answer
    Message was edited by: Barry Hemphill

  • Enable constraints in parallel

    Hi,
    I am in the process of seeding up import.
    In our Datawarehouse environment enabling constrainta during import takes lot of time..To improve the performance of this step, i created constraints script seperately added parallelism in all commands (eg: alter table x1 add constraint xc1 .....enable parallel 4;)
    i changed degree os paralllelism of each table to 4 , i included following command at the start of the script.
    alter session force paralllel ddl parallel 4;
    Still constraints are not being enabled in parallel.
    How can i make these constraints enable step uses paralllelism.
    Is there is any other way to improve enable constraint performence during import.
    We are on 10.2.0.4 ...sun solaris 10 and we are using data pump.
    Thanks
    Pramod

    To speed up the import use exclude=statistics parameter
    see this link for enabling index
    http://www.asktherealtom.ch/?p=214

Maybe you are looking for

  • (early 2014) rMBP abruptly goes black (sleep mode) when computer is tilted at certain angles or lifted.

    My (early 2014) rMBP abruptly goes black (sleep mode) when computer is tilted at certain angles or lifted. Ive reset Energy saver mode to factory defaults and the problem still occurs.

  • Web Credentials, Unknown Account on Skype

    Hi! I checked my web credentials, and I have two unknown accounts through my Skype. I remove them but they keep coming back. What can I do? I don't understand why and is this person able to access all my info?

  • Outgoing email in Sent (1)

    My iPhone 3GS was trying to send an email, but for some reason all the email IDs became garbled and it was stuck in the send cycle. So I did a hard reset to get out of that. When it came back, the mail client was able to connect to the mail server ag

  • Can't burn with new iTunes

    I was just trying to burn a playlist and the window in iTunes now says "Disc burner or software not found ..." What the heck is that all about?!

  • ITunes shuts down when I connect my IPod

    Hello to all. Everytime I connect my IPod to my PC, iTunes shuts down. If I disconnect the IPod, I can use iTunes. What happened? I already installed the newest software. The problem is new for me, some days ago I could use ITunes normally with my IP