Good suggestion Joe... fortunately, it appears that everything is synced.

Thanks.
Larry

On Feb 22, 2010, at 3:18 PM, Joe D'Souza wrote:

> If you have a large number of results after Conny's query, you may want to
> auto generate a script to create all the missing indexes using that same
> query to generate the result in the form of SQL statements to create an
> index..
> 
> Joe
> 
> -----Original Message-----
> From: Action Request System discussion list(ARSList)
> [mailto:arsl...@arslist.org]on Behalf Of L G Robinson
> Sent: Monday, February 22, 2010 2:30 PM
> To: arslist@ARSLIST.ORG
> Subject: Re: AW: Help with Sybase indexes
> 
> 
> Thanks Conny... this is very helpful.
> Larry
> 
> On Feb 22, 2010, at 9:00 AM, Conny Martin wrote:
> 
>> Larry,
>> 
>> you should compare the metatables with the indexes oracle knows.
>> 
>> If one of these 2 statements gives you any rows, you have messed up your
> indexes.
>> 
>> SELECT name,'pk_idx for T-Table' FROM arschema WHERE schematype = 1 AND
> NOT EXISTS (SELECT * FROM user_indexes WHERE index_name = 'IT'||schemaid)
>> UNION ALL
>> SELECT name,'pk_idx for H-Table' FROM arschema WHERE schematype = 1 AND
> NOT EXISTS (SELECT * FROM user_indexes WHERE index_name = 'IH'||schemaid)
>> UNION ALL
>> SELECT name,'pk_idx for B-Table' FROM arschema WHERE schematype = 1 AND
> NOT EXISTS (SELECT * FROM user_indexes WHERE index_name = 'IB'||schemaid)
>> 
>> 
>> SELECT
> name,arschema.schemaid,schema_index.numfields,uniqueflag,indexname,f1,f2,f3
> FROM arschema,schema_index WHERE indexname NOT IN (SELECT INDEX_name FROM
> user_indexes) AND schema_index.schemaid = arschema.schemaid
>> 
>> HTH
>> 
>> Kind Regards Conny

Larry Robinson                                   n...@ncsu.edu
Office of Information Technology
NC State University                              919-515-5432 Voice
Raleigh, NC  27695-7109                          919-513-0877 FAX

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: "Where the Answers Are"

Reply via email to