I am an SQL Server and DB2 DBA and have no clue about the Oracle. However, we end up having a client who use Oracle database and a question came as how an additional column can be added to a selected primary key columns. The current primary key consist of 2 columns and another column needed to be included in the primary key. What is the best way to do this. Can it be done by PL/SQL code ?. Anything special need to be done ?. Sorry, I don't have the Oracle version nor the OS info.
If a PK already exists, & is by definition unique, why is another column required?
Is the additional column already part of the existing table or does this "new" column need to be added to the table, too?
One way to do it is:
1) Create a unique index with the new primary-key columns.
2) Disable and Drop the primary-key constraint
3) Add the new primary-key constraint using index (just created in step 1).
You may want to read the fine Oracle® Database [SQL Reference|http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2103997] manual to get the syntax.