首页 > 解决方案 > 如何在oracle中恢复丢失的包

问题描述

我已经放弃了我项目的一个重要包(不由自主地)我现在想恢复它。请问你能帮我吗?

这是我试图做的:

RESTAURE PACKAGE package_name;

我与 oracle sql 开发人员一起工作

标签: oracleoracle10goracle-sqldeveloper

解决方案


没有restore package命令。如果您丢弃了软件包,您可能需要从源代码控制系统中取回它。

如果你足够幸运,你可以运行闪回查询来查看源代码。假设你在不到 20 分钟前放弃了它(否则调整你闪回的时间戳)

select type, line, text
  from all_source as of timestamp systimestamp - interval '20' minute
 where owner = <<schema owner>>
   and name = <<name of package>>
   and type in ('PACKAGE', 'PACKAGE BODY')
 order by type, line;

Oracleundo会在有限的时间段内保留执行闪回查询所需的数据。如果您放弃软件包的时间太长,Oracle 可能无法向您展示代码的样子。


推荐阅读