根据sid或sqlID查询SQL

根据sid查询已经执行过的sql

select sql_text from v$sqlarea a,v$session b where a.SQL_ID=b.PREV_SQL_ID and b.SID=&sid;
--------------------------------------------------------------------------------------

根据sid查询当前执行的sql

select sql_text from v$sqlarea where (hash_value,address)=(select sql_hash_value,sql_address from v$session where sid=&sid);

时间: 2024-10-15 16:39:38

根据sid或sqlID查询SQL的相关文章

oracle常用查询sql

oracle常用查询sql 原创 gordon陈 发布于2018-05-10 22:32:18 阅读数 297 收藏 展开 #!/bin/sh## create by Gordon Chen echo "\n=============`date`===================\n" if [ "$LOGNAME" = "oracle" ]; then   SQLPLUS_CMD="/ as sysdba";else  

Oracle EBS-SQL (SYS-1): sysadmin_用户职责查询.sql

select fu.user_name 用户名, fu.description 用户说明, frv.RESPONSIBILITY_NAME 职责名称, REQUEST_GROUP_NAME 报表组, (select  ppf.FULL_NAME from apps.per_people_f  ppf where fu.employee_id = ppf.PERSON_ID and trunc(sysdate)  between  trunc(ppf.EFFECTIVE_START_DATE) a

Oracle EBS-SQL (SYS-2): sys_在线用户查询.sql

SELECT fs.USER_NAME,       fu.description,       fs.RESPONSIBILITY_NAME,       fs.USER_FORM_NAME,       fs.TIME,       fs.RESP_APPL_ID,       fs.RESPONSIBILITY_ID,       fs.FORM_ID,       fs.FORM_APPL_ID  FROM FND_SIGNON_AUDIT_VIEW fs,       fnd_user

Oracle EBS-SQL (SYS-3):sys_人员用户名对应关系查询.sql

select fu.user_name 用户名,       fu.description 描述,       (select ppf.FULL_NAME          from per_people_f ppf         where ppf.PERSON_ID = fu.employee_id           and trunc(sysdate) between trunc(ppf.EFFECTIVE_START_DATE) and               trunc(ppf

Oracle EBS-SQL (SYS-10):锁定表查询.sql

/*死锁查询-1*/ SELECT o.object_name, l.session_id,l.process, l.locked_mode FROM v$locked_object l , dba_objects o WHERE o.object_id=l.object_id ------------------------------------------------ /*死锁查询-2*/ select GL.SESSION_ID,         do.object_name,     

Oracle EBS-SQL (SYS-7):表单个性化查询.sql

animation-timing-function animation-timing-function 规定动画的速度曲线.速度曲线定义动画从一套 CSS 样式变为另一套所用的时间.在平常的取值中,主要有以下几个: 值 描述 linear 动画从头到尾的速度是相同的. ease 默认.动画以低速开始,然后加快,在结束前变慢. ease-in 动画以低速开始. ease-out 动画以低速结束. ease-in-out 动画以低速开始和结束. cubic-bezier(n,n,n,n) 在 cub

Oracle EBS-SQL (SYS-5):sys_配置文件查询.sql

select    distinct l.profile_option_name,             v.profile_option_value,             fu.user_nameform     applsys.fnd_profile_option_values v,            apps.fnd_profile_options_vl          l,            apps.fnd_user                           

分页用到的子查询sql语句

说明(2017-8-31 23:30:22): 1. 分页用到的子查询sql语句 2. 记住的意思就是背过^_^ 3. 还有一个top语句,查一查

循环查询sql带逗号(,)分隔的数据

? 1 2 3 4 5 6 select * from sys_role_list where id in (select c from (with test as (select roleid c from sys_role_info where id=1) select substr(t.ca,instr(t.ca, ',', 1, c.lv) + 1,instr(t.ca, ',', 1, c.lv + 1) - (instr(t.ca, ',', 1, c.lv) + 1)) AS c