-- 找出哪个数据库用户用什么程序在最近三天执行过delete或truncate table的操作 SELECT c.username, a.program, b.sql_text, b.command_type, a.sample_time FROM dba_hist_active_sess_history a JOIN dba_hist_sqltext b ON a.sql_id = b.sql_id JOIN dba_users c ON a.user_id = c.user_id AND
作为一个开发/测试人员,或多或少都得和数据库打交道,而对数据库的操作归根到底都是SQL语句,所有操作到最后都是操作数据,那么对sql性能的掌控又成了我们工作中一件非常重要的工作.下面简单介绍下一些查看oracle性能的一些实用方法: 1.查询每台机器的连接数 select t.MACHINE,count(*) from v$session t group by t.MACHINE 这里所说的每台机器是指每个连接oracle数据库的服务器,每个服务器都有配置连接数据库的连接数,以websphere
查看oracle的sql语句历史记录和锁表的情况 (2012-01-04 20:59:59) 转载▼ 标签: 杂谈 分类: database 查询sql的历史记录 select * from v$sqlarea t where t.PARSING_SCHEMA_NAME in ('用户名') order by t.LAST_ACTIVE_TIME descselect * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc 查看一段时间内的执行情况
1.在pl/sql中打开cmd命令容器 2.在cmd命令窗口中输入:explain plan for select * from t; 3.查看sql语句的执行计划:select * from table(dbms_xplan.display); MISSES IN library cache during parse:1 翻译:发生在解析的硬解析数量为1,表示硬解析 MISSES IN library cache during parse:0 翻译:发生在解析的硬解析数量为0,表示没有硬解析,
20131016 周三 oracle pl/sql 程序设计 第2章 创建并运行pl/sql代码 sqlplus yjkhecc/yjkhecc@10.85.23.92:1521/orcl 在java中调用存储过程: create or replace procedure t_p(l_in in out number) is begin l_in := 5; end; @Test public void test() throws SQLException { DataSource ds = D
1.执行sql:select /*+ parallel(a,4) */ * from tf_f_user a where rownum<100000; 2.如何查看该sql语句的并行数量: select t.sql_text,t.sql_id,s.sid from v$sql t,v$session s where t.sql_id=s.sql_id and t.sql_text like '%rownum<100000%'; 执行上面sql语句发现是4条. 3.如果执行sql:select
第一章:日志管理 1.forcing log switches sql> alter system switch logfile; 2.forcing checkpoints sql> alter system checkpoint; 3.adding online redo log groups sql> alter database add logfile [group 4]sql> ('/disk3/log4a.rdo','/disk4/log4b.rdo') size 1m