首页 > 解决方案 > Oracle SQL Developer 将我的工作视图标记为损坏

问题描述

谁能告诉我为什么我的 Oracle SQL Developer 在实际工作时将我的视图标记为损坏?

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

它不仅仅是 1 个视图,而是 10 个视图有相同的问题,它们都是在不同的时间创建的,带有子查询或连接到多个表,并且总是工作正常。

提前致谢!

标签: sqloraclevieworacle-sqldeveloper

解决方案


视图可能因引用对象的更改而失效。与存储的 PL/SQL 一样,下次使用时会发生重新编译,此时它将再次生效。例如:

SQL> create table demo (id integer);

Table created


SQL> create or replace view v1 as select id from demo;

View created


SQL> select o.status from user_objects o where object_type = 'VIEW' and object_name = 'V1';

STATUS
-------
VALID

SQL> alter table demo modify id varchar2(10);

Table altered


SQL> select o.status from user_objects o where object_type = 'VIEW' and object_name = 'V1';

STATUS
-------
INVALID

SQL> select * from v1;

ID
----------
SQL> select o.status from user_objects o where object_type = 'VIEW' and object_name = 'V1';

STATUS
-------
VALID

推荐阅读