Oracle 参数 PLSQL_CODE_TYPE 官方解释,作用,如何配置最优化建议

本站中文解释

PLSQL_CODE_TYPE参数定义了要使用在PL/SQL包中使用的代码类型。该参数有如下取值:

1. INTERPRETED: 拥有该值的PL/SQL程序将被解释执行;
2. NATIVE: 拥有该值的PL/SQL程序将被编译成机器代码,然后执行;
3. BOTH: 编译和解释两种方式都可以使用;

在设置PLSQL_CODE_TYPE参数时,一般应该尽量选择NATIVE编译,这样可以使性能更优,而在系统中新安装Oracle之后,系统默认这个参数值为INTERPRETED。

在正确设置PLSQL_CODE_TYPE参数时,必须要先执行一个ALTER SYSTEM命令,来调整全局的影响,然后在系统级别或会话级别执行ALTER SESSION命令来调整个别的影响,例如:

— 调整全局
ALTER SYSTEM SET PLSQL_CODE_TYPE=NATIVE;
— 调整会话级别
ALTER SESSION SET PLSQL_CODE_TYPE=NATIVE;

官方英文解释

PLSQL_CODE_TYPE specifies the compilation mode for PL/SQL library units.

Property Description

Parameter type

String

Syntax

PLSQL_CODE_TYPE = { INTERPRETED | NATIVE }

Default value

INTERPRETED

Modifiable

ALTER SESSION, ALTER SYSTEM

Modifiable in a PDB

Yes

Basic

No

Values

  • INTERPRETED

    PL/SQL library units will be compiled to PL/SQL bytecode format. Such modules are executed by the PL/SQL interpreter engine.

  • NATIVE

    PL/SQL library units (with the possible exception of top-level anonymous PL/SQL blocks) will be compiled to native (machine) code. Such modules will be executed natively without incurring any interpreter overhead.

When the value of this parameter is changed, it has no effect on PL/SQL library units that have already been compiled. The value of this parameter is stored persistently with each library unit.

If a PL/SQL library unit is compiled native, all subsequent automatic recompilations of that library unit will use native compilation.

See Also:

Oracle Database PL/SQL
Language Reference
for more information about this parameter


数据运维技术 » Oracle 参数 PLSQL_CODE_TYPE 官方解释,作用,如何配置最优化建议