How to Reduce redo size in Oracle

Source: Internet
Author: User

Lab instructions

1. In non-archive mode:

SQL> archive log list
Database Log mode non-archive Mode
Disable automatic archiving
Archiving end point USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 2491
Current Log sequence 2493

Use the sys user to create a view for querying the redo size (convenient query)

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

The view has been created.

Create synonyms with sys users

SQL> create public synonym redo_size for redo_size;

You have created a synonym.

Perform the following operations with scott:

Create test table

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

The table has been created.

View Current redo volume

SQL> select * from redo_size;

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

Insert data and view results

SQL> insert into test_redos select * from dba_objects;

You have created 73104 rows.

SQL> select * from redo_size;

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

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

You have created 73100 rows.

SQL> select * from redo_size;

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

SQL> select (8473536-736) normal insert, (8504856-8473536) append insert from dual;

Normal insert APPEND insert
--------------------
8472800 31320

The above results indicate that in non-archive mode, append inserts data to produce much less redo.

  • 1
  • 2
  • 3
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.