var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to drop INDEX in DB2?
I want to know the command which will drop the indexes on the table ..I know " drop index index_name" but i am required to drop all the index on the tables without neccesarily passing the index name..
Any help will be highly apreciated.
just write a small batch job to grep each indexes present and drop them one by one:
e.g.: Consider you want to drop all the indexes of the tables under the schema name "ts_schema1" and the index schema is "ts_schema2": then you can try the following:
body of the script: (Considering you are on Unix/Aix)
db2 "connect to db_name"
for ind_name in `db2 -x "select distinct indschema||'.'||indname from syscat.indexes where tabschema in ('ts_schema1') and indschema in ('ts_schema2')"`
db2 "drop index $ind_name"