Fix of reason code “7” SQLCODE=-668 SQLSTATE=57016

In DB2, you may face this error. This error means that the access to the table is restricted. Do not be worry if you see this error because it may happen after the ALTER TABLE DROP COLUMN statement.

In order to fix this error, you need to run the REORG command as follows:

REORG TABLE [YOUR_TABLE_NAME]

After running this command, you will be able to access the table.

For more information about the DB2 REORG command check:
http://publib.boulder.ibm.com/infocenter/db2e/v9r1/index.jsp?topic=%2Fcom.ibm.db2e.doc%2Fsqlreorgt.html

This entry was posted in Database and tagged , , , , , by Hazem Saleh. Bookmark the permalink.

About Hazem Saleh

Hazem Saleh has more than eleven years of experience in Cloud, Mobile and Open Source technologies. He worked as a software engineer, technical leader, application architect, and technical consultant for many clients around the world. He is an Apache PMC (Project Management Committee) member and a person who spent many years of his life writing open source software. Beside being the author of the "JavaScript Unit Testing" book, "JavaScript Mobile Application Development" book, "Pro JSF and HTML5" book and the co-author of the "Definitive guide to Apache MyFaces" book, Hazem is also an author of many technical articles, a developerWorks contributing author and a technical speaker in both local and international conferences such as ApacheCon North America, Geecon, JavaLand, JSFDays, CON-FESS Vienna and JavaOne. Hazem is an XIBMer, he worked in IBM for ten years. Now, He is working for Nickelodeon New York as a Mobile Architect. He is also an OpenGroup Master Certified Specialist.

6 thoughts on “Fix of reason code “7” SQLCODE=-668 SQLSTATE=57016

  1. db2 “reorg table schema.table”

    SQL2216N SQL error “-668” occurred while reorganizing a database table or its
    indexes.

Comments are closed.