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;         查看当前用户的角色

  • 相关阅读:
    使用SVG symbols建立图标系统完整指南
    ural 1874 Football Goal
    ural 1572 Yekaterinozavodsk Great Well
    ural 1084 Goat in the Garden
    ural 1192 Ball in a Dream
    ural 1020 Rope
    ural 1494 Monobilliards
    ural 1671 Anansi's Cobweb
    ural 1613 For Fans of Statistics
    ural 1126 Magnetic Storms
  • 原文地址:https://www.cnblogs.com/tangzeqi/p/8286709.html
Copyright © 2011-2022 走看看