oracle insert、append、parallel、随后查询的redo与磁盘读写
SQL> set autotrace traceonly statistics;
SQL> insert into big_table_dir_test1 select * from big_table_dir_test; 2853792 rows created. Statistics
----------------------------------------------------------
148 recursive calls
358348 db block gets
111261 consistent gets
2 physical reads
333542568 redo size
832 bytes sent via SQL*Net to client
817 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
2 sorts (memory)
0 sorts (disk)
2853792 rows processed SQL> commit; Commit complete. SQL> select f.owner,f.object_name,f.data_object_id,count(1),max(f.data_object_id),min(f.object_id) from big_table_dir_test1 f
group by f.owner,f.object_name,f.data_object_id; 2 87653 rows selected. Statistics
----------------------------------------------------------
7 recursive calls
1 db block gets
41034 consistent gets
0 physical reads -- 传统路径insert只写buffer cache, redo保证重做
176 redo size
4428645 bytes sent via SQL*Net to client
64793 bytes received via SQL*Net from client
5845 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
87653 rows processed SQL> truncate table big_table_dir_test1; Table truncated.
SQL> insert /*+ append nologging */ into big_table_dir_test1 select * from big_table_dir_test; 2853792 rows created. Statistics
----------------------------------------------------------
228 recursive calls
44268 db block gets
42998 consistent gets
2 physical reads
376672 redo size
827 bytes sent via SQL*Net to client
841 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
2853792 rows processed SQL> SQL> commit; Commit complete. SQL> select f.owner,f.object_name,f.data_object_id,count(1),max(f.data_object_id),min(f.object_id) from big_table_dir_test1 f
group by f.owner,f.object_name,f.data_object_id;
2 87653 rows selected. Statistics
----------------------------------------------------------
5 recursive calls
1 db block gets
40831 consistent gets
40752 physical reads --直接路径插入后,不经过buffer cache
168 redo size
4413020 bytes sent via SQL*Net to client
64793 bytes received via SQL*Net from client
5845 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
87653 rows processed SQL> SQL> / 87653 rows selected. Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
40766 consistent gets
0 physical reads
0 redo size
4310178 bytes sent via SQL*Net to client
64793 bytes received via SQL*Net from client
5845 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
87653 rows processed
SQL> truncate table big_table_dir_test1; Table truncated. Elapsed: 00:00:00.62
SQL>
SQL> alter session enable parallel dml; Session altered. Elapsed: 00:00:00.00
SQL> SQL> insert /*+ parallel(c,4) */ into big_table_dir_test1 c select * from big_table_dir_test; 2853792 rows created. Elapsed: 00:00:03.69 Statistics
----------------------------------------------------------
13 recursive calls
2574 db block gets
43108 consistent gets
0 physical reads
119108 redo size -- insert中的parallel导致走了直接路径加载
830 bytes sent via SQL*Net to client
840 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
2853792 rows processed SQL> commit; Commit complete.
SQL> select f.owner,f.object_name,f.data_object_id,count(1),max(f.data_object_id),min(f.object_id) from big_table_dir_test1 f
group by f.owner,f.object_name,f.data_object_id; 2 87653 rows selected. Elapsed: 00:00:03.33 Statistics
----------------------------------------------------------
5 recursive calls
1 db block gets
40896 consistent gets
40752 physical reads -- 没有写buffer cache
168 redo size
4470876 bytes sent via SQL*Net to client
64793 bytes received via SQL*Net from client
5845 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
87653 rows processed
SQL> truncate table big_table_dir_test1; insert into big_table_dir_test1 select /*+ parallel(b 4) */ * from big_table_dir_test b;
Table truncated. Elapsed: 00:00:00.05
SQL> SQL> 2853792 rows created. Elapsed: 00:00:04.66 Statistics
----------------------------------------------------------
139 recursive calls
358365 db block gets
110606 consistent gets
2 physical reads
333527468 redo size
846 bytes sent via SQL*Net to client
840 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
2853792 rows processed SQL> select /*+ parallel(4) */f.owner,f.object_name,f.data_object_id,count(1),max(f.data_object_id),min(f.object_id) from big_table_dir_test1 f
group by f.owner,f.object_name,f.data_object_id; 2 87653 rows selected. Elapsed: 00:00:02.07 Statistics
----------------------------------------------------------
38 recursive calls
1 db block gets
41750 consistent gets
0 physical reads -- parallel走了buffer cache
176 redo size
4557551 bytes sent via SQL*Net to client
64793 bytes received via SQL*Net from client
5845 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
87653 rows processed
目前暂时无法做到直接路径加载同时满足不生成redo,同时又写一份到buffer cache,这只能依赖于操作系统缓存,但是过多的并发append会导Disk file operations I/O致等待事件。
This event is used to wait for disk file operations (for example, open, close, seek, and resize). It is also used for miscellaneous I/O operations such as block dumps and password file accesses.
Wait Time: The wait time is the actual time it takes to do the I/O
|
Parameter |
Description |
|
FileOperation |
Type of file operation |
|
fileno |
File identification number |
|
filetype |
Type of file (for example, log file, data file, and so on) |
我们知道操作系统在操作文件的时候,需要打开文件、关闭文件、定位文件位置等,当这些操作在进行的时候,Oracle就处于等待状态。
操作系统的这些文件操作可以划分如下:
1.file creation
2 file open
3 file resize
4 file deletion
5 file close
6 wait for all aio requests to finish
7 write verification
8 wait for miscellaneous io (ftp, block dump, passwd file)
9 read from snapshot files
oracle insert、append、parallel、随后查询的redo与磁盘读写的更多相关文章
- Oracle insert /*+ APPEND */原理解析
https://blog.csdn.net/xiaobluesky/article/details/50494101 关于insert /*+ append */我们需要注意以下三点: a.非归档模式 ...
- Oracle NoLogging Append 方式减少批量insert的redo_size
业务处理中,很多时候使用实表临时表处理中间结果,而实表的Insert操作缺省会记录redo log,针对此问题收集相关测试总结信息如下: [转] 常见dml.ddl语句使用nologging选项所生成 ...
- 关于insert /*+ append*/ 各种insert插入速度比较
来源于:http://www.cnblogs.com/rootq/archive/2009/02/11/1388043.html SQL> select count(*) from t;COUN ...
- insert /*+APPEND*/ 各种insert 插入速度比较
SQL> select count(*) from t;COUNT(*)----------5442048****************************SQL> alter ta ...
- 快速向表中插入大量数据Oracle中append与Nologging
来源于:http://blog.sina.com.cn/s/blog_61cd89f60102e7gi.html 当需要对一个非常大的表INSERT的时候,会消耗非常多的资源,因为update表的时候 ...
- Oracle中append与Nologging
快速向表中插入大量数据Oracle中append与Nologging 2017-05-05 / VIEWS: 304 来源于:http://blog.sina.com.cn/s/blog_61cd89 ...
- Oracle ROWNUM用法和分页查询总结(转)
[转载] Oracle的分页查询语句基本上可以按照本文给出的格式来进行套用. Oracle分页查询格式(一):http://yangtingkun.itpub.net/post/468/100278 ...
- Oracle DBA 必须掌握的 查询脚本:
Oracle DBA 必须掌握的 查询脚本: 0:启动与关闭 orcle 数据库的启动与关闭 1:连接数据库 2:数据库开启状态的实现步骤: 2-1:启动数据库 2- ...
- Oracle ROWNUM用法和分页查询总结
**************************************************************************************************** ...
随机推荐
- window alias给cmd命令起别名
场景: Linux的alias命令是个非常实用的工具,任何命令通过alias可以精简到很短,比如:alias l='ls -l' Windows也有alias类似的命令,就是:doskey,开启方法也 ...
- layui---form表单模块
虽然对layui比较熟悉了,但是今天有时间还是将layui的form表单模块重新看一下. https://www.layui.com/doc/modules/form.html 一.更新渲染 layu ...
- #define 宏定义
gcc Semaphores.c -lpthread --std=c99 1. 边际效应 2. \ 宏定义中一行写不下时,不能换行,必须\+换行 #define CPE_MAIN_PRINTF(fmt ...
- 【转载】python抓取网页时候,判断网页编码格式
在web开发的时候我们经常会遇到网页抓取和分析,各种语言都可以完成这个功能.我喜欢用python实现,因为python提供了很多成熟的模块,可以很方便的实现网页抓取.但是在抓取过程中会遇到编码的问题, ...
- PPT文件太大时可以考虑另存为PPTX格式
遇到一个PPT文件有24M,30多页,里面主要有一些图片. 使用自带的图片压缩功能进行压缩,发现没有什么改变,后来找了一些工具软件压缩,最多也只能减少22%. 后来另存为PPTX格式,减小到1.74M ...
- ERP实施顾问--理解客户的解决方案与实际需求
在企业进行信息化时实施方的顾问都会来现场进行"需求调研",再根据"调研"的结果进行双方确认,确认后按此蓝本进行开发实施. 一切看上去都很美好,需求明确.开发顺利 ...
- Javascript htmldecode
// HtmlDecode http://lab.msdn.microsoft.com/annotations/htmldecode.js // client side version of the ...
- 阿里云 centos 服务器无法自动挂载 nas 的问题
阿里云服务器 centos 7.3 ,开始是通过 fstab 配置的自动挂载: xxx.cn-hangzhou.nas.aliyuncs.com:/ /nas nfs4 auto 0 0 但服务器启动 ...
- sql server中的charindex函数用法解析(在一段字符中搜索字符或者字符串-----返回expression1在expression2出现的位置;反之,返回0)
https://blog.csdn.net/xinghuo0007/article/details/70651358 知识点一:charindex()语法 CHARINDEX ( expression ...
- Codeforces 1114 - A/B/C/D/E/F - (Undone)
链接:http://codeforces.com/contest/1114 A - Got Any Grapes? 题意:甲乙丙三个人吃葡萄,总共有三种葡萄:绿葡萄.紫葡萄和黑葡萄,甲乙丙三个人至少要 ...