How to add column in an index [message #489601] |
Mon, 17 January 2011 23:02  |
rajesh4851
Messages: 89 Registered: January 2007
|
Member |
|
|
Hi,
I have created one unique index on one column of my table. Now i would like to add one more column in the same index without dropping the index. Pls suggest how to achive it.?
SQL > CREATE TABLE DEBUG_TABLE
2 (
3 SLNO NUMBER,
4 MESSAGE VARCHAR2(4000 BYTE),
5 CREATED_DATE DATE DEFAULT SYSDATE,
6 CREATED_TIME TIMESTAMP(6) DEFAULT SYSDATE
7 );
Table created.
SQL > CREATE UNIQUE INDEX index_debug1 ON debug_table (SLNO);
Index created.
SQL > ALTER INDEX index_debug1 ADD COLUMN MESSAGE;
ALTER INDEX index_debug1 ADD COLUMN MESSAGE
*
ERROR at line 1:
ORA-02243: invalid ALTER INDEX or ALTER MATERIALIZED VIEW option
SQL >
Regards,
Raj
|
|
|
|
|
|
|
Re: How to add column in an index [message #489612 is a reply to message #489605] |
Tue, 18 January 2011 01:42   |
John Watson
Messages: 8988 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Quote:I have requested for work around/ alternative solutions, don't misunderstand. Are you trying to minimize the downtime? If so, you could create a new index on both columns (use the online option) before dropping the original index. Then rename it, if you want to keep the name the same.
|
|
|
|