创建cache group 时遇到 错误5120 时候的解决方案
2014-06-19 13:12
211 查看
5120 错误大致是由于oracle 上的表主键或其它关键约束处于NOVALIDATE 状态导致的。
所以你可以通过如下查询找到表所对应索引的状态:
SQL> select constraint_name, constraint_type, validated, status from
all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P NOT VALIDATED DISABLED
然后使之生效:
SQL> alter table MyTable modify constraint PKEY_CONSTRAINT validate;
--------------官方文档中是这样描述的:
Declaring NOVALIDATE on constraints causes cache group creation failure
If the Oracle database table on which you want to create the cache group declares NOVALIDATE on columns with primary key, UNIQUE or NOT NULL constraints, the creation of the cache group fails.
Note:
This does not apply to any foreign key constraints. However, TimesTen recommends that any matching foreign key is in the enabled VALIDATE state. Your workload performance may be affected when you alter a foreign key column to the enabled VALIDATE state.
TimesTen perceives a NOVALIDATE on a primary key or NOT NULL table column definition as a NULL and, therefore, not qualified as a column on which to build the cache group. Thus, all columns with the primary key, UNIQUE and NOT NULL column constraints must be
enabled with the VALIDATE state when creating a cache group from the Oracle database table.
When you create a cache group from an Oracle database table with one or more of these constraints, the following errors are thrown:
5124: Autorefresh/propagate are not allowed on restricted cache group
5168: Restricted cache groups are deprecated
5120: No matching unique index with not null columns, unique key constraint
with not null columns, or primary key constraint on table EVENTLOG, cache
operations are restricted.
If you receive these errors, you can perform a SELECT statement to verify any existing NOVALIDATE constraints on the Oracle database table. The following SELECT statement shows all constraints on the MyTable table:
SQL> select constraint_name, constraint_type, validated, status from
all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P NOT VALIDATED DISABLED
If the table column that is to be the primary key for the cache table is enabled as NOVALIDATE, perform the following steps to enable the column with the VALIDATE state:
Enable the NOVALIDATE state for the primary key column.
SQL> alter table MyTable modify constraint PKEY_CONSTRAINT
enable novalidate;
Table altered.
SQL> select constraint_name, constraint_type, validated, status
from all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P NOT VALIDATED ENABLED
Enable the VALIDATE state for the primary key column.
SQL> alter table MyTable modify constraint PKEY_CONSTRAINT validate;
Table altered.
SQL> select constraint_name, constraint_type, validated, status
from all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P VALIDATED ENABLED
所以你可以通过如下查询找到表所对应索引的状态:
SQL> select constraint_name, constraint_type, validated, status from
all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P NOT VALIDATED DISABLED
然后使之生效:
SQL> alter table MyTable modify constraint PKEY_CONSTRAINT validate;
--------------官方文档中是这样描述的:
Declaring NOVALIDATE on constraints causes cache group creation failure
If the Oracle database table on which you want to create the cache group declares NOVALIDATE on columns with primary key, UNIQUE or NOT NULL constraints, the creation of the cache group fails.
Note:
This does not apply to any foreign key constraints. However, TimesTen recommends that any matching foreign key is in the enabled VALIDATE state. Your workload performance may be affected when you alter a foreign key column to the enabled VALIDATE state.
TimesTen perceives a NOVALIDATE on a primary key or NOT NULL table column definition as a NULL and, therefore, not qualified as a column on which to build the cache group. Thus, all columns with the primary key, UNIQUE and NOT NULL column constraints must be
enabled with the VALIDATE state when creating a cache group from the Oracle database table.
When you create a cache group from an Oracle database table with one or more of these constraints, the following errors are thrown:
5124: Autorefresh/propagate are not allowed on restricted cache group
5168: Restricted cache groups are deprecated
5120: No matching unique index with not null columns, unique key constraint
with not null columns, or primary key constraint on table EVENTLOG, cache
operations are restricted.
If you receive these errors, you can perform a SELECT statement to verify any existing NOVALIDATE constraints on the Oracle database table. The following SELECT statement shows all constraints on the MyTable table:
SQL> select constraint_name, constraint_type, validated, status from
all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P NOT VALIDATED DISABLED
If the table column that is to be the primary key for the cache table is enabled as NOVALIDATE, perform the following steps to enable the column with the VALIDATE state:
Enable the NOVALIDATE state for the primary key column.
SQL> alter table MyTable modify constraint PKEY_CONSTRAINT
enable novalidate;
Table altered.
SQL> select constraint_name, constraint_type, validated, status
from all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P NOT VALIDATED ENABLED
Enable the VALIDATE state for the primary key column.
SQL> alter table MyTable modify constraint PKEY_CONSTRAINT validate;
Table altered.
SQL> select constraint_name, constraint_type, validated, status
from all_constraints where table_name = 'MyTable';
CONSTRAINT_NAME C VALIDATED STATUS
------------------------------ - ------------- --------
REFID_CONSTRAINT C VALIDATED ENABLED
PKEY_CONSTRAINT P VALIDATED ENABLED
相关文章推荐
- express安装成功创建项目的时候出现错误的解决方案
- MS office 2007 Excel在打开和关闭文件的时候经常crash(系统遇到未知错误,非法退出!)的原因和解决方案!
- 手工创建Oracle遇到的几个错误及解决方案
- 如何处理创建DB2工具目录数据库的时候遇到的SQL1005N错误?
- AJAX项目中在IE浏览器上遇到"Internet Explorer无法打开站点,已终止操作"错误解决方案
- 安装SQL Server 遇到错误提示:以前的某个程序安装已在安装计算机上创建挂起的文件操作
- 装SQL SEVER 2000个人版的时候,提示"以前某个程序创建挂起 请重起后继续安装"的错误
- 使用VS2003创建WEB程序的时候出现"AutoMation服务器不能创建对象"错误
- VS.net2003创建ASPX项目时候出现的错误及解决方法!
- 安装SQL Server 遇到错误提示:以前的某个程序安装已在安装计算机上创建挂起的文件操作。运行安装程序之前必须重新启动计算机!。
- 安装SQL Server 遇到错误提示:以前的某个程序安装已在安装计算机上创建挂起的文件操作。运行安装程序之前必须重新启动计算机!。
- c#创建多项目解决方案时遇到解决方案消失的解决办法
- 在第一次运行dcpromo的安装ad的时候,出现操作失败:未能为域创建GPO。出现了扩展错误
- 创建ASP.NET程序时候发生错误 HTTP/1.0 500 Server Error
- 创建ASP.NET程序时候发生错误"HTTP/1.0500ServerError"的一个解决办法
- 统计数据的时候,经常遇到重复问题,解决方案!
- 在MyEclipse下创建工程时,遇到的中文乱码问题及解决方案
- 最近使用asp.net时遇到 "运行时错误" 解决方案
- 检测到指定的WEB服务器运行的不是ASP.NET 1.1版,您无法运行ASP.NET应用程序或服务和创建ASP.NET程序时候发生错误 HTTP/1.0 500 Server Error的解决方法
- 成功解决interdev创建新工程的时候出现无法连接web服务器的错误