Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to access SYSCAT.INDEXES

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Thu Apr 25, 2013 1:08 am    Post subject: How to access SYSCAT.INDEXES
Reply with quote

Hi,

I want to identify the unused Indexes in our application. I am trying to get that information from the system catalog table, SYSCAT.INDEXES, but I am getting SQL code -204, ERROR: SYSCAT.INDEXES IS AN UNDEFINED NAME.

Can any one please help me in finding out the unused Indexes.

Thank you,
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Apr 25, 2013 1:32 am    Post subject:
Reply with quote

Hello,

Where did you find/learn SYSCAT.INDEXES?

There is no such system table . . .

If there was one, how would querying it identify unused indexes?
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Thu Apr 25, 2013 1:44 am    Post subject:
Reply with quote

Hi Dick Scherrer,


I found the information in the below link
http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.mon.doc%2Fdoc%2Fc0056434.html



It mentions,

To identify opportunities to save space and maintenance overhead, you can examine last used information for indexes every year by checking the LASTUSED column in the SYSCAT.INDEXES catalog view.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Apr 25, 2013 2:21 am    Post subject:
Reply with quote

From the top of the page I got which I clicked on your link:
Quote:
DB2 Version 9.7 for Linux, UNIX, and Windows
Mainframe DB2 is not the same as DB2 for Linux, UNIX, and Windows.
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Thu Apr 25, 2013 2:23 am    Post subject:
Reply with quote

So is there any other way to get the unused Indexes
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Apr 25, 2013 9:58 am    Post subject:
Reply with quote

Hi ravikumar15,

You should be looking at SYSIBM.SYSINDEXSPACESTATS

Regards,
Sushanth
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Apr 25, 2013 10:05 am    Post subject:
Reply with quote

For each index, a new real-time statistics column (LASTUSED) is maintained in table SYSIBM.SYSINDEXSPACESTATS. It is updated whenever the index is used in SELECT/FETCH, searched UPDATE/DELETE, Referential Integrity checking. The column is not updated for INSERT, LOAD, etc.

Be careful with indexes that enforce uniqueness.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts RACF profile access vasanthz All Other Mainframe Topics 11 Fri Sep 23, 2016 5:51 am
No new posts How to perform Digest Access Authenti... vasanthz All Other Mainframe Topics 0 Tue Mar 15, 2016 4:47 pm
No new posts Database access from COBOL amitmahalkar DB2 1 Wed Jan 27, 2016 11:33 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us