IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to access SYSCAT.INDEXES


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Thu Apr 25, 2013 1:08 am
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

Moderator Emeritus


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

PostPosted: Thu Apr 25, 2013 1:32 am
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: 68

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

Hi Dick Scherrer,


I found the information in the below link
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 25, 2013 2:21 am
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: 68

PostPosted: Thu Apr 25, 2013 2:23 am
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: 1020
Location: India

PostPosted: Thu Apr 25, 2013 9:58 am
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

Superior Member


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

PostPosted: Thu Apr 25, 2013 10:05 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts access the last host command CLIST & REXX 2
No new posts CICS Access to RACF CICS 2
No new posts Access library name in REXX CLIST & REXX 6
Search our Forums:

Back to Top