Home  >  Article  >  Database  >  Oracle 减少redo size的方法

Oracle 减少redo size的方法

WBOY
WBOYOriginal
2016-06-07 17:27:14974browse

用实验说明 一、在非归档模式下: SQLgt; archive log list数据库日志模式 非存档模式自动存档 禁用存档

用实验说明

一、在非归档模式下:

SQL> archive log list
数据库日志模式            非存档模式
自动存档            禁用
存档终点            USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列    2491
当前日志序列          2493

用sys用户创建查询redo size的视图(方便查询)

SQL> create or replace view redo_size
  2  as
  3  select value
  4    from v$mystat, v$statname
  5  where v$mystat.statistic# = v$statname.statistic#
  6    and v$statname.name = 'redo size';

视图已创建。

用sys用户创建同义词

SQL> create public synonym redo_size for redo_size;

同义词已创建。

以下用scott操作

创建测试表

SQL> create table test_redos as select * from dba_objects where 1=2;

表已创建。

查看当前redo量

SQL> select * from redo_size;

    VALUE
----------
      736

插入数据,,看结果

SQL> insert into test_redos select * from dba_objects;

已创建73104行。

SQL> select * from redo_size;

    VALUE
----------
  8473536

SQL> insert /*+ append */ into test_redos select * from dba_objects;

已创建73100行。

SQL> select * from redo_size;

    VALUE
----------
  8504856

SQL> select (8473536-736)普通插入,(8504856-8473536) append插入 from dual;

  普通插入 APPEND插入
---------- ----------
  8472800      31320

以上结果说明在非归档模式下,append插入数据产生的redo要少得多。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn