OCP 1Z0 052 181

来源:互联网 发布:手机麻将作弊软件 编辑:程序博客网 时间:2024/06/09 14:25

181. View the Exhibit and examine the PL/SQL package and procedure.  


You  made  changes  to  the  COMPUTE_TAX  function  inside  the  EMP_ADMIN  package  body.  Which 
statement is true after you recompile the EMP_ADMIN package body? 
A.The USE_P procedure remains valid. 
B.The USE_P procedure becomes invalid. 
C.The SHOW_DETAIL procedure becomes invalid. 
D.The EMP_ADMIN package specification becomes invalid and needs to be recompiled. 
Answer: A   


package接口不变,依赖package的对象就不会失效

http://docs.oracle.com/cd/E11882_01/server.112/e40540/srvrside.htm#CNCPT88935

PL/SQL packages provide the following advantages:

  • Encapsulation

    Packages enable you to encapsulate or group stored procedures, variables, data types, and so on in a named, stored unit. Encapsulation provides better organization during development and also more flexibility. You can create specifications and reference public procedures without actually creating the package body. Encapsulation simplifies privilege management. Granting the privilege for a package makes package constructs accessible to the grantee.

  • Data security

    The methods of package definition enable you to specify which variables, cursors, and procedures are public and private. Public means that it is directly accessible to the user of a package. Private means that it is hidden from the user of a package.

    For example, a package can contain 10 procedures. You can define the package so that only three procedures are public and therefore available for execution by a user of the package. The remaining procedures are private and can only be accessed by the procedures within the package. Do not confuse public and private package variables with grants to PUBLIC.

  • Better performance

    An entire package is loaded into memory in small chunks when a procedure in the package is called for the first time. This load is completed in one operation, as opposed to the separate loads required for standalone procedures. When calls to related packaged procedures occur, no disk I/O is needed to run the compiled code in memory.

    A package body can be replaced and recompiled without affecting the specification. As a result, schema objects that reference a package's constructs (always through the specification) need not be recompiled unless the package specification is also replaced. By using packages, unnecessary recompilations can be minimized, resulting in less impact on overall database performance.


0 0
原创粉丝点击