data block corruption

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SHE
    New Member
    • Oct 2006
    • 3

    data block corruption

    Hello to all.

    I would like to ask if I drop an index with primary key, is the foreign keys attached to it will be dropped also? If so, how I can verify all the foreign keys attached to it & recreate it afterwards...

    Many thanks,
    she :)
  • equipman
    New Member
    • Oct 2006
    • 2

    #2
    For this matter, you will not succeed in dropping the primary key initially, as you have foreign keys attached to it. What you could do to identify the foreign keys is to run a select query to check for all tables with foreign key X, then drop the initial primary key X.

    Originally posted by SHE
    Hello to all.

    I would like to ask if I drop an index with primary key, is the foreign keys attached to it will be dropped also? If so, how I can verify all the foreign keys attached to it & recreate it afterwards...

    Many thanks,
    she :)

    Comment

    • SHE
      New Member
      • Oct 2006
      • 3

      #3
      Originally posted by equipman
      For this matter, you will not succeed in dropping the primary key initially, as you have foreign keys attached to it. What you could do to identify the foreign keys is to run a select query to check for all tables with foreign key X, then drop the initial primary key X.

      sir can you give me the commands to query all the foreign keys?

      Comment

      • milonov
        New Member
        • Oct 2006
        • 32

        #4
        hi!
        you can try to find tables that have foreign key to some approptiate table using query like:

        select a.table_name,
        a.constraint_na me pkey_constraint ,
        a.r_constraint_ name
        from user_constraint s a
        where
        a.constraint_ty pe = 'R'
        and a.r_constraint_ name like '%YOUR_TABLE%'

        usially r_constraint_na me consists table name as part of constraint name

        Best regards,
        Michael Milonov,
        http://www.snotratech. com

        Originally posted by SHE
        sir can you give me the commands to query all the foreign keys?

        Comment

        • SHE
          New Member
          • Oct 2006
          • 3

          #5
          Sir,

          I run this command & no result found.

          select a.table_name,
          a.constraint_na me pkey_constraint ,
          a.r_constraint_ name
          from dba_constraints a
          where
          a.constraint_ty pe = 'R'
          and a.r_constraint_ name like '%DIFFGENERICNB R%'

          no rows selected

          pls. advise.

          Comment

          Working...