ITPub博客

首页 > 数据库 > Oracle > [20211116]plsql_code_type=native补充.txt

[20211116]plsql_code_type=native补充.txt

原创 Oracle 作者:lfree 时间:2021-11-16 09:55:44 1 删除 编辑

[20211116]plsql_code_type=native补充.txt

--//以前曾经测试过设置plsql_code_type=native会编译的过程和包在/dev/shm,补充一些测试:

1.环境:
SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SCOTT@book>  show parameter plsql
NAME                   TYPE      VALUE
---------------------- --------- --------------
plsql_ccflags          string
plsql_code_type        string    INTERPRETED
plsql_debug            boolean   FALSE
plsql_optimize_level   integer   2
plsql_v2_compatibility boolean   FALSE
plsql_warnings         string    DISABLE:ALL

2.测试:

SCOTT@book> alter session set plsql_code_type=native ;
Session altered.

SCOTT@book> select * from dba_plsql_object_settings where plsql_code_type = 'NATIVE';
no rows selected

--//当前没有编译的报是类型NATIVE。

create or replace package bla as
  procedure foo;
end;
/
create or replace package body bla as
  procedure foo is begin null; end;
end;
/

SCOTT@book> select * from dba_plsql_object_settings where plsql_code_type = 'NATIVE'
  2  @ prxx
==============================
OWNER                         : SCOTT
NAME                          : BLA
TYPE                          : PACKAGE
PLSQL_OPTIMIZE_LEVEL          : 2
PLSQL_CODE_TYPE               : NATIVE
PLSQL_DEBUG                   : FALSE
PLSQL_WARNINGS                : DISABLE:ALL
NLS_LENGTH_SEMANTICS          : BYTE
PLSQL_CCFLAGS                 :
PLSCOPE_SETTINGS              : IDENTIFIERS:NONE
==============================
OWNER                         : SCOTT
NAME                          : BLA
TYPE                          : PACKAGE BODY
PLSQL_OPTIMIZE_LEVEL          : 2
PLSQL_CODE_TYPE               : NATIVE
PLSQL_DEBUG                   : FALSE
PLSQL_WARNINGS                : DISABLE:ALL
NLS_LENGTH_SEMANTICS          : BYTE
PLSQL_CCFLAGS                 :
PLSCOPE_SETTINGS              : IDENTIFIERS:NONE
PL/SQL procedure successfully completed.

--//可以通过视图确定那些包编译是NATIVE的。

$ ls -l /dev/shm/
total 4
-rwx------ 1 oracle oinstall 424 2021-11-16 09:39:36 PESLD_book_32d0004_082c567c00000000

--//java类通过native编译可以通过如下查询。
select * from dba_java_methods where is_native = 'YES' ;

--//或者查询:

select * from sys.ncomp_dll$ n, dba_objects o where n.obj# = o.object_id;


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-2842353/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    3081
  • 访问量
    6806383