ITPub博客

首页 > 数据库 > Oracle > oracle中取得存储过程、函数等pl sql源码的方法

oracle中取得存储过程、函数等pl sql源码的方法

原创 Oracle 作者:cnhtm 时间:2010-03-15 16:32:44 0 删除 编辑

如果已经知道函数、存储过程、body等plsql的名称,可以通过查询user_source(dba_sourceall_source)取得其源代码

演示过程如下:

ora_test@oracle[/home/oracle]> sqlplus scott/tiger

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 16 16:27:27 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

scott@CNHTM> col text for a50;
scott@CNHTM>
scott@CNHTM> select b.line,b.text
2 from USER_SOURCE b
3 where b.name='P_TEST'
4 order by line;

LINE TEXT
---------- --------------------------------------------------
1 procedure p_test is
2 begin
3 dbms_output.enable(999999999);
4 for c in (select * from big_table)
5 loop
6 dbms_output.put_line(c.object_name);
7 end loop;
8
9 end p_test;

9 rows selected.

scott@CNHTM>

--end--

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22049049/viewspace-1031884/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-07-06

  • 博文量
    104
  • 访问量
    812107