[20211116]plsql_code_type=native補充.txt

lfree發表於2021-11-16

[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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章