OCP 1Z0 053 265

来源:互联网 发布:java统计字符出现次数 编辑:程序博客网 时间:2024/06/03 22:01
265.View the Exhibit for the object interdependency diagram. 
The PRODUCTS table is used to create the PRODCAT_VW view. PRODCAT_VW is used in the 
GET_DATA procedure. GET_DATA is called in the CHECK_DATA function. A new column PROD_QTY is 
added to the PRODUCTS table. How does this impact the status of the dependent objects? 

A. All dependent objects remain valid. 
B. Only the procedure and function become invalid and must be recompiled. 
C. Only the view becomes invalid and gets automatically revalidated the next time it is used. 
D. Only the procedure and function become invalid and get automatically revalidated the next time they 
are called. 
Answer: A 

答案有误:
SQL> create table test as select * from emp;Table createdSQL> create or replace view v_test as select * from emp;View createdSQL> SELECT object_name, status  2    FROM user_objects  3   WHERE created > SYSDATE - 1 / 24;OBJECT_NAME     STATUS--------------- -------TEST            VALIDV_TEST          VALID2 rows selectedSQL> alter table test add new_col int;Table alteredSQL> SQL> SELECT object_name, status  2    FROM user_objects  3   WHERE created > SYSDATE - 1 / 24;OBJECT_NAME     STATUS--------------- -------TEST            VALIDV_TEST          VALID2 rows selected

因为view与新列无关,用select * 建view后,会自动转成具体的列。
SQL> select dbms_metadata.get_ddl('VIEW','V_TEST') from dual;DBMS_METADATA.GET_DDL('VIEW','--------------------------------------------------------------------------------  CREATE OR REPLACE FORCE VIEW "TEST"."V_TEST" ("EMPNO", "ENAME", "JOB", "MGR",  select "EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO" from emp1 row selectedSQL> 


0 0
原创粉丝点击