Db2renametable报错SQL0750N 问题描述:
Db2 rename table的时候报错 SQL0750N
适合朗诵的音乐inst105@node01:~$ db2 "rename table tb1 to tb1_bak"
DB21034E The command was procesd as an SQL statement becau it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0750N The statement failed becau the table or column cannot be renamed. SQLSTATE=42986
原因分析:
中国的由来
inst105@node01:~$ db2 " ? SQL0750N"
SQL0750N The statement failed becau the table or column cannot be
renamed.
Explanation:
The source table in a RENAME statement cannot be renamed for one or more
of the following reasons.
* The table is referenced in one or more existing materialized query
tables.
* The table is involved in one or more referential constraints as a
parent or dependent table.
* The table is a target table for decomposition of one or more XSR
雪里红菜怎么做好吃
objects.
* The table is a system-period temporal table.
* The table is a history table.
lo的过去式和过去分词
* The databa manager configuration parameter auto_reval is t to
DISABLED and one of the following occurred:
* The table is referenced in one or more existing views.
* The table is referenced in one or more existing triggers. This
includes triggers on the table or references in triggered SQL
statements.
* The table is referenced in one or more existing SQL functions or
SQL methods.
* The table has check constraints defined. This includes check
一枝笔constraints caud by generated columns.
小乌龟历险记* The table is the latency table, SYSTOOLS.REPL_MQT_LATENCY.
问题解决:
本次问题的原因在于AUTO_REVAL当前值为DISABLED,并且使⽤db2look查看发现该表上有视图
inst105@node01:~$ db2pd -db sample -dbcfg | grep -i AUTO_REVAL AUTO_REVAL DISABLED DISABLED茶油的作用与功效
inst105@node01:~$ db2look -d sample -a -e -t tb1 | grep -i create
-- Generate statistics for all creators
-- The db2look utility will consider only the specified tables
-- Creating DDL for table(s)
海湖庄园-- This CLP file was created using DB2LOOK Version "10.5" CREATE TABLE "INST105 "."TB1" (
create view vtb1 as lect * from tb1;