oracle 编译 提醒,使用调试信息编译Oracle模式

the documentation中所述:

DEBUG

Has the same effect as PLsql_OPTIMIZE_LEVEL=1—instructs the PL/sql compiler to generate and store the code for use by the PL/sql debugger. Oracle recommends using PLsql_OPTIMIZE_LEVEL=1 instead of DEBUG.

因此,您可以在创建对象之前或重新编译模式之前设置它.为了匹配sql Developer在“编译调试”时所做的事情,您还需要将PLsql_DEBUG设置为true.这是一个快速演示:

create or replace package p42 as

function f return number;

end p42;

/

create or replace package body p42 as

function f return number is

begin

return 42;

end f;

end p42;

/

select name,type,plsql_optimize_level,plsql_debug

from user_plsql_object_settings where name = 'P42';

NAME TYPE PLsql_OPTIMIZE_LEVEL PLsql_DEBUG

------------------------------ ------------ -------------------- -----------

P42 PACKAGE 2 FALSE

P42 PACKAGE BODY 2 FALSE

alter session set plsql_optimize_level = 1;

alter session set plsql_debug = true;

exec dbms_utility.compile_schema(user);

select name,plsql_debug

from user_plsql_object_settings where name = 'P42';

NAME TYPE PLsql_OPTIMIZE_LEVEL PLsql_DEBUG

------------------------------ ------------ -------------------- -----------

P42 PACKAGE 1 TRUE

P42 PACKAGE BODY 1 TRUE

当然,你可以在创建对象之前改变你的会话,但是如果你知道你总是要总是重新编译模式 – 如果你必须重新编译所有东西,而不仅仅是无效的对象 – 那么等到那时可能是好.但是如果您确实在启用调试的情况下创建对象,您仍然可以使用以下命令重新编译并保留它:

DBMS_UTILITY.COMPILE_SCHEMA(schema => user,reuse_settings => true);

…如果要重新编译所有内容,或者只想重新编译无效对象:

DBMS_UTILITY.COMPILE_SCHEMA(schema => user,compile_all => false,reuse_settings => true);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值