29 March,2016 by Tom Collins
A user reported the following error , when executing a SELECT statement on a VIEW.
[user1@server1 ~]$ db2 "select count(*) from MYSCHEMA.MYTABLE” SQL0575N View or materialized query table "MYSCHEMA.MYTABLE" cannot be used because it has been marked inoperative. SQLSTATE=51024
Another way to check on the error message and as a way to validate the initial error message is to check the the syscat.view valid column. If you see anything other than a Y , then action is required
db2 "SELECT viewschema,viewname,valid FROM syscat.views where viewname = 'MYTABLE'"
The main reason for the error is because an alias, privilege, table or view dependant on by the DB2 VIEW has been changed.
Usually recreating the VIEW and resetting the privileges will fix the issue. If problems persist , check that the underlying objects such as tables referenced are still valid
Once the VIEW is reset , connect on as a valid user and execute a SELECT statement to confirm the VIEW is valid again/
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |