最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Oracle教程:select操作产生的redo

来源:动视网 责编:小采 时间:2020-11-09 11:58:44
文档

Oracle教程:select操作产生的redo

Oracle教程:select操作产生的redo:数据库版本: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 创建测试表:SQLgt; create table a as select * f 数据库版本: Oracle Database 10g Enterprise Edition Release 10.1.0.3
推荐度:
导读Oracle教程:select操作产生的redo:数据库版本: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 创建测试表:SQLgt; create table a as select * f 数据库版本: Oracle Database 10g Enterprise Edition Release 10.1.0.3


数据库版本: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 创建测试表:SQLgt; create table a as select * f

数据库版本:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0


创建测试表:
SQL> create table a as select * from all_objects ;
Table created.

SQL> set autotrace on statistics ;

插入数据(hint append):

SQL> insert /*+ append */ into a select * from all_objects ;
9891 rows created.

Statistics
----------------------------------------------------------
302 recursive calls
137 db block gets
6040 consistent gets
0 physical reads
1055332 redo size
627 bytes sent via SQL*Net to client
558 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
9891 rows processed
SQL> commit ;
Commit complete.

第一次查询数据:
SQL> select count(*) from a ;
COUNT(*)
----------
19782

Statistics
----------------------------------------------------------
0 recursive calls
1 db block gets
255 consistent gets
248 physical reads
168 redo size    ---------------------------------> ???产生redo??? 395 bytes sent via SQL*Net to client
507 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed


第二次查询:

SQL> select count(*) from a ;
COUNT(*)
----------
19782

Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
252 consistent gets
1 physical reads
0 redo size      
395 bytes sent via SQL*Net to client
507 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed


=================================================
如上所示,为什么在查询的时候会产生 redo ? 产生的redo 到底是做什么的?
=================================================
----

取消 hint append 插入数据,第一次查询不会产生redo

SQL> insert into a select * from a ;

19782 rows created.


Statistics
----------------------------------------------------------
112 recursive calls
21100 db block gets
699 consistent gets
0 physical reads
7149196 redo size
642 bytes sent via SQL*Net to client
534 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
19782 rows processed

SQL>
SQL>
SQL> select count(*) from a ;

COUNT(*)
----------
39564


Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
502 consistent gets
0 physical reads
0 redo size 395 bytes sent via SQL*Net to client
507 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
---------------------------------------------------

文档

Oracle教程:select操作产生的redo

Oracle教程:select操作产生的redo:数据库版本: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 创建测试表:SQLgt; create table a as select * f 数据库版本: Oracle Database 10g Enterprise Edition Release 10.1.0.3
推荐度:
标签: 操作 oracle select
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top