Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / Operation not allowed for reason code "1" / 7 сообщений из 7, страница 1 из 1
10.01.2014, 15:32
    #38522126
lans
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Operation not allowed for reason code "1"
После восстановления бд из бекапа не работает ни один селект запрос, выдаёт ошибку Operation not allowed for reason code "1"
может кто сталкивался?
...
Рейтинг: 0 / 0
10.01.2014, 16:03
    #38522177
Mark Barinstein
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Operation not allowed for reason code "1"
lans,

sqlcode ошибки какой?
...
Рейтинг: 0 / 0
10.01.2014, 16:32
    #38522208
lans
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Operation not allowed for reason code "1"
Operation not allowed for reason code "1" on table "DBO.DOC".. SQLCODE=-668, SQLSTATE=57016, DRIVER=4.13.111
...
Рейтинг: 0 / 0
10.01.2014, 17:26
    #38522297
Mark Barinstein
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Operation not allowed for reason code "1"
lans,
C:\>db2 "? sql668"

SQL0668N Operation not allowed for reason code "<reason-code>" on table
"<table-name>".

Explanation:

Access to table "<table-name>" is restricted. The cause is based on the
following reason codes "<reason-code>":

1

The table is in the Set Integrity Pending No Access state. The
integrity of the table is not enforced and the content of the
table may be invalid. An operation on a parent table or an
underlying table that is not in the Set Integrity Pending No
Access state may also receive this error if a dependent table
is in the Set Integrity Pending No Access state.

...

User response:

1

Execute the SET INTEGRITY statement with the IMMEDIATE CHECKED
option on table "<table-name>" to bring the table out of the
Set Integrity Pending No Access state. For a user maintained
materialized query table, execute the statement with the
IMMEDIATE UNCHECKED option instead of the IMMEDIATE CHECKED
option.
...

Вам надо по всем таблицам из:

SELECT CONST_CHECKED, TABSCHEMA, TABNAME
FROM SYSCAT.TABLES
WHERE STATUS='C'

В зависимости от того, что нуждается в проверке (CONST_CHECKED), выполнить ту или иную команду SET INTEGRITY .

Например, для FK это:
SET INTEGRITY FOR T1, ..., TN IMMEDIATE CHECKDED
где Т1, ..., TN - таблицы из запроса выше, которые друг от друга зависят.
...
Рейтинг: 0 / 0
10.01.2014, 17:34
    #38522310
lans
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Operation not allowed for reason code "1"
У меня в CONST CHECKED вот такое значение, что это может я не могу понять(
NYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
...
Рейтинг: 0 / 0
10.01.2014, 17:42
    #38522325
lans
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Operation not allowed for reason code "1"
Нашёл такую информацию

http://www.ibm.com/developerworks/data/tutorials/db2-cert6113/index.html?cmp=dw&cpb=dwinf&ct=dwnew&cr=dwnen&ccy=zz&csr=111612

проблема в том что у меня запрос
Код: sql
1.
   SET INTEGRITY FOR DBO.NAMES IMMEDIATE CHECKED;



выдаёт ошибку

Cannot check a dependent table "DBO.NAMES " using the SET INTEGRITY statement while the parent table or underlying table "DBO.LOCATE" is in the Set Integrity Pending state or if it will be put into the Set Integrity Pending state by the SET INTEGRITY statement.. SQLCODE=-3608, SQLSTATE=428A8, DRIVER=4.13.111
...
Рейтинг: 0 / 0
10.01.2014, 17:56
    #38522349
lans
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Operation not allowed for reason code "1"
Спасибо. Помогло сделал как вы и написали!
...
Рейтинг: 0 / 0
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / Operation not allowed for reason code "1" / 7 сообщений из 7, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]