1. SQL> set autotrace traceonly statistics;
  2. SQL> insert into big_table_dir_test1 select * from big_table_dir_test;
  3.  
  4. 2853792 rows created.
  5.  
  6. Statistics
  7. ----------------------------------------------------------
  8. 148 recursive calls
  9. 358348 db block gets
  10. 111261 consistent gets
  11. 2 physical reads
  12. 333542568 redo size
  13. 832 bytes sent via SQL*Net to client
  14. 817 bytes received via SQL*Net from client
  15. 3 SQL*Net roundtrips to/from client
  16. 2 sorts (memory)
  17. 0 sorts (disk)
  18. 2853792 rows processed
  19.  
  20. SQL> commit;
  21.  
  22. Commit complete.
  23.  
  24. 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
  25. group by f.owner,f.object_name,f.data_object_id; 2
  26.  
  27. 87653 rows selected.
  28.  
  29. Statistics
  30. ----------------------------------------------------------
  31. 7 recursive calls
  32. 1 db block gets
  33. 41034 consistent gets
  34. 0 physical reads -- 传统路径insert只写buffer cache, redo保证重做
  35. 176 redo size
  36. 4428645 bytes sent via SQL*Net to client
  37. 64793 bytes received via SQL*Net from client
  38. 5845 SQL*Net roundtrips to/from client
  39. 0 sorts (memory)
  40. 0 sorts (disk)
  41. 87653 rows processed
  42.  
  43. SQL> truncate table big_table_dir_test1;
  44.  
  45. Table truncated.
  1. SQL> insert /*+ append nologging */ into big_table_dir_test1 select * from big_table_dir_test;
  2.  
  3. 2853792 rows created.
  4.  
  5. Statistics
  6. ----------------------------------------------------------
  7. 228 recursive calls
  8. 44268 db block gets
  9. 42998 consistent gets
  10. 2 physical reads
  11. 376672 redo size
  12. 827 bytes sent via SQL*Net to client
  13. 841 bytes received via SQL*Net from client
  14. 3 SQL*Net roundtrips to/from client
  15. 1 sorts (memory)
  16. 0 sorts (disk)
  17. 2853792 rows processed
  18.  
  19. SQL> SQL> commit;
  20.  
  21. Commit complete.
  22.  
  23. 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
  24. group by f.owner,f.object_name,f.data_object_id;
  25. 2
  26.  
  27. 87653 rows selected.
  28.  
  29. Statistics
  30. ----------------------------------------------------------
  31. 5 recursive calls
  32. 1 db block gets
  33. 40831 consistent gets
  34. 40752 physical reads --直接路径插入后,不经过buffer cache
  35. 168 redo size
  36. 4413020 bytes sent via SQL*Net to client
  37. 64793 bytes received via SQL*Net from client
  38. 5845 SQL*Net roundtrips to/from client
  39. 0 sorts (memory)
  40. 0 sorts (disk)
  41. 87653 rows processed
  42.  
  43. SQL> SQL> /
  44.  
  45. 87653 rows selected.
  46.  
  47. Statistics
  48. ----------------------------------------------------------
  49. 0 recursive calls
  50. 0 db block gets
  51. 40766 consistent gets
  52. 0 physical reads
  53. 0 redo size
  54. 4310178 bytes sent via SQL*Net to client
  55. 64793 bytes received via SQL*Net from client
  56. 5845 SQL*Net roundtrips to/from client
  57. 0 sorts (memory)
  58. 0 sorts (disk)
  59. 87653 rows processed
  1. SQL> truncate table big_table_dir_test1;
  2.  
  3. Table truncated.
  4.  
  5. Elapsed: 00:00:00.62
  6. SQL>
  7. SQL> alter session enable parallel dml;
  8.  
  9. Session altered.
  10.  
  11. Elapsed: 00:00:00.00
  12. SQL> SQL> insert /*+ parallel(c,4) */ into big_table_dir_test1 c select * from big_table_dir_test;
  13.  
  14. 2853792 rows created.
  15.  
  16. Elapsed: 00:00:03.69
  17.  
  18. Statistics
  19. ----------------------------------------------------------
  20. 13 recursive calls
  21. 2574 db block gets
  22. 43108 consistent gets
  23. 0 physical reads
  24. 119108 redo size -- insert中的parallel导致走了直接路径加载
  25. 830 bytes sent via SQL*Net to client
  26. 840 bytes received via SQL*Net from client
  27. 3 SQL*Net roundtrips to/from client
  28. 1 sorts (memory)
  29. 0 sorts (disk)
  30. 2853792 rows processed
  31.  
  32. SQL> commit;
  33.  
  34. Commit complete.
  35. 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
  36. group by f.owner,f.object_name,f.data_object_id; 2
  37.  
  38. 87653 rows selected.
  39.  
  40. Elapsed: 00:00:03.33
  41.  
  42. Statistics
  43. ----------------------------------------------------------
  44. 5 recursive calls
  45. 1 db block gets
  46. 40896 consistent gets
  47. 40752 physical reads -- 没有写buffer cache
  48. 168 redo size
  49. 4470876 bytes sent via SQL*Net to client
  50. 64793 bytes received via SQL*Net from client
  51. 5845 SQL*Net roundtrips to/from client
  52. 0 sorts (memory)
  53. 0 sorts (disk)
  54. 87653 rows processed
  1. SQL> truncate table big_table_dir_test1;
  2.  
  3. insert into big_table_dir_test1 select /*+ parallel(b 4) */ * from big_table_dir_test b;
  4. Table truncated.
  5.  
  6. Elapsed: 00:00:00.05
  7. SQL> SQL>
  8.  
  9. 2853792 rows created.
  10.  
  11. Elapsed: 00:00:04.66
  12.  
  13. Statistics
  14. ----------------------------------------------------------
  15. 139 recursive calls
  16. 358365 db block gets
  17. 110606 consistent gets
  18. 2 physical reads
  19. 333527468 redo size
  20. 846 bytes sent via SQL*Net to client
  21. 840 bytes received via SQL*Net from client
  22. 3 SQL*Net roundtrips to/from client
  23. 1 sorts (memory)
  24. 0 sorts (disk)
  25. 2853792 rows processed
  26.  
  27. 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
  28. group by f.owner,f.object_name,f.data_object_id; 2
  29.  
  30. 87653 rows selected.
  31.  
  32. Elapsed: 00:00:02.07
  33.  
  34. Statistics
  35. ----------------------------------------------------------
  36. 38 recursive calls
  37. 1 db block gets
  38. 41750 consistent gets
  39. 0 physical reads -- parallel走了buffer cache
  40. 176 redo size
  41. 4557551 bytes sent via SQL*Net to client
  42. 64793 bytes received via SQL*Net from client
  43. 5845 SQL*Net roundtrips to/from client
  44. 0 sorts (memory)
  45. 0 sorts (disk)
  46. 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与磁盘读写的更多相关文章

  1. Oracle insert /*+ APPEND */原理解析

    https://blog.csdn.net/xiaobluesky/article/details/50494101 关于insert /*+ append */我们需要注意以下三点: a.非归档模式 ...

  2. Oracle NoLogging Append 方式减少批量insert的redo_size

    业务处理中,很多时候使用实表临时表处理中间结果,而实表的Insert操作缺省会记录redo log,针对此问题收集相关测试总结信息如下: [转] 常见dml.ddl语句使用nologging选项所生成 ...

  3. 关于insert /*+ append*/ 各种insert插入速度比较

    来源于:http://www.cnblogs.com/rootq/archive/2009/02/11/1388043.html SQL> select count(*) from t;COUN ...

  4. insert /*+APPEND*/ 各种insert 插入速度比较

    SQL> select count(*) from t;COUNT(*)----------5442048****************************SQL> alter ta ...

  5. 快速向表中插入大量数据Oracle中append与Nologging

    来源于:http://blog.sina.com.cn/s/blog_61cd89f60102e7gi.html 当需要对一个非常大的表INSERT的时候,会消耗非常多的资源,因为update表的时候 ...

  6. Oracle中append与Nologging

    快速向表中插入大量数据Oracle中append与Nologging 2017-05-05 / VIEWS: 304 来源于:http://blog.sina.com.cn/s/blog_61cd89 ...

  7. Oracle ROWNUM用法和分页查询总结(转)

    [转载] Oracle的分页查询语句基本上可以按照本文给出的格式来进行套用. Oracle分页查询格式(一):http://yangtingkun.itpub.net/post/468/100278 ...

  8. Oracle DBA 必须掌握的 查询脚本:

    Oracle  DBA 必须掌握的 查询脚本: 0:启动与关闭 orcle 数据库的启动与关闭 1:连接数据库 2:数据库开启状态的实现步骤:       2-1:启动数据库           2- ...

  9. Oracle ROWNUM用法和分页查询总结

    **************************************************************************************************** ...

随机推荐

  1. linux/nginx命令

    1.ps查看服务器所有的进程: -aux 显示所有状态 -ef 简洁信息 ps -aux | grep node 第二列是pid,杀掉程序使用kill. ps -ef | grep node 第一列是 ...

  2. PHP函数之dirname()

    1. 定义和用法 dirname()函数返回路径中的目录部分.即返回去掉文件名后的目录名. 2. 参数 dirname(path): 参数 path是一个包含有指向一个文件的全路径的字符串. 3. 举 ...

  3. HTML中的清除浮动的常用方法(转载)

    以下面的div为例: HTML: <div class="test"> <div class="test1"></div> ...

  4. luke下载使用

    网上内容太多,下载了却不管用,即使下载了,也不知道怎么用.(对我这种小白来说,大神就一笑而过吧) 下载地址:http://www.xdowns.com/app/253909.html(如若下载不到可以 ...

  5. C# word 图片大小

    通过Office自带的类库word文档中插入图片,图片大小的单位为磅 而文档中,图片的大小已经固定,为CM. 实际工作中,首先将图片插入到word中,根据目前的大小,计算转换为目标大小的比率,将长宽按 ...

  6. Struts2 标签库详解

    Struts2标签库 包括: OGNL Struts2标签分类 控制标签 :(if, elseif,else, iterator, append, merge, generator, subset, ...

  7. windows环境下MySQL mysql-5.7.17-winx64 (社区服务版,community server)安装教程

    根据网上查询的资料显示,MySQ在版本5.7开始根目录下没有dada目录,需要额外的“初始化数据库”的操作自动生成data目录. 1.    下载地址: https://cdn.mysql.com// ...

  8. Oracle工具——ADRCI

    ADRCI工具是Oracle11g才推出的新工具,主要用来管理alert文件.trace文件.dump文件.健康监事报告等. 这一篇简单介绍ADRCI工具. 用过11g的人都会发现,11g中alert ...

  9. sqlserver为不同数据库建立不同访问权限的帐号

    正式服务器中,为了安全.互不干扰,会给个DB库分配不同的账号,A库有ARead\AReadWrite\AOwn账号,B库有BRead\BReadWrite\BOwn账号.需要配置出来,甚至还能限制AR ...

  10. mybatis入门--配置

    1.导入jar包 mybatis-x.x.x.jar 导入到lib目录下, 如果使用 Maven 来构建项目,则需将下面的 dependency 代码置于 pom.xml 文件中: <depen ...