暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 关于丢弃包裹

ASKTOM 2019-11-12
367

问题描述

创建包pkg

v_n号: = 777;
结束pkg;
/

开始
dbms_output.put_line(pkg.v_n);
立即执行 “丢弃包pkg”;
结束;
/

Q. Why my anonymous block hangs, if there 是 some kind of locking 是sue as we have referenced the package and it has loaded into the memory, what measures can we apply to unload it from memory so that it could be referenced and dropped in a single anonymous block.

谢谢。

专家解答

当有人执行一个包时,你不能丢弃它。

代码访问dbms_output调用中的包变量。

所以:

Your session is executing it!

所以你不能放弃它。

要解决此问题,请删除块中的dbms_output调用。或该块中与此包的任何其他引用:

create package pkg
is
  v_n number:= 777;
End pkg;
/

select count(*) from user_objects
where  object_name = 'PKG';

COUNT(*)   
          1 

begin
  execute immediate 'drop package pkg';
end;
/

select count(*) from user_objects
where  object_name = 'PKG';

COUNT(*)   
          0 


还要确保没有其他会话正在访问此软件包。
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论