中文VS2008 安装ASP.NET MVC框架问题(没有MVC模板)
2011-04-18 14:11
836 查看
1) Find the violate constraint rows in your Oracle DB.
As we known, "enable validate", "enable" for new values, "validate" for old values to
make constraints work. If you Oracle DB default option is enable and novalidate, then
you want to modify to enable and validate so that make all data confirm some constraints
. Unfortunatly, may you find some data real violate constraints, however, you could not
find where it is. So following method could help you.
It is not a big deal, I just write it down to a shell script.
1@@@@ Here, I write a shell scirpt to make it work
[oracle@station78 ~]$ cat ./check_violate_constraint_rows.sh
#!/bin/sh
#please intput $1 table_name, $2 constraint_name
read -p "Please input table name (like hr.employees): " tab
read -p "Please input constraint name(like chk_xxx): " cons
sqlplus / as sysdba<< EOF > violate_constraint_rows.txt
DROP TABLE exceptions PURGE;
@\$ORACLE_HOME/rdbms/admin/utlexpt1.sql
ALTER TABLE $tab ENABLE VALIDATE CONSTRAINT $cons EXCEPTIONS INTO EXCEPTIONS;
SELECT * FROM $tab WHERE ROWID IN (SELECT row_id FROM exceptions);
EOF
echo " "
echo "You could check the output file violate_constraint_rows.txt !!! "
echo "Find the violate constraint rows, and do something."
echo " "
@@@Usage Example
[oracle@station78 ~]$ ./check_violate_constraint_rows.sh
Please input table name (like hr.employees): test.t_trainsupport_executions
Please input constraint name(like chk_xxx): CHK_TRAINSUPPORT_EXEC_CUSTFAC
You could check the output file violate_constraint_rows.txt !!!
Find the violate constraint rows, and do something.
[oracle@station78 ~]$ cat violate_constraint_rows.txt
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 15:15:05 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SYS@ocm>
Table dropped.
SYS@ocm>
Table created.
SYS@ocm>
Table altered.
SYS@ocm>
no rows selected
SYS@ocm> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
2@@@@ Here I write a sql script to make it work.
SYS@ocm> !cat x.sql
DROP TABLE exceptions PURGE;
@\$ORACLE_HOME/rdbms/admin/utlexpt1.sql
ALTER TABLE &&table_name
ENABLE VALIDATE CONSTRAINT &constraint_name
EXCEPTIONS INTO EXCEPTIONS;
SELECT * FROM &table_name WHERE ROWID IN (SELECT row_id FROM exceptions);
@@@Usage Example:
SYS@ocm> @x.sql
Table dropped.
Table created.
Enter value for table_name: test.t_trainsupport_executions
old 1: ALTER TABLE &&table_name
new 1: ALTER TABLE test.t_trainsupport_executions
Enter value for constraint_name: CHK_TRAINSUPPORT_EXEC_CUSTFAC
old 2: ENABLE VALIDATE CONSTRAINT &constraint_name
new 2: ENABLE VALIDATE CONSTRAINT CHK_TRAINSUPPORT_EXEC_CUSTFAC
Table altered.
old 1: SELECT * FROM &table_name WHERE ROWID IN (SELECT row_id FROM exceptions)
new 1: SELECT * FROM test.t_trainsupport_executions WHERE ROWID IN (SELECT row_id FROM exceptions)
no rows selected
本文出自 “Oracle+Linux=>Majesty” 博客,请务必保留此出处http://majesty.blog.51cto.com/3493901/1107602
As we known, "enable validate", "enable" for new values, "validate" for old values to
make constraints work. If you Oracle DB default option is enable and novalidate, then
you want to modify to enable and validate so that make all data confirm some constraints
. Unfortunatly, may you find some data real violate constraints, however, you could not
find where it is. So following method could help you.
It is not a big deal, I just write it down to a shell script.
1@@@@ Here, I write a shell scirpt to make it work
[oracle@station78 ~]$ cat ./check_violate_constraint_rows.sh
#!/bin/sh
#please intput $1 table_name, $2 constraint_name
read -p "Please input table name (like hr.employees): " tab
read -p "Please input constraint name(like chk_xxx): " cons
sqlplus / as sysdba<< EOF > violate_constraint_rows.txt
DROP TABLE exceptions PURGE;
@\$ORACLE_HOME/rdbms/admin/utlexpt1.sql
ALTER TABLE $tab ENABLE VALIDATE CONSTRAINT $cons EXCEPTIONS INTO EXCEPTIONS;
SELECT * FROM $tab WHERE ROWID IN (SELECT row_id FROM exceptions);
EOF
echo " "
echo "You could check the output file violate_constraint_rows.txt !!! "
echo "Find the violate constraint rows, and do something."
echo " "
@@@Usage Example
[oracle@station78 ~]$ ./check_violate_constraint_rows.sh
Please input table name (like hr.employees): test.t_trainsupport_executions
Please input constraint name(like chk_xxx): CHK_TRAINSUPPORT_EXEC_CUSTFAC
You could check the output file violate_constraint_rows.txt !!!
Find the violate constraint rows, and do something.
[oracle@station78 ~]$ cat violate_constraint_rows.txt
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 15:15:05 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SYS@ocm>
Table dropped.
SYS@ocm>
Table created.
SYS@ocm>
Table altered.
SYS@ocm>
no rows selected
SYS@ocm> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
2@@@@ Here I write a sql script to make it work.
SYS@ocm> !cat x.sql
DROP TABLE exceptions PURGE;
@\$ORACLE_HOME/rdbms/admin/utlexpt1.sql
ALTER TABLE &&table_name
ENABLE VALIDATE CONSTRAINT &constraint_name
EXCEPTIONS INTO EXCEPTIONS;
SELECT * FROM &table_name WHERE ROWID IN (SELECT row_id FROM exceptions);
@@@Usage Example:
SYS@ocm> @x.sql
Table dropped.
Table created.
Enter value for table_name: test.t_trainsupport_executions
old 1: ALTER TABLE &&table_name
new 1: ALTER TABLE test.t_trainsupport_executions
Enter value for constraint_name: CHK_TRAINSUPPORT_EXEC_CUSTFAC
old 2: ENABLE VALIDATE CONSTRAINT &constraint_name
new 2: ENABLE VALIDATE CONSTRAINT CHK_TRAINSUPPORT_EXEC_CUSTFAC
Table altered.
old 1: SELECT * FROM &table_name WHERE ROWID IN (SELECT row_id FROM exceptions)
new 1: SELECT * FROM test.t_trainsupport_executions WHERE ROWID IN (SELECT row_id FROM exceptions)
no rows selected
本文出自 “Oracle+Linux=>Majesty” 博客,请务必保留此出处http://majesty.blog.51cto.com/3493901/1107602
相关文章推荐
- (转)中文VS2008 安装ASP.NET MVC框架问题(没有MVC模板)
- 中文VS2008 安装ASP.NET MVC框架问题(没有MVC模板)
- 中文VS2008 安装ASP.NET MVC框架问题?
- 中文VS2008中安装ASP.NET MVC框架出现问题的解决方法
- 中文VS2008中安装ASP.NET MVC框架出现问题的解决方法之完整版
- 中文VS2008 安装ASP.NET MVC框架问题?
- 中文VS2008中安装ASP.NET MVC框架,不显示模板
- 中文VS2008中安装ASP.NET MVC框架出现问题的解决方法
- 中文VS2008 安装ASP.NET MVC框架问题
- 中文VS2008中安装ASP.NET MVC框架,不显示模板
- [转]中文VS2008中安装ASP.NET MVC框架出现问题的解决方法
- 中文VS2008中安装ASP.NET MVC框架出现问题的解决方法
- [转]中文VS2008中安装ASP.NET MVC框架出现问题的解决方法
- 安装ASP.NET MVC框架到中文VS2008
- 在中文VS2008中安装ASP.NET MVC框架
- 中文VS2008安装ASP.NET MVC框架解决方案
- 解决非英文版VS2008在安装ASP.NET MVC framework后无加载默认模板的方法
- 安装 .Net Framework 3.5 后 中文VS2008中无法显示MVC文件模板的问题
- [原创]关于“ASP.NET MVC Preview 5使用中,只有MVC Project模板,没有MVC Item 模板(MVC Item Template)的问题”解决
- 【转】Asp.Net MVC及Web API框架配置会碰到的几个问题及解决方案