关于html:如何查询plsql乱码中的错误

37次阅读

共计 4028 个字符,预计需要花费 11 分钟才能阅读完成。

环境:

SCOTTbook> 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

SCOTTbook> 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

SCOTTook> alter session set plsql_code_type=native ;
Session altered.

$ ls -l /dev/shm/
total 0

create or replace PROCEDURE testp2 (
P_ORG_NUM IN number,
p_result OUT varchar2,
p_seq OUT number
) AS
BEGIN
p_seq := P_ORG_NUM; p_result:=”;
END;
/

create or replace package testp1
as
procedure foo;
end;
/

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

$ ls -l /dev/shm/
total 8
-rwx—— 1 oracle oinstall 432 2021-06-22 09:18:48 PESLD_book_1c38004_00dcf27d00000000
-rwx—— 1 oracle oinstall 528 2021-06-22 09:17:33 PESLD_book_1c38004_d87eef7c00000000

–//PESLD 示意什么呢? PESLD – Plsql code www.pizei.comExecution Shared object manager native code Loader
–// 这样编译的过程和包在 /dev/shm 产生了文件 PESLD_book_1c38004_00dcf27d00000000,PESLD_book_1c38004_00dcf27d00000000.

2. 测试:
–// 退出从新登录,执行:
SCOTTbook> spid

   SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50

   295       1571 23979                    DEDICATED 23980       21        192 alter system kill session '295,1571' immediate;

SCOTTbook> exec testp1.foo()
PL/SQL procedure successfully completed.

$ strace -f -e open -p 23980
Process 23980 attached – interrupt to quit
open(“/dev/shm/PESLD_book_1c38004_00dcf27d00000000”, O_RDONLY|O_NOFOLLOW) = 8

–// 你能够发现会呈现调用 open /dev/shm/PESLD_book_1c38004_00dcf27d00000000
–// 当初删除文件。

$ rm /dev/shm/PESLD_book_1c38004_00dcf27d00000000
/bin/rm: remove regular file `/dev/shm/PESLD_book_1c38004_00dcf27d00000000′? y

SCOTTbook> exec testp1.foo()
PL/SQL procedure successfully completed.
–//OK。没有问题,因为工夫句柄曾经 ok,你能够发现第 2 次执行没有页游调用 open。
–// 关上新的 session 执行:

SCOTTbook> spid

   SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50

    30       3837 23998                    DEDICATED 23999       26        234 alter system kill session '30,3837' immediate;

SCOTTbook> exec testp1.foo()
BEGIN testp1.foo(); END;

*
ERROR at line 1:
ORA-00600: internal error code, arguments: [pesldl01_Get_Object: shm_open failed: errno 2 errmsg No such fil], [/PESLD_book_1c38004_00dcf27d00000000], [], [], [], [], [], [], [], [], [], []

–// 从新编译。
SCOTTbook> alter session set plsql_code_type=native ;
Session altered.

SCOTTbook> ALTER PACKAGE SCOTT.TESTP1 COMPILE;
Package altered.

$ ls -l /dev/shm/
total 8
-rwx—— 1 oracle oinstall 432 2021-06-22 09:38:24 PESLD_book_1c38004_00dcf27d00000000
-rwx—— 1 oracle oinstall 528 2021-06-22 09:17:33 PESLD_book_1c38004_d87eef7c00000000

SCOTTbook> exec testp1.foo()
PL/SQL procedure successfully completed.

3. 链接作者说的状况我给持续测试:
variable v_result varchar2;
variable v_seq number ;

SCOTTbook> exec testp2(1,:v_result,:v_seq);
PL/SQL procedure successfully completed.

–// 我预计应该不是参数 plsql_code_type=native 引起的状况。
–// 关上新会话从新编译。
SCOTTbook> ALTER PACKAGE SCOTT.TESTP1 COMPILE;
Package altered.

$ rm -rf /dev/shm/PESLD_book_1c38004_*

variable v_result varchar2;
variable v_seq number ;

SCOTTbook> exec testp2(1,:v_result,:v_seq);
BEGIN testp2(1,:v_result,:v_seq); END;

*
ERROR at line 1:
ORA-00600: internal error code, arguments: [pesldl01_Get_Object: shm_open failed: errno 2 errmsg No such fil], [/PESLD_book_1c38004_d87eef7c00000000], [], [], [], [], [], [], [], [], [], []

–// 从新建设:
create or replace PROCEDURE testp2 (
P_ORG_NUM IN number,
p_result OUT varchar2,
p_seq OUT number
) AS
BEGIN
p_seq := P_ORG_NUM; p_result:=”;
END;
/

SCOTTbook> exec testp2(1,:v_result,:v_seq);
PL/SQL procedure successfully completed.

4. 如果装置如上编译的包,产生异样敞开呢,持续测试?
$ ls -l /dev/shm/
total 4
-rwx—— 1 oracle oinstall 432 2021-06-22 09:53:47 PESLD_book_1c58004_f8ae607c00000000

SYSbook> shutdown abort ;
ORACLE instance shut down.

$ ls -l /dev/shm/
total 4
-rwx—— 1 oracle oinstall 432 2021-06-22 09:53:47 PESLD_book_1c58004_f8ae607c00000000

–// 文件还在。
SYSbook> startup
ORACLE instance started.

Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
Database opened.

SCOTTbook> alter session set plsql_code_type=native ;
Session altered.

SCOTTbook> exec testp1.foo()
PL/SQL procedure successfully completed.

$ ls -l /dev/shm/
total 8
-rwx—— 1 oracle oinstall 432 2021-06-22 09:53:47 PESLD_book_1c58004_f8ae607c00000000
-rwx—— 1 oracle oinstall 432 2021-06-22 09:56:43 PESLD_book_1c78004_c841197c00000000

–// 建设新的文件。

正文完
 0