• ORACLE 如何查看存储过程的定义


    ORACLE 如何查看存储过程的定义
     

    相关的数据字典
      USER_SOURCE 用户的存储过程、函数的源代码字典
      DBA_SOURCE 整个系统所有用户的存储过程、函数的源代码字典
      ALL_SOURCE 当前用户能使用的存储过程(包括其她用户授权)、函数的源代码字典

      USER_ERRORS 用户的存储过程、函数的源代码存在错误的信息字典

    SQL> select * from user_source where type='PROCEDURE';

     

    NAME                           TYPE               LINE TEXT

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

    INSERTDEPT                     PROCEDURE             1 procedure insertDept as

    INSERTDEPT                     PROCEDURE             2 begin

    INSERTDEPT                     PROCEDURE             3 insert into dept(deptno,dname,loc,datetime) values('10','ACCOUNTING','NEW YORK',

    INSERTDEPT                     PROCEDURE             4 insert into dept(deptno,dname,loc,datetime) values('20','RESEARCH','DALLAS',to_d

    INSERTDEPT                     PROCEDURE             5 insert into dept(deptno,dname,loc,datetime) values('30','SALES','CHICAGO',to_dat

    INSERTDEPT                     PROCEDURE             6 insert into dept(deptno,dname,loc,datetime) values('40','OPERATIONS','BOSTON',to

    INSERTDEPT                     PROCEDURE             7 commit;

    INSERTDEPT                     PROCEDURE             8 end;

    SQL> select * from user_objects where  object_type='PROCEDURE';

     

    OBJECT_NAME                                                                      SUBOBJECT_NAME                  OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE         CREATED     LAST_DDL_TIME TIMESTAMP           STATUS  TEMPORARY GENERATED SECONDARY

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

    INSERTDEPT                                                                                                           52576                PROCEDURE           2011-4-27 1 2011-4-27 11: 2011-04-27:11:45:14 INVALID N         N         N

    INSERTEMP  。

    SQL> desc user_source;

    Name Type           Nullable Default Comments                                                                                                      

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

    NAME VARCHAR2(30)   Y                Name of the object                                                                                            

    TYPE VARCHAR2(12)   Y                Type of the object: "TYPE", "TYPE BODY", "PROCEDURE", "FUNCTION",

    "PACKAGE", "PACKAGE BODY" or "JAVA SOURCE" 

    LINE NUMBER         Y                Line number of this line of source                                                                            

    TEXT VARCHAR2(4000) Y                Source text   

    ==============end=============

  • 相关阅读:
    优化慢执行或慢查询的方法
    Top K问题的两种解决思路
    优先队列实现 大小根堆 解决top k 问题
    进程间的八种通信方式----共享内存是最快的 IPC 方式
    二叉树基础之按层打印
    按层打印二叉树--每行打印一层
    给定一颗完全二叉树,给每一层添加上next的指针,从左边指向右边
    缓存与数据库一致性保证
    一致性哈希算法原理
    Linux复制指定目录下的文件夹结构
  • 原文地址:https://www.cnblogs.com/forestwolf/p/6856491.html
Copyright © 2020-2023  润新知