zoukankan      html  css  js  c++  java
  • 查看oracle用户执行的sql语句历史记录

    一时失误,删除了PL/SQL窗口数据的历史,然后半个半个星期写的代码全部白费,但是想起来之前执行过,所以可以通过查询历史记录找回。以下为找回代码:

    平时用得少,保存一下以后查看。
     
    select * from v$sqlarea t where t.PARSING_SCHEMA_NAME in ('用户名') order by t.LAST_ACTIVE_TIME desc     用户名需要大写

    select * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc


    注意 :执行此语句等等一些相关的语句 必须具有DBA 的权限 虽然这条语句很普通 但是需要的时候很管用 能够及时查出一个人执行sql语句情况
    -------oracle 查看已经执行过的sql 这些是存在共享池中的 --------->
    select * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc
    -----------查看oracle会话----------------------------》
    select * from v$session   t order by t.LAST_ACTIVE_TIME desc
    -------------查看oracle的权限角色------------------------------>
    select   *   from   dba_role_privs;    授予用户和其他角色的角色  
    select   *   from   dba_sys_privs;     授予用户和其他角色的系统权限  
    select   *   from   dba_tab_privs;     数据库中对象的所有授权
    select * from user_role_privs;         查看当前用户的角色

  • 相关阅读:
    服务端渲染和客户端渲染
    node(基础)_node.js中的http服务以及模板引擎的渲染
    node基础(二)_模块以及处理乱码问题
    node(基础)_node中的javascript
    vue购物车和地址选配(三)
    nyoj 169 素数
    nyoj 205 求余数
    nyoj 65另一种阶乘问题
    nyoj 734奇数阶魔方
    nyoj64 鸡兔同笼
  • 原文地址:https://www.cnblogs.com/tangzeqi/p/8286709.html
Copyright © 2011-2022 走看看