首页 > Linux操作系统 > Linux操作系统 > 对于对象依赖关系的学习
| SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for 32-bit Windows: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production |
| SQL> create table test as select * from ss; Table created SQL> create view view_1 as select * from test; View created SQL> create view view_2 as select * from view_1; View created |
| SQL> select owner,object_name,status from dba_objects where wner='APP'; OWNER OBJECT_NAME STATUS ------------------------------ -------------------------------------------------------------------------- ------- APP TEST VALID APP VIEW_1 VALID APP VIEW_2 VALID APP SS VALID |
| SQL> drop table test; Table dropped SQL> select owner,object_name,status from dba_objects where wner='APP'; OWNER OBJECT_NAME STATUS ------------------------------ ---------------------------------------------------------------------- ------- APP VIEW_1 INVALID APP VIEW_2 INVALID APP SS VALID |
| SQL> create table test as select * from ss; Table created SQL> select owner,object_name,status from dba_objects where wner='APP'; OWNER OBJECT_NAME STATUS ------------------------------ -------------------------------------------------------------------------- ------- APP VIEW_1 INVALID APP VIEW_2 INVALID APP TEST VALID APP SS VALID |
| SQL> select count(*) from view_1; COUNT(*) ---------- 4 SQL> select owner,object_name,status from dba_objects where wner='APP'; OWNER OBJECT_NAME STATUS ------------------------------ -------------------------------------------------------------------------- ------- APP VIEW_1 VALID APP VIEW_2 INVALID APP TEST VALID APP SS VALID |
| SQL> drop table test; Table dropped SQL> select owner,object_name,status from dba_objects where wner='APP'; OWNER OBJECT_NAME STATUS ------------------------------ ---------------------------------------------------------------------- ------- APP VIEW_1 INVALID APP VIEW_2 INVALID APP SS VALID |
| SQL> create table test as select * from ss; Table created SQL> select count(*) from view_2; COUNT(*) ---------- 4 SQL> select owner,object_name,status from dba_objects where wner='APP'; OWNER OBJECT_NAME STATUS ------------------------------ -------------------------------------------------------------------------- ------- APP TEST VALID APP VIEW_1 VALID APP VIEW_2 VALID APP SS VALID |
| SQL> drop table test; Table dropped SQL> create table test as select * from ss; Table created |
| SQL> alter view_2 compile; alter view_2 compile SQL> select owner,object_name,status from dba_objects where wner='APP'; OWNER OBJECT_NAME STATUS ------------------------------ -------------------------------------------------------------------------- ------- APP TEST VALID APP VIEW_1 VALID APP VIEW_2 VALID APP SS VALID |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26788084/viewspace-718602/ ,如需转载,请注明出处,否则将追究法律责任。