Dropping index
What is the lock machanisim when we drop the index in oracle?
Let us say, i am dropping index, while dropping index, another process writing the data in index segment. In this scenario, drop index will wait for another process to complete? Please let me know.
I am using oracle11g.
I opened two sessions and run insert statement in one sesson. In another session, dropped the index. Drop index was waiting to complete the insert process in another session. Hence, drop index will throw error ORA-0054.
Drop index will wait.
Similar Messages
-
Dropping index gives ORA-29861
Hello
We have an application which reads data from MapInfo Spatialware using MapInfo Professional and upload this data into Oracle Spatial tables using MapInfo Easy Loader utility.
The constraint is that tables in oracle spatial must not be dropped. So we have written a stored procedure which queries unique and spatial indexes of a feature table, then it drops them and truncates the table.
Easy loader then uploads fresh data into these truncated tables and re creates spatial and unique indexes.
This solution is working fine except for 1 feature table "ZONE". The stored procedure is unable to drop the indexes and error log shows error "ORA-29861: domain index is marked LOADING/FAILED/UNUSABLE".
I looked into discussion forums and they say to drop the indexes specifying keyword "FORCE" but how can i query whether index is corrupt and i must force drop it. Index state is all VALID which i check them...
below is the stored procedure....
CREATE OR REPLACE
PROCEDURE Spa_Initializetables
( TNAME IN VARCHAR2,
SPATIALCOL IN VARCHAR2,
ERROR_CODE OUT NUMBER,
ERROR_MESSAGE OUT VARCHAR2
IS
CURSOR c1 IS
SELECT * FROM user_sdo_index_info WHERE table_name LIKE UPPER(TNAME) AND column_name LIKE UPPER(SPATIALCOL);
BEGIN
--Truncate the given table
EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || TNAME;
--Loop through all the indexes found and drop them one by one
FOR cur_ts IN c1 LOOP
--DBMS_OUTPUT.PUT_LINE(cur_ts.index_name);
EXECUTE IMMEDIATE 'DROP INDEX '|| cur_ts.index_name;
END LOOP;
ERROR_CODE := 0;
EXCEPTION
WHEN OTHERS THEN
ERROR_CODE := 1;
ERROR_MESSAGE := SQLERRM;
END Spa_Initializetables;
please let me know what best i can do
Regards
SamSorry, but I can't simulate this troulbe. look:
create table a (id number, lmao mdsys.sdo_geometry)
INSERT INTO mdsys.sdo_geom_metadata_table (SDO_OWNER,SDO_TABLE_NAME,SDO_COLUMN_NAME,SDO_DIMINFO,SDO_SRID)
VALUES ('GIS','A','LMAO',SDO_DIM_ARRAY(
SDO_DIM_ELEMENT('X', -180,180, 5e-4),
SDO_DIM_ELEMENT('Y', -180,180, 5e-4)), NULL);
create index a_g_idx on a(lmao) indextype is mdsys.spatial_index;
insert into a values (1,SDO_geometry(2003,NULL,NULL,SDO_elem_info_array(1,1003,3),SDO_ordinate_array(1,1, 2,2)));
commit;
truncate table a;
insert into a values (2,SDO_geometry(2003,NULL,NULL,SDO_elem_info_array(1,1003,3),SDO_ordinate_array(1,1, 2,2)));
drop table a;
No errors :(
I have 10.2.0.3
May be i didn't understood you ? -
How to include Drop index in PL/SQL
Hi,
In my PL/SQL, I put a drop index statement in between, but it gave me an error of
"PLS-00103: Encountered the symbol "DROP" when expecting one of the following:
begin declare exit for goto if loop mod null pragma raise
return select update while <an identifier>
<a double-q"
My statement is structured as:
DECLARE
BEGIN
DROP INDEX index_name;
COMMIT;
END;
Why is this error occuring? When I execute the drop index statement seperately it is ok. When i put it in the PL/SQL it gave me error.
Do I need special syntax to include a Drop index statement in a PL/SQL?
ThanksAny DDL commands in PL/SQL must be executed using dynamic SQL:
execute immediate 'drop index index_name'; -
Publish: dropping index when it is used for foreign key constraint enforcement
Hi,
I'm trying to update a target schema from a reference database via Publish. Among the changes to apply, there's an index that needs to be dropped. Since it's linked to a foreign key constraint, it cannot be deleted unless the foreign key is temporarily dropped
(I saw somewhere that disabling the foreign key should be enough but it doesn't seem to work either).
Since there are other changes to be made on the same table, this foreign key also has to be dropped before the script can delete the table and re-create it. This part of the script is correctly generated. The problem is that this part appears after the 'DROP
INDEX' instruction.
So when generating the update script, SSDT tries to drop the index BEFORE dropping the foreign key. And I can't drop the foreign key in my custom pre-deployment script, otherwise the update script would fail when trying to delete it again.
Shouldn't SSDT be smart enough to drop the constraint before the index? Is it a bug or did I forget to set an option? If it's not a bug, what can I do apart from doing it manually?
Thank you for your helpHi Elsa,
That sounds like a bug. Could you please file a Connect issue for this at
https://connect.microsoft.com/SQLServer/feedback/CreateFeedback.aspx using the category "Developer Tools (SSDT, BIDS, etc.)"? We're trying to track all bugs through
Connect so that you can tell when we have fixed the issue and we can request more information.
A workaround for this issue might be to write a pre-deployment script for your project to drop the foreign key prior to deployment. A pre-deployment script can be added to your project by right-clicking on the
project in solution explorer and then clicking on Add > Script... and selecting Pre-Deployment Script from the list.
Thanks! -
Dropping Index taking too much time
Hi, I am trying to drop an index. Its not yet finished... why its taking too much time to drop?
Please put your suggestions..
RgdsSQL> drop index QS_TEXT_MST_IXCON force;its taking too much time ... after 2 hours i terminated the session.
When i check that index status ...
SQL> select index_name,status,DOMIDX_OPSTATUS,DOMIDX_STATUS from user_indexes where table_name='QS_TEXT_MST';
INDEX_NAME STATUS DOMIDX DOMIDX_STATU
QS_TEXT_MST_IXCON VALID FAILED VALID
QS_TEXT_MST_PK VALID
SQL> create index MAMPROD.QS_TEXT_MST_IXCON on MAMPROD.QS_TEXT_MST(UPD_FLG) indextype is ctxsys.context
parameters(' datastore QS_TEXT_MST_IXCON_DST'); 2
create index MAMPROD.QS_TEXT_MST_IXCON on MAMPROD.QS_TEXT_MST(UPD_FLG) indextype is ctxsys.context
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10507: duplicate index name: QS_TEXT_MST_IXCON
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364wot to do? -
Hi all,
Is there any function module which drop index of cube, as that we have a function module to drop the index of ods (SSM_PROCESS_ODS_DROP_INDEXES).
Any kind of tips will be appreciated.
Thanks in advance.
Regards,
BabuHi,
Try this 'RSDU_INFOCUBE_INDEXES_DROP'.
Hope this helps.
PB -
DAC - drops indexes in the task but does not create them back
DAC is dropping indexes for a task but not recreating them. The execution plan drop/create checkbox is checked and other tasks' index drop/create is working correctly. Index setup is checked for drop/create as well.
Is there somewhere within DAC that controls this function?
Any suggestions are appreciated.
Thanks.You want a "Drop Box" style folder. You should be able to achieve this by creating a folder and giving it permissions similar to the "Drop Box" folder in your users Public Folder (i.e. write only permissions.)
-
I am provisioning for automated database schema upgrades in a Windows Forms Application (VS2010/VB) which uses SQL Server Compact 3.5 SP2. A portion of the schema upgrade procedure uses TSQL commands passed to SQLCE like the following:
cmd.CommandText = "DROP INDEX [SaleComps$ProjID]"
cmd.ExecuteNonQuery()
However, when this command is processed by the SQLCE engine, I get the following error:
Command: DROP INDEX [SaleComps].[ProjID]
Error: The specified index does not exist. [ ProjID ]
But, if I try to recreate the index (or try to change the index column) I get the following errors which indicate that the index is still there:
Command: ALTER TABLE [SaleComps] ALTER COLUMN [ProjID] nvarchar(20) NULL
Error: Cannot alter a column that is part of a key or an index. [ Index Name = SaleComps$ProjID,Column = ProjID ]
Command: CREATE INDEX "SaleComps$ProjID" ON "SaleComps" ("ProjID" ASC)
Error: The specified index already exists. [ SaleComps$ProjID ]
Any ideas why this would not be working? Thanks!
-BGoodNo, I was guessing at the syntax from reviewing other web postings, some of which were in different SQL dialects.
While your SQLCE Toolbox did not provide the DROP INDEX command, it did provide most of the "Schema Diff" scripting commands. In hindsight, maybe SQLCE Toolbox should recognize when schema differences involve a Column which is used in an index, and
DROP the index before executing the ALTER COLUMN command, then re-CREATE the index with the modified column.
Despite this shortcoming, I am very thankful for the help provided by SQLCE Toolbox, and learned a little more about SQL scripting in the process.
Thanks, ErikEJ!
-BGood -
HOW TO DROP INDEX OF OTHER SCHEMA
hi,
I want to know how can we refer to objects that are of other schema. i need to drop an index of a table that belongs to some other schema and so if i write :
drop tablename.indexname; - its not working.
Please Help
ThanksYou are trying to drop an index on a table that belong to a different schema you are connected to.
Do not add the table name to your command.
Simply try
drop index schema_name.index_name;
Nico P. -
Do i need to drop index even when i drop data in data target
Hi ,
I am having a PC and i am dropping entire data in my data target. do i still need to add drop index to my process chain.
Can any one tell me what extactly happens if i drop data in a data targets and what happend if i drop the index? which tables it will be affecting.
Thanks,
Ram.Since you are dropping the whole table then there is no need to keep the index, deleting indexes is necessary only if you are loading data to the cube which has already data so that performance of data load won't be affected. Every time when you have data and don't delete the index, each record need to align properly with the existing indexes which will slow down data load, but if you delete indexes then no time will be spent on aligning exact position of the data and recreating index at the end of the data load doesn't take much.
thanks.
Wond -
URGENT HELP PLEASE - drop index hangs on SAP
Hi all,
OS = Linux
DBVersion = Oracle10.2.0.2
Need some urgent help advise please on how to get around this problem.
On a SAP system, am trying to drop six indexes, largest is 300MB and smallest is 50MB.
I tried running drop index sapusername.index_name on the 50MB index via SQL*Plus and it seems to be taking forever. Can anyone please suggest if there is anything I can check on the database on why it is taking such a long time?
I can leave it to run overnight but worried that when I come back the next day, it will still be hanged. Is there any quick way of dropping the index, .i.e. drop immediate ... :-)
Am not using SAP's BRTOOLs as it is also hanging from there and the SAP-ADMIN had approved for the DBA to drop it from our end instead.
Any response and advise on this will be very much appreciated.
From Google'ing, I found some that mentioned that the fault could be because of the existence of the constraints on the table that I am dropping the index of.
Checking the table, it has 17 SYS_ named constraints. None of these constraints have INDEX_NAME that refers to the indexes that am dropping.
Should I disable the constraints and then run the drop index again?
Thanks in advance.
Edited by: user649596 on Apr 13, 2010 11:49 PMShould I disable the constraints and then run the drop index again?NO, certainly not !!
Ask SAP Support on what methods you should use to diagnose the "hang" and what your next step(s) should be.
Hemant K Chitale -
Need help for ALE Remote lock while dropping indexes in process chain
Hi Gurus,
Object requested is currently locked by ALE Remote is the message i got while dropping indexes from the process chain and is red
Entire chain is now status R. I tried by repeat still the dropping indexes step fail in the process chain.
Could u please advise me.
Thanks,
SrikarHi,
Even check any lock is happened for the cube in SM12. If it not rectified with all possible solutions please paste error log in batch monitor tab.
Regard's
Suman -
Hi,
As David A. King suggested, HypersonicSQL requires the following syntax:
DROP INDEX table.index
Is the update of HSQLDictionary already scheduled/done?
Regards --LOTLINE is the table name?
It appears to be version-disabled since it's state is DV..
See:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14253/long_views.htm#ADWSM03060
and perhaps querying ALL_WM_VT_ERRORS will give you more clues. -
Hi!!!
I need to drop index but I need to know all the necesary for not harm the table.
Can you help me??
Thank's and regardsIs it an unnecessary index? or are u dropping some index arbitarily? keep in mind the performance issues in case if ur dropping a vital index....
the following syntax should do:
Drop index <Index_Name>; -
Need to recover dropped indexes from SQL Server 2008 R2
Hi All,
we are reestablishing the transaction replication all non-clustered indexes dropped due to this activity now we are suffering from performance issue is there any way ,we can recover all the dropped indexes.
Regards,
Pawan Singh
ThanksHi Pawan,
I had blogged about this in the past
http://sqllearnings.com/2012/04/04/subscription-re-initialization-and-non-clustered-indexes/
When you re-initialize there is an option which you need to set to true for the non-clustered indexes to be applied in the subscriber end.
If your replication re-initialization is pretty fast then you can set the option to true and then re-apply the snapshot..
Else easiest option is to script the indexes from publisher and create them in the subscriber.
HTH
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com -
I hate dropping indexes - any thoughts?
Hi All,
As a rule I try to avoid dropping secondary indexes on cubes during loads. I know its supposed to speed the load up etc...but overall I find it a real pain. The problem occurs when there is a load failure. So lets say we have dropped the index on the cube, started the data load and it fails for whatever reason. Since the job to reactive the index doesn't start the cube has no secondary indexes. So until someone goes in and fixes the problem, the cube will have awful performance.
I realize that you could have the secondary index start even in the event of a failed load, but that won't help you if the failed load has locked the cube or hung.
In 3.X I rarely dropped indexes and the loads worked fine. However, in 7.0 the DTP seems to really screw up when the indexes aren't dropped, forcing me to drop the indexes. Anyone have a sure fire way to ensure that the indexes are rebuilt without human intervention in the event of a screwup in the loads?
Thanks
ScottHi,
Thanks for the input and agree thats a possiblity - but generally I find a failed load either locks the cube, thus making it impossible to reconstruct the indexes without resolving it first, or it hangs for hours and does not go into red status.
So you are still left with human intervention...
Maybe you are looking for
-
This must be a simple fix, but for the life of me I can't figure it out. I just entered George Michael's CD, Faith into a new playlist. The playlist is set to sort albums by TITLE and then ARTIST. No matter what I do, this particular album will not g
-
I cant receive sms. When this first happened, I tried to reset my phone and it worked. But after a few days, I cant receive sms again. I tried to transfer my sim card to a different device and I was able to receive sms there.
-
Pass the data back from the jsp page to the java code
Hi, I have written an iView that receives an event using EPCF and extracts data from the client data bag. I need this iView to pass the data back from the jsp page to the java code. I am trying to do this using a hidden input field, but I cannot get
-
Wifi problem with iPhone 3GS/4.0 upgrade
I installed 4.0 on my 3GS , now I can't connect wifi to my iMac ... Therefore can't backup 2do or splash I'D which need wifi.. Any ideas apple ??
-
Do I need to be near a wifi server to acess the internet?
because i heard that you can acess the internet from anywhere on an itouch even if they dont have wifi. Also are ther any monthly fees?