Home » SQL & PL/SQL » SQL & PL/SQL » index
index [message #454058] Mon, 03 May 2010 23:56 Go to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
I want enable index?

I try as:
alter index reg_id_pk enable
but getting error as....
ORA-02243: invalid ALTER INDEX or ALTER MATERIALIZED VIEW option

I want disable the index while inseration of data in table......

Current status of Index is as:
Index_name Index_type compression
REG_ID_PK NORMAL DISABLED

What should need::::
Re: index [message #454060 is a reply to message #454058] Tue, 04 May 2010 00:04 Go to previous messageGo to next message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
alter index reg_id_pk enable

Quote:
I want disable the index


If you want to disable then use:
alter index ... disable;

Copy and paste your whole SQl*Plus session.

Regards
Michel
Re: index [message #454061 is a reply to message #454060] Tue, 04 May 2010 00:07 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
alter index emp_id disable

I try that but giving error as

ORA-02243: invalid ALTER INDEX or ALTER MATERIALIZED VIEW option
Re: index [message #454074 is a reply to message #454061] Tue, 04 May 2010 00:52 Go to previous messageGo to next message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Copy and paste your whole SQl*Plus session.

Before Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

Regards
Michel
Re: index [message #454075 is a reply to message #454061] Tue, 04 May 2010 00:53 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
Index can not be disabled; drop it instead.


To enable index
ALTER INDEX myindex REBUILD;


Thanks
Ved

[Updated on: Tue, 04 May 2010 00:56]

Report message to a moderator

Re: index [message #454076 is a reply to message #454075] Tue, 04 May 2010 00:57 Go to previous messageGo to next message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Its_me_ved wrote on Tue, 04 May 2010 07:53
Index can not be disabled; drop it instead.

Thanks
Ved

Hmmm.
SQL> create table t (val varchar2(10));

Table created.

SQL> create index i on t (upper(val));

Index created.

SQL> insert into t values ('michel');

1 row created.

SQL> commit;

Commit complete.

SQL> alter index i disable;

Index altered.

@OP this is how you should post your session.

Regards
Michel

[Updated on: Tue, 04 May 2010 00:57]

Report message to a moderator

Re: index [message #454090 is a reply to message #454076] Tue, 04 May 2010 01:18 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
Sorry, I was wrong here. Thanks Michel for pointing out the mistake.

Regards
Ved
Re: index [message #454091 is a reply to message #454090] Tue, 04 May 2010 01:21 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
when there is function based index then only we can ble to disable the index

in other type of index we need to use unsable and after use we need to rebuild


Am I Right::::?


Regard
Lokesh
index [message #454093 is a reply to message #454091] Tue, 04 May 2010 01:25 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
after creation of Index

I want see or use index like

select * from emp

or

select index_name,ename from emp

like that

how we can use index to retrieve data::::?
Re: index [message #454095 is a reply to message #454091] Tue, 04 May 2010 01:25 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
Why not you give a try and confirm here?

Please go through here

Regards,
Ved

[Updated on: Tue, 04 May 2010 01:27]

Report message to a moderator

Re: index [message #454097 is a reply to message #454095] Tue, 04 May 2010 01:27 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
I already try that but getting errors

not getting proper way
thats why asking solution

how to use index for retrial of data::::::::::::?
Re: index [message #454099 is a reply to message #454097] Tue, 04 May 2010 01:31 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
http://www.orafaq.com/forum/mv/msg/157359/454068/136607/#msg_454068

sriram Smile
Re: index [message #454101 is a reply to message #454099] Tue, 04 May 2010 01:35 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
http://www.sc.ehu.es/siwebso/KZCC/Oracle_10g_Documentacion/server.101/b10759/statements_1008.htm

sriram Smile
Re: index [message #454102 is a reply to message #454091] Tue, 04 May 2010 01:38 Go to previous messageGo to next message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
lokeshsurana wrote on Tue, 04 May 2010 08:21
when there is function based index then only we can ble to disable the index

in other type of index we need to use unsable and after use we need to rebuild


Am I Right::::?


Regard
Lokesh

Rigth!

Regards
Michel

Re: index [message #454103 is a reply to message #454097] Tue, 04 May 2010 01:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68765
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
lokeshsurana wrote on Tue, 04 May 2010 08:27
I already try that but getting errors

not getting proper way
thats why asking solution

how to use index for retrial of data::::::::::::?

Once again: COPY AND PASTE WHAT YOU DID.
We can't know what you did, we can't know what to answer but pointing you to the documentation.
Do you really want to be helped more?

Regards
Michel

[Updated on: Tue, 04 May 2010 01:43]

Report message to a moderator

Re: index [message #454105 is a reply to message #454101] Tue, 04 May 2010 01:44 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Quote:
I already try that but getting errors

You should do that again....(Reading documents)

SQL> CREATE TABLE c(c1 INT, c2 INT);

Table created.

SQL> CREATE INDEX ci ON c (c1, c2);

Index created.

SQL>  ALTER TABLE c ADD CONSTRAINT cpk PRIMARY KEY (c1) USING INDEX ci;

Table altered.

SQL> alter index ci disable;
alter index ci disable
*
ERROR at line 1:
ORA-02243: invalid ALTER INDEX or ALTER MATERIALIZED VIEW option


SQL>  alter index ci unusable;

Index altered.

SQL>


sriram Smile
Re: index [message #454108 is a reply to message #454093] Tue, 04 May 2010 01:58 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
Quote:

after creation of Index

I want see or use index like

select * from emp

or

select index_name,ename from emp

like that

how we can use index to retrieve data::::?


Index is basicaly used to retrieve data fast.One way we make table access faster is to create an index on that table. You are probably very familiar with indexes and there is an index at the end of the book. If you want to find out about Oracle tables, you go to the end of the book, look in the index, and it tells you which page to read for information on Oracle indexes. Without this index, finding a topic would be much more difficult. Now imagine if we asked you to find every instance of the word 'the' in the book. How long would it take you?

Please go through the link provided to you. It will help you to understand

Thanks
Ved

[Updated on: Tue, 04 May 2010 02:00]

Report message to a moderator

Re: index [message #454109 is a reply to message #454108] Tue, 04 May 2010 02:01 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
Thanks
@Ved
Re: index [message #454110 is a reply to message #454109] Tue, 04 May 2010 02:03 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
Hope you got it. You should be thankful to Michel and Ramoradba as well.

Regards
Ved

[Updated on: Tue, 04 May 2010 02:03]

Report message to a moderator

Re: index [message #454111 is a reply to message #454109] Tue, 04 May 2010 02:07 Go to previous message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
Thanks
@Michel and Ramoradba as well.
Previous Topic: rowid
Next Topic: Need help in SQl Query
Goto Forum:
  


Current Time: Fri Aug 08 19:59:31 CDT 2025